Loading init/builtins.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ #include <sys/wait.h> #include <unistd.h> #include <ApexProperties.sysprop.h> #include <android-base/chrono_utils.h> #include <android-base/file.h> #include <android-base/logging.h> Loading Loading @@ -130,6 +131,13 @@ static Result<void> do_class_start_post_data(const BuiltinArguments& args) { if (args.context != kInitContext) { return Error() << "command 'class_start_post_data' only available in init context"; } static bool is_apex_updatable = android::sysprop::ApexProperties::updatable().value_or(false); if (!is_apex_updatable) { // No need to start these on devices that don't support APEX, since they're not // stopped either. return {}; } for (const auto& service : ServiceList::GetInstance()) { if (service->classnames().count(args[1])) { if (auto result = service->StartIfPostData(); !result) { Loading @@ -155,6 +163,11 @@ static Result<void> do_class_reset_post_data(const BuiltinArguments& args) { if (args.context != kInitContext) { return Error() << "command 'class_reset_post_data' only available in init context"; } static bool is_apex_updatable = android::sysprop::ApexProperties::updatable().value_or(false); if (!is_apex_updatable) { // No need to stop these on devices that don't support APEX. return {}; } ForEachServiceInClass(args[1], &Service::ResetIfPostData); return {}; } Loading Loading
init/builtins.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ #include <sys/wait.h> #include <unistd.h> #include <ApexProperties.sysprop.h> #include <android-base/chrono_utils.h> #include <android-base/file.h> #include <android-base/logging.h> Loading Loading @@ -130,6 +131,13 @@ static Result<void> do_class_start_post_data(const BuiltinArguments& args) { if (args.context != kInitContext) { return Error() << "command 'class_start_post_data' only available in init context"; } static bool is_apex_updatable = android::sysprop::ApexProperties::updatable().value_or(false); if (!is_apex_updatable) { // No need to start these on devices that don't support APEX, since they're not // stopped either. return {}; } for (const auto& service : ServiceList::GetInstance()) { if (service->classnames().count(args[1])) { if (auto result = service->StartIfPostData(); !result) { Loading @@ -155,6 +163,11 @@ static Result<void> do_class_reset_post_data(const BuiltinArguments& args) { if (args.context != kInitContext) { return Error() << "command 'class_reset_post_data' only available in init context"; } static bool is_apex_updatable = android::sysprop::ApexProperties::updatable().value_or(false); if (!is_apex_updatable) { // No need to stop these on devices that don't support APEX. return {}; } ForEachServiceInClass(args[1], &Service::ResetIfPostData); return {}; } Loading