Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64143214 authored by David Anderson's avatar David Anderson Committed by Howard Chen
Browse files

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
Merged-In: I6075d08ed16b86fe158a6045ad23d0867ae9b66c
parent d191463b
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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;
            }
        }