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

Commit a3c58bf4 authored by PO HUNG CHEN's avatar PO HUNG CHEN Committed by Android (Google) Code Review
Browse files

Merge "Clean up usage on deprecated GSID methods"

parents d407db77 295d7496
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ public class DynamicSystemManager {
        @RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
        public boolean commit() {
            try {
                return mService.commit();
                return mService.setEnable(true, true);
            } catch (RemoteException e) {
                throw new RuntimeException(e.toString());
            }
@@ -188,9 +188,9 @@ public class DynamicSystemManager {
     * @return {@code true} if the call succeeds. {@code false} if there is no installed image.
     */
    @RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
    public boolean setEnable(boolean enable) {
    public boolean setEnable(boolean enable, boolean oneShot) {
        try {
            return mService.setEnable(enable);
            return mService.setEnable(enable, oneShot);
        } catch (RemoteException e) {
            throw new RuntimeException(e.toString());
        }
+3 −7
Original line number Diff line number Diff line
@@ -72,9 +72,11 @@ interface IDynamicSystemService
    /**
     * Enable or disable DynamicSystem.
     *
     * @param oneShot       If true, the GSI will boot once and then disable itself.
     *
     * @return true if the call succeeds
     */
    boolean setEnable(boolean enable);
    boolean setEnable(boolean enable, boolean oneShot);

    /**
     * Write a chunk of the DynamicSystem system image
@@ -83,10 +85,4 @@ interface IDynamicSystemService
     */
    boolean write(in byte[] buf);

    /**
     * Finish write and make device to boot into the it after reboot.
     *
     * @return true if the call succeeds
     */
    boolean commit();
}
+1 −1
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ public class DynamicSystemInstallationService extends Service
        if (mInstallTask != null && mInstallTask.getResult() == RESULT_OK) {
            enabled = mInstallTask.commit();
        } else if (isDynamicSystemInstalled()) {
            enabled = mDynSystem.setEnable(true);
            enabled = mDynSystem.setEnable(true, true);
        } else {
            Log.e(TAG, "Trying to reboot to AOT while there is no complete installation");
            return;
+4 −11
Original line number Diff line number Diff line
@@ -181,18 +181,16 @@ public class DynamicSystemService extends IDynamicSystemService.Stub implements

    @Override
    public boolean remove() throws RemoteException {
        return getGsiService().removeGsiInstall();
        return getGsiService().removeGsi();
    }

    @Override
    public boolean setEnable(boolean enable) throws RemoteException {
    public boolean setEnable(boolean enable, boolean oneShot) throws RemoteException {
        IGsiService gsiService = getGsiService();
        if (enable) {
            final int status = gsiService.getGsiBootStatus();
            final boolean singleBoot = (status == IGsiService.BOOT_STATUS_SINGLE_BOOT);
            return gsiService.setGsiBootable(singleBoot) == 0;
            return gsiService.enableGsi(oneShot) == 0;
        } else {
            return gsiService.disableGsiInstall();
            return gsiService.disableGsi();
        }
    }

@@ -200,9 +198,4 @@ public class DynamicSystemService extends IDynamicSystemService.Stub implements
    public boolean write(byte[] buf) throws RemoteException {
        return getGsiService().commitGsiChunkFromMemory(buf);
    }

    @Override
    public boolean commit() throws RemoteException {
        return getGsiService().setGsiBootable(true) == 0;
    }
}