diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-06-18 03:12:51 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-06-18 03:12:51 +0000 |
commit | debfb2ca1e74b9a02611bce1045effdc649b04a1 (patch) | |
tree | 065a272a2fa507d0d6982c7094a5df478a2d7588 | |
parent | 52534ebba1087f57169e067be9676388893acc73 (diff) | |
parent | 320211cbba531983d3646085adc1da11f4d15fae (diff) |
Snap for 5667727 from 320211cbba531983d3646085adc1da11f4d15fae to qt-qpr1-release
Change-Id: I4648df6648df8652fa2700532494700229583da7
-rw-r--r-- | fs_mgr/liblp/Android.bp | 38 | ||||
-rw-r--r-- | fs_mgr/liblp/AndroidTest.xml | 4 | ||||
-rw-r--r-- | init/property_service.cpp | 8 | ||||
-rw-r--r-- | libprocessgroup/cgroup_map.cpp | 5 | ||||
-rw-r--r-- | libprocessgroup/cgrouprc/cgroup_controller.cpp | 5 | ||||
-rw-r--r-- | libprocessgroup/cgrouprc/include/android/cgrouprc.h | 9 | ||||
-rw-r--r-- | libprocessgroup/cgrouprc/libcgrouprc.llndk.txt | 1 |
7 files changed, 34 insertions, 36 deletions
diff --git a/fs_mgr/liblp/Android.bp b/fs_mgr/liblp/Android.bp index 70399942e..b5041613a 100644 --- a/fs_mgr/liblp/Android.bp +++ b/fs_mgr/liblp/Android.bp @@ -14,6 +14,16 @@ // limitations under the License. // +liblp_lib_deps = [ + "libbase", + "liblog", + "libcrypto", + "libcrypto_utils", + "libsparse", + "libext4_utils", + "libz", +] + cc_library { name: "liblp", host_supported: true, @@ -30,15 +40,7 @@ cc_library { "utility.cpp", "writer.cpp", ], - shared_libs: [ - "libbase", - "liblog", - "libcrypto", - "libcrypto_utils", - "libsparse", - "libext4_utils", - "libz", - ], + shared_libs: liblp_lib_deps, target: { windows: { enabled: true, @@ -53,24 +55,28 @@ cc_library { } cc_test { - name: "liblp_test", + name: "liblp_test_static", defaults: ["fs_mgr_defaults"], cppflags: [ "-Wno-unused-parameter", ], static_libs: [ "libgmock", - ], - shared_libs: [ - "liblp", - "libbase", "libfs_mgr", - "libsparse", - ], + "liblp", + ] + liblp_lib_deps, + stl: "libc++_static", srcs: [ "builder_test.cpp", "io_test.cpp", "test_partition_opener.cpp", "utility_test.cpp", ], + target: { + android: { + static_libs: [ + "libcutils", + ], + }, + }, } diff --git a/fs_mgr/liblp/AndroidTest.xml b/fs_mgr/liblp/AndroidTest.xml index 007a302e0..fe1002c4e 100644 --- a/fs_mgr/liblp/AndroidTest.xml +++ b/fs_mgr/liblp/AndroidTest.xml @@ -21,8 +21,8 @@ </target_preparer> <test class="com.android.tradefed.testtype.VtsMultiDeviceTest"> <option name="test-module-name" value="VtsKernelLiblpTest"/> - <option name="binary-test-source" value="_32bit::DATA/nativetest/liblp_test/liblp_test" /> - <option name="binary-test-source" value="_64bit::DATA/nativetest64/liblp_test/liblp_test" /> + <option name="binary-test-source" value="_32bit::DATA/nativetest/liblp_test_static/liblp_test_static" /> + <option name="binary-test-source" value="_64bit::DATA/nativetest64/liblp_test_static/liblp_test_static" /> <option name="binary-test-type" value="gtest"/> <option name="test-timeout" value="1m"/> <option name="precondition-first-api-level" value="29" /> diff --git a/init/property_service.cpp b/init/property_service.cpp index fce8d578f..f2c7462ab 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -642,8 +642,14 @@ static void LoadProperties(char* data, const char* filter, const char* filename, while (isspace(*key)) key++; } - load_properties_from_file(fn, key, properties); + std::string raw_filename(fn); + std::string expanded_filename; + if (!expand_props(raw_filename, &expanded_filename)) { + LOG(ERROR) << "Could not expand filename '" << raw_filename << "'"; + continue; + } + load_properties_from_file(expanded_filename.c_str(), key, properties); } else { value = strchr(key, '='); if (!value) continue; diff --git a/libprocessgroup/cgroup_map.cpp b/libprocessgroup/cgroup_map.cpp index 92fcd1e71..9797d763f 100644 --- a/libprocessgroup/cgroup_map.cpp +++ b/libprocessgroup/cgroup_map.cpp @@ -70,8 +70,8 @@ bool CgroupController::HasValue() const { bool CgroupController::IsUsable() const { if (!HasValue()) return false; - uint32_t flags = ACgroupController_getFlags(controller_); - return (flags & CGROUPRC_CONTROLLER_FLAG_MOUNTED) != 0; + static bool enabled = (access(GetProcsFilePath("", 0, 0).c_str(), F_OK) == 0); + return enabled; } std::string CgroupController::GetTasksFilePath(const std::string& rel_path) const { @@ -160,7 +160,6 @@ void CgroupMap::Print() const { const ACgroupController* controller = ACgroupFile_getController(i); LOG(INFO) << "\t" << ACgroupController_getName(controller) << " ver " << ACgroupController_getVersion(controller) << " path " - << ACgroupController_getFlags(controller) << " flags " << ACgroupController_getPath(controller); } } diff --git a/libprocessgroup/cgrouprc/cgroup_controller.cpp b/libprocessgroup/cgrouprc/cgroup_controller.cpp index 5a326e55d..d064d312e 100644 --- a/libprocessgroup/cgrouprc/cgroup_controller.cpp +++ b/libprocessgroup/cgrouprc/cgroup_controller.cpp @@ -27,11 +27,6 @@ uint32_t ACgroupController_getVersion(const ACgroupController* controller) { return controller->version(); } -uint32_t ACgroupController_getFlags(const ACgroupController* controller) { - CHECK(controller != nullptr); - return controller->flags(); -} - const char* ACgroupController_getName(const ACgroupController* controller) { CHECK(controller != nullptr); return controller->name(); diff --git a/libprocessgroup/cgrouprc/include/android/cgrouprc.h b/libprocessgroup/cgrouprc/include/android/cgrouprc.h index ffc9f0b60..0f6a9cd5d 100644 --- a/libprocessgroup/cgrouprc/include/android/cgrouprc.h +++ b/libprocessgroup/cgrouprc/include/android/cgrouprc.h @@ -66,18 +66,11 @@ __attribute__((warn_unused_result)) uint32_t ACgroupController_getVersion(const __INTRODUCED_IN(29); /** - * Flag bitmask used in ACgroupController_getFlags + * Flag bitmask to be used when ACgroupController_getFlags can be exported */ #define CGROUPRC_CONTROLLER_FLAG_MOUNTED 0x1 /** - * Returns the flags bitmask of the given controller. - * If the given controller is null, return 0. - */ -__attribute__((warn_unused_result)) uint32_t ACgroupController_getFlags(const ACgroupController*) - __INTRODUCED_IN(29); - -/** * Returns the name of the given controller. * If the given controller is null, return nullptr. */ diff --git a/libprocessgroup/cgrouprc/libcgrouprc.llndk.txt b/libprocessgroup/cgrouprc/libcgrouprc.llndk.txt index ea3df33e6..91df3929d 100644 --- a/libprocessgroup/cgrouprc/libcgrouprc.llndk.txt +++ b/libprocessgroup/cgrouprc/libcgrouprc.llndk.txt @@ -4,7 +4,6 @@ LIBCGROUPRC { # introduced=29 ACgroupFile_getControllerCount; ACgroupFile_getController; ACgroupController_getVersion; - ACgroupController_getFlags; ACgroupController_getName; ACgroupController_getPath; local: |