Loading init/service.cpp +8 −7 Original line number Diff line number Diff line Loading @@ -116,9 +116,10 @@ static bool ExpandArgsAndExecv(const std::vector<std::string>& args, bool sigsto return execv(c_strings[0], c_strings.data()) == 0; } static bool IsRuntimeApexReady() { static bool AreRuntimeApexesReady() { struct stat buf; return stat("/apex/com.android.runtime/", &buf) == 0; return stat("/apex/com.android.art/", &buf) == 0 && stat("/apex/com.android.runtime/", &buf) == 0; } unsigned long Service::next_start_order_ = 1; Loading Loading @@ -406,11 +407,11 @@ Result<void> Service::Start() { scon = *result; } if (!IsRuntimeApexReady() && !pre_apexd_) { // If this service is started before the runtime APEX gets available, // mark it as pre-apexd one. Note that this marking is permanent. So // for example, if the service is re-launched (e.g., due to crash), // it is still recognized as pre-apexd... for consistency. if (!AreRuntimeApexesReady() && !pre_apexd_) { // If this service is started before the Runtime and ART APEXes get // available, mark it as pre-apexd one. Note that this marking is // permanent. So for example, if the service is re-launched (e.g., due // to crash), it is still recognized as pre-apexd... for consistency. pre_apexd_ = true; } Loading Loading
init/service.cpp +8 −7 Original line number Diff line number Diff line Loading @@ -116,9 +116,10 @@ static bool ExpandArgsAndExecv(const std::vector<std::string>& args, bool sigsto return execv(c_strings[0], c_strings.data()) == 0; } static bool IsRuntimeApexReady() { static bool AreRuntimeApexesReady() { struct stat buf; return stat("/apex/com.android.runtime/", &buf) == 0; return stat("/apex/com.android.art/", &buf) == 0 && stat("/apex/com.android.runtime/", &buf) == 0; } unsigned long Service::next_start_order_ = 1; Loading Loading @@ -406,11 +407,11 @@ Result<void> Service::Start() { scon = *result; } if (!IsRuntimeApexReady() && !pre_apexd_) { // If this service is started before the runtime APEX gets available, // mark it as pre-apexd one. Note that this marking is permanent. So // for example, if the service is re-launched (e.g., due to crash), // it is still recognized as pre-apexd... for consistency. if (!AreRuntimeApexesReady() && !pre_apexd_) { // If this service is started before the Runtime and ART APEXes get // available, mark it as pre-apexd one. Note that this marking is // permanent. So for example, if the service is re-launched (e.g., due // to crash), it is still recognized as pre-apexd... for consistency. pre_apexd_ = true; } Loading