Loading packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java +14 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,10 @@ public class DynamicSystemInstallationService extends Service private static final String TAG = "DynSystemInstallationService"; // TODO (b/131866826): This is currently for test only. Will move this to System API. static final String KEY_ENABLE_WHEN_COMPLETED = "KEY_ENABLE_WHEN_COMPLETED"; /* * Intent actions */ Loading Loading @@ -122,6 +126,9 @@ public class DynamicSystemInstallationService extends Service private long mInstalledSize; private boolean mJustCancelledByUser; // This is for testing only now private boolean mEnableWhenCompleted; private InstallationAsyncTask mInstallTask; Loading Loading @@ -178,6 +185,11 @@ public class DynamicSystemInstallationService extends Service public void onResult(int result, Throwable detail) { if (result == RESULT_OK) { postStatus(STATUS_READY, CAUSE_INSTALL_COMPLETED, null); // For testing: enable DSU and restart the device when install completed if (mEnableWhenCompleted) { executeRebootToDynSystemCommand(); } return; } Loading Loading @@ -224,6 +236,7 @@ public class DynamicSystemInstallationService extends Service String url = intent.getDataString(); mSystemSize = intent.getLongExtra(DynamicSystemClient.KEY_SYSTEM_SIZE, 0); mUserdataSize = intent.getLongExtra(DynamicSystemClient.KEY_USERDATA_SIZE, 0); mEnableWhenCompleted = intent.getBooleanExtra(KEY_ENABLE_WHEN_COMPLETED, false); mInstallTask = new InstallationAsyncTask( url, mSystemSize, mUserdataSize, this, mDynSystem, this); Loading Loading @@ -275,7 +288,7 @@ public class DynamicSystemInstallationService extends Service private void executeRebootToDynSystemCommand() { boolean enabled = false; if (mInstallTask != null && mInstallTask.getStatus() == FINISHED) { if (mInstallTask != null && mInstallTask.getResult() == RESULT_OK) { enabled = mInstallTask.commit(); } else if (isDynamicSystemInstalled()) { enabled = mDynSystem.setEnable(true); Loading packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java +4 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ public class VerificationActivity extends Activity { Uri url = callingIntent.getData(); long systemSize = callingIntent.getLongExtra(KEY_SYSTEM_SIZE, 0); long userdataSize = callingIntent.getLongExtra(KEY_USERDATA_SIZE, 0); boolean enableWhenCompleted = callingIntent.getBooleanExtra( DynamicSystemInstallationService.KEY_ENABLE_WHEN_COMPLETED, false); sVerifiedUrl = url.toString(); Loading @@ -101,6 +103,8 @@ public class VerificationActivity extends Activity { intent.setAction(DynamicSystemClient.ACTION_START_INSTALL); intent.putExtra(KEY_SYSTEM_SIZE, systemSize); intent.putExtra(KEY_USERDATA_SIZE, userdataSize); intent.putExtra( DynamicSystemInstallationService.KEY_ENABLE_WHEN_COMPLETED, enableWhenCompleted); Log.d(TAG, "Starting Installation Service"); startServiceAsUser(intent, UserHandle.SYSTEM); Loading Loading
packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java +14 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,10 @@ public class DynamicSystemInstallationService extends Service private static final String TAG = "DynSystemInstallationService"; // TODO (b/131866826): This is currently for test only. Will move this to System API. static final String KEY_ENABLE_WHEN_COMPLETED = "KEY_ENABLE_WHEN_COMPLETED"; /* * Intent actions */ Loading Loading @@ -122,6 +126,9 @@ public class DynamicSystemInstallationService extends Service private long mInstalledSize; private boolean mJustCancelledByUser; // This is for testing only now private boolean mEnableWhenCompleted; private InstallationAsyncTask mInstallTask; Loading Loading @@ -178,6 +185,11 @@ public class DynamicSystemInstallationService extends Service public void onResult(int result, Throwable detail) { if (result == RESULT_OK) { postStatus(STATUS_READY, CAUSE_INSTALL_COMPLETED, null); // For testing: enable DSU and restart the device when install completed if (mEnableWhenCompleted) { executeRebootToDynSystemCommand(); } return; } Loading Loading @@ -224,6 +236,7 @@ public class DynamicSystemInstallationService extends Service String url = intent.getDataString(); mSystemSize = intent.getLongExtra(DynamicSystemClient.KEY_SYSTEM_SIZE, 0); mUserdataSize = intent.getLongExtra(DynamicSystemClient.KEY_USERDATA_SIZE, 0); mEnableWhenCompleted = intent.getBooleanExtra(KEY_ENABLE_WHEN_COMPLETED, false); mInstallTask = new InstallationAsyncTask( url, mSystemSize, mUserdataSize, this, mDynSystem, this); Loading Loading @@ -275,7 +288,7 @@ public class DynamicSystemInstallationService extends Service private void executeRebootToDynSystemCommand() { boolean enabled = false; if (mInstallTask != null && mInstallTask.getStatus() == FINISHED) { if (mInstallTask != null && mInstallTask.getResult() == RESULT_OK) { enabled = mInstallTask.commit(); } else if (isDynamicSystemInstalled()) { enabled = mDynSystem.setEnable(true); Loading
packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java +4 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ public class VerificationActivity extends Activity { Uri url = callingIntent.getData(); long systemSize = callingIntent.getLongExtra(KEY_SYSTEM_SIZE, 0); long userdataSize = callingIntent.getLongExtra(KEY_USERDATA_SIZE, 0); boolean enableWhenCompleted = callingIntent.getBooleanExtra( DynamicSystemInstallationService.KEY_ENABLE_WHEN_COMPLETED, false); sVerifiedUrl = url.toString(); Loading @@ -101,6 +103,8 @@ public class VerificationActivity extends Activity { intent.setAction(DynamicSystemClient.ACTION_START_INSTALL); intent.putExtra(KEY_SYSTEM_SIZE, systemSize); intent.putExtra(KEY_USERDATA_SIZE, userdataSize); intent.putExtra( DynamicSystemInstallationService.KEY_ENABLE_WHEN_COMPLETED, enableWhenCompleted); Log.d(TAG, "Starting Installation Service"); startServiceAsUser(intent, UserHandle.SYSTEM); Loading