From 026adf0864f5971967caada56f079661ecb44139 Mon Sep 17 00:00:00 2001 From: Howard Chen Date: Tue, 25 Feb 2020 16:31:10 +0800 Subject: [PATCH] Refine the exported DSU status The new exported DSU status removes the need to make blocking binder calls out of system server during device boot. Bug: 149790245 Bug: 149716497 Test: adb shell am start-activity \ -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \ -a android.os.image.action.START_INSTALL \ -d file:///storage/emulated/0/Download/system.raw.gz \ --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \ --el KEY_USERDATA_SIZE 8589934592 Change-Id: I27fae316214498407a73474ca8b93aec3518e4b5 Merged-In: I27fae316214498407a73474ca8b93aec3518e4b5 (cherry picked from commit 2e1c6b26a1fe4799b830c2a6d536afd44c718491) --- init/init.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/init/init.cpp b/init/init.cpp index 5bf1b36c9..2d2cf9a84 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -723,11 +723,10 @@ int SecondStageMain(int argc, char** argv) { if (false) DumpState(); // Make the GSI status available before scripts start running. - if (android::gsi::IsGsiRunning()) { - SetProperty("ro.gsid.image_running", "1"); - } else { - SetProperty("ro.gsid.image_running", "0"); - } + auto is_running = android::gsi::IsGsiRunning() ? "1" : "0"; + SetProperty(gsi::kGsiBootedProp, is_running); + auto is_installed = android::gsi::IsGsiInstalled() ? "1" : "0"; + SetProperty(gsi::kGsiInstalledProp, is_installed); am.QueueBuiltinAction(SetupCgroupsAction, "SetupCgroups"); am.QueueBuiltinAction(SetKptrRestrictAction, "SetKptrRestrict");