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

Commit b008e122 authored by JW Wang's avatar JW Wang
Browse files

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
parent c85dfa3d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;
+1 −2
Original line number Diff line number Diff line
@@ -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";