summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Anderson <dvander@google.com> 2019-07-12 16:24:09 -0700
committer David Anderson <dvander@google.com> 2019-07-12 18:42:47 -0700
commit38f030dc76b2ac81e7b2e98b4ac437c453593750 (patch)
tree51897b30c75f12e4624972c128769ab096f8d89a
parent26315e23945b30f4cafa742d4e628cc9ad963fae (diff)
DynamicSystemService: Use IGsid which reference-counts the gsid service.
gsid should not be force-stopped. If it is no longer needed, the reference to IGsiService should be dropped. Bug: 133528572 Test: install GSI via DSU Change-Id: I6075d08ed16b86fe158a6045ad23d0867ae9b66c
-rw-r--r--services/core/java/com/android/server/DynamicSystemService.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/DynamicSystemService.java b/services/core/java/com/android/server/DynamicSystemService.java
index f92d0e0ff6f1..173d5b053309 100644
--- a/services/core/java/com/android/server/DynamicSystemService.java
+++ b/services/core/java/com/android/server/DynamicSystemService.java
@@ -21,6 +21,7 @@ import android.content.pm.PackageManager;
import android.gsi.GsiInstallParams;
import android.gsi.GsiProgress;
import android.gsi.IGsiService;
+import android.gsi.IGsid;
import android.os.Environment;
import android.os.IBinder;
import android.os.IBinder.DeathRecipient;
@@ -61,7 +62,9 @@ public class DynamicSystemService extends IDynamicSystemService.Stub implements
* re-initialized in this case.
*/
binder.linkToDeath(recipient, 0);
- return IGsiService.Stub.asInterface(binder);
+
+ IGsid gsid = IGsid.Stub.asInterface(binder);
+ return gsid.getClient();
}
/** implements DeathRecipient */
@@ -159,7 +162,7 @@ public class DynamicSystemService extends IDynamicSystemService.Stub implements
isInUse = getGsiService().isGsiRunning();
} finally {
if (!gsidWasRunning && !isInUse) {
- SystemProperties.set("ctl.stop", "gsid");
+ mGsiService = null;
}
}