DSU enhancement (2/N)

* Expose KEY_ENABLE_WHEN_COMPLETED
  This will streamline the UI flow where
  the device will reboot immediately when the installation is
  done.

Bug: 277691885
Test: adb shell am start-activity \
  -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
  -a android.os.image.action.START_INSTALL \
  --el KEY_USERDATA_SIZE 2147483648 \
  --ez KEY_ENABLE_WHEN_COMPLETED true
Change-Id: I63cfd66647ac0cfc312ef329d18aba89b93aa990
This commit is contained in:
JW Wang
2023-04-10 14:51:37 +08:00
parent c85dfa3da5
commit b008e122c6
2 changed files with 7 additions and 2 deletions

View File

@@ -217,6 +217,12 @@ public class DynamicSystemClient {
*/
public static final String KEY_USERDATA_SIZE = "KEY_USERDATA_SIZE";
/**
* Intent key: Whether to enable DynamicSystem immediately after installation is done.
* Note this will reboot the device automatically.
* @hide
*/
public static final String KEY_ENABLE_WHEN_COMPLETED = "KEY_ENABLE_WHEN_COMPLETED";
private static class IncomingHandler extends Handler {
private final WeakReference<DynamicSystemClient> mWeakClient;

View File

@@ -27,6 +27,7 @@ import static android.os.image.DynamicSystemClient.CAUSE_ERROR_IO;
import static android.os.image.DynamicSystemClient.CAUSE_INSTALL_CANCELLED;
import static android.os.image.DynamicSystemClient.CAUSE_INSTALL_COMPLETED;
import static android.os.image.DynamicSystemClient.CAUSE_NOT_SPECIFIED;
import static android.os.image.DynamicSystemClient.KEY_ENABLE_WHEN_COMPLETED;
import static android.os.image.DynamicSystemClient.STATUS_IN_PROGRESS;
import static android.os.image.DynamicSystemClient.STATUS_IN_USE;
import static android.os.image.DynamicSystemClient.STATUS_NOT_STARTED;
@@ -77,8 +78,6 @@ public class DynamicSystemInstallationService extends Service
private static final String TAG = "DynamicSystemInstallationService";
// 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";
static final String KEY_DSU_SLOT = "KEY_DSU_SLOT";
static final String DEFAULT_DSU_SLOT = "dsu";
static final String KEY_PUBKEY = "KEY_PUBKEY";