diff options
-rw-r--r-- | cmds/installd/InstalldNativeService.cpp | 6 | ||||
-rw-r--r-- | cmds/installd/InstalldNativeService.h | 2 | ||||
-rw-r--r-- | cmds/installd/binder/android/os/IInstalld.aidl | 3 | ||||
-rw-r--r-- | cmds/installd/dexopt.cpp | 2 | ||||
-rw-r--r-- | cmds/installd/dexopt.h | 3 | ||||
-rw-r--r-- | cmds/installd/tests/installd_dexopt_test.cpp | 13 |
6 files changed, 16 insertions, 13 deletions
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index 04e39f9bac..6877fb73fd 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -1863,13 +1863,13 @@ binder::Status InstalldNativeService::mergeProfiles(int32_t uid, const std::stri return ok(); } -binder::Status InstalldNativeService::snapshotProfile(int32_t appId, const std::string& packageName, - const std::string& codePath, bool* _aidl_return) { +binder::Status InstalldNativeService::createProfileSnapshot(int32_t appId, + const std::string& packageName, const std::string& codePath, bool* _aidl_return) { ENFORCE_UID(AID_SYSTEM); CHECK_ARGUMENT_PACKAGE_NAME(packageName); std::lock_guard<std::recursive_mutex> lock(mLock); - *_aidl_return = snapshot_profile(appId, packageName, codePath); + *_aidl_return = create_profile_snapshot(appId, packageName, codePath); return ok(); } diff --git a/cmds/installd/InstalldNativeService.h b/cmds/installd/InstalldNativeService.h index f205efc10c..2d22934afe 100644 --- a/cmds/installd/InstalldNativeService.h +++ b/cmds/installd/InstalldNativeService.h @@ -96,7 +96,7 @@ public: binder::Status clearAppProfiles(const std::string& packageName); binder::Status destroyAppProfiles(const std::string& packageName); - binder::Status snapshotProfile(int32_t appId, const std::string& packageName, + binder::Status createProfileSnapshot(int32_t appId, const std::string& packageName, const std::string& codePath, bool* _aidl_return); binder::Status destroyProfileSnapshot(const std::string& packageName, const std::string& codePath); diff --git a/cmds/installd/binder/android/os/IInstalld.aidl b/cmds/installd/binder/android/os/IInstalld.aidl index 33741063f6..dbd89f5e21 100644 --- a/cmds/installd/binder/android/os/IInstalld.aidl +++ b/cmds/installd/binder/android/os/IInstalld.aidl @@ -62,7 +62,8 @@ interface IInstalld { void clearAppProfiles(@utf8InCpp String packageName); void destroyAppProfiles(@utf8InCpp String packageName); - boolean snapshotProfile(int appId, @utf8InCpp String packageName, @utf8InCpp String codePath); + boolean createProfileSnapshot(int appId, @utf8InCpp String packageName, + @utf8InCpp String codePath); void destroyProfileSnapshot(@utf8InCpp String packageName, @utf8InCpp String codePath); void idmap(@utf8InCpp String targetApkPath, @utf8InCpp String overlayApkPath, int uid); diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp index 8917684f77..88edd0a55d 100644 --- a/cmds/installd/dexopt.cpp +++ b/cmds/installd/dexopt.cpp @@ -2310,7 +2310,7 @@ bool create_cache_path_default(char path[PKG_PATH_MAX], const char *src, } } -bool snapshot_profile(int32_t app_id, const std::string& package_name, +bool create_profile_snapshot(int32_t app_id, const std::string& package_name, const std::string& code_path) { int app_shared_gid = multiuser_get_shared_gid(/*user_id*/ 0, app_id); diff --git a/cmds/installd/dexopt.h b/cmds/installd/dexopt.h index 8ece893f38..8d81611067 100644 --- a/cmds/installd/dexopt.h +++ b/cmds/installd/dexopt.h @@ -59,7 +59,8 @@ bool analyze_primary_profiles(uid_t uid, const std::string& pkgname); // ownership is assigned to AID_SYSTEM. // The snapshot location is reference_profile_location.snapshot. If a snapshot is already // there, it will be truncated and overwritten. -bool snapshot_profile(int32_t app_id, const std::string& package, const std::string& code_path); +bool create_profile_snapshot(int32_t app_id, const std::string& package, + const std::string& code_path); bool dump_profiles(int32_t uid, const std::string& pkgname, const char* code_paths); diff --git a/cmds/installd/tests/installd_dexopt_test.cpp b/cmds/installd/tests/installd_dexopt_test.cpp index 05d7b6c03a..eaf0aa1b28 100644 --- a/cmds/installd/tests/installd_dexopt_test.cpp +++ b/cmds/installd/tests/installd_dexopt_test.cpp @@ -451,9 +451,10 @@ class ProfileTest : public DexoptTest { } } - void SnapshotProfile(int32_t appid, const std::string& package_name, bool expected_result) { + void createProfileSnapshot(int32_t appid, const std::string& package_name, + bool expected_result) { bool result; - binder::Status binder_result = service_->snapshotProfile( + binder::Status binder_result = service_->createProfileSnapshot( appid, package_name, "base.jar", &result); ASSERT_TRUE(binder_result.isOk()); ASSERT_EQ(expected_result, result); @@ -531,7 +532,7 @@ TEST_F(ProfileTest, ProfileSnapshotOk) { LOG(INFO) << "ProfileSnapshotOk"; SetupProfiles(/*setup_ref*/ true); - SnapshotProfile(kTestAppId, package_name_, /*expected_result*/ true); + createProfileSnapshot(kTestAppId, package_name_, /*expected_result*/ true); } // The reference profile is created on the fly. We need to be able to @@ -540,21 +541,21 @@ TEST_F(ProfileTest, ProfileSnapshotOkNoReference) { LOG(INFO) << "ProfileSnapshotOkNoReference"; SetupProfiles(/*setup_ref*/ false); - SnapshotProfile(kTestAppId, package_name_, /*expected_result*/ true); + createProfileSnapshot(kTestAppId, package_name_, /*expected_result*/ true); } TEST_F(ProfileTest, ProfileSnapshotFailWrongPackage) { LOG(INFO) << "ProfileSnapshotFailWrongPackage"; SetupProfiles(/*setup_ref*/ true); - SnapshotProfile(kTestAppId, "not.there", /*expected_result*/ false); + createProfileSnapshot(kTestAppId, "not.there", /*expected_result*/ false); } TEST_F(ProfileTest, ProfileSnapshotDestroySnapshot) { LOG(INFO) << "ProfileSnapshotDestroySnapshot"; SetupProfiles(/*setup_ref*/ true); - SnapshotProfile(kTestAppId, package_name_, /*expected_result*/ true); + createProfileSnapshot(kTestAppId, package_name_, /*expected_result*/ true); binder::Status binder_result = service_->destroyProfileSnapshot(package_name_, "base.jar"); ASSERT_TRUE(binder_result.isOk()); |