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)
diff --git a/init/init.cpp b/init/init.cpp
index 5bf1b36..2d2cf9a 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -723,11 +723,10 @@
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");