Merge "Removed property init.apex.<apex-name>.load/unload."

This commit is contained in:
Jooyung Han 2022-09-02 06:46:54 +00:00 committed by Gerrit Code Review
commit c69bcd4a6d
3 changed files with 3 additions and 22 deletions

View file

@ -81,16 +81,13 @@ static Result<void> ParseConfigs(const std::vector<std::string>& configs) {
}
Result<void> ParseApexConfigs(const std::string& apex_name) {
Result<std::vector<std::string>> configs = CollectApexConfigs(apex_name);
if (!configs.ok()) {
return configs.error();
}
auto configs = OR_RETURN(CollectApexConfigs(apex_name));
if (configs.value().empty()) {
if (configs.empty()) {
return {};
}
auto filtered_configs = FilterVersionedConfigs(configs.value(),
auto filtered_configs = FilterVersionedConfigs(configs,
android::base::GetIntProperty("ro.build.version.sdk", INT_MAX));
return ParseConfigs(filtered_configs);
}

View file

@ -490,7 +490,6 @@ static Result<void> DoUnloadApex(const std::string& apex_name) {
return Error() << "Unable to stop all service from " << apex_name;
}
RemoveServiceAndActionFromApex(apex_name);
SetProperty("init.apex." + apex_name, "unloaded");
return {};
}
@ -522,7 +521,6 @@ static Result<void> DoLoadApex(const std::string& apex_name) {
return result.error();
}
SetProperty("init.apex." + apex_name, "loaded");
return {};
}

View file

@ -535,20 +535,6 @@ TEST(init, LazilyLoadedActionsCanBeTriggeredByTheNextTrigger) {
EXPECT_EQ(2, num_executed);
}
TEST(init, RespondToCtlApexMessages) {
if (getuid() != 0) {
GTEST_SKIP() << "Skipping test, must be run as root.";
return;
}
std::string apex_name = "com.android.apex.cts.shim";
SetProperty("ctl.apex_unload", apex_name);
EXPECT_TRUE(WaitForProperty("init.apex." + apex_name, "unloaded", 10s));
SetProperty("ctl.apex_load", apex_name);
EXPECT_TRUE(WaitForProperty("init.apex." + apex_name, "loaded", 10s));
}
TEST(init, RejectsCriticalAndOneshotService) {
if (GetIntProperty("ro.product.first_api_level", 10000) < 30) {
GTEST_SKIP() << "Test only valid for devices launching with R or later";