Loading core/java/android/os/image/DynamicSystemManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -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()); } Loading Loading @@ -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()); } Loading core/java/android/os/image/IDynamicSystemService.aidl +3 −7 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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(); } packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading services/core/java/com/android/server/DynamicSystemService.java +4 −11 Original line number Diff line number Diff line Loading @@ -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(); } } Loading @@ -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; } } Loading
core/java/android/os/image/DynamicSystemManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -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()); } Loading Loading @@ -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()); } Loading
core/java/android/os/image/IDynamicSystemService.aidl +3 −7 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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(); }
packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
services/core/java/com/android/server/DynamicSystemService.java +4 −11 Original line number Diff line number Diff line Loading @@ -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(); } } Loading @@ -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; } }