diff options
author | Yo Chiang <yochiang@google.com> | 2020-02-24 11:53:29 +0800 |
---|---|---|
committer | Yo Chiang <yochiang@google.com> | 2020-02-24 15:06:56 +0800 |
commit | f41e145480342d99df13bcfaaa609fdc817d32b2 (patch) | |
tree | bea378a4ee5c9ae58ac86224f47532c601cd191a /packages/DynamicSystemInstallationService/src | |
parent | 8a6562112aaa88871c311d19b44a811c5f7a70d9 (diff) |
Add DSU default userdata partition size
Use DEFAULT_USERDATA_SIZE as userdata partition size if the calling
Intent desn't specify the userdata size or the specified size is zero.
Bug: 145891687
Test: adb shell am start-activity \
-n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
-a android.os.image.action.START_INSTALL \
-d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip
Change-Id: I52767dfefef394403c5e16fcfd40792b14ff9a71
Diffstat (limited to 'packages/DynamicSystemInstallationService/src')
-rw-r--r-- | packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java index 37a77be52983..f36f97ddf610 100644 --- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java +++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java @@ -82,6 +82,9 @@ public class DynamicSystemInstallationService extends Service static final String DEFAULT_DSU_SLOT = "dsu"; static final String KEY_PUBKEY = "KEY_PUBKEY"; + // Default userdata partition size is 2GiB. + private static final long DEFAULT_USERDATA_SIZE = 2L << 30; + /* * Intent actions */ @@ -270,6 +273,10 @@ public class DynamicSystemInstallationService extends Service String dsuSlot = intent.getStringExtra(KEY_DSU_SLOT); String publicKey = intent.getStringExtra(KEY_PUBKEY); + if (userdataSize == 0) { + userdataSize = DEFAULT_USERDATA_SIZE; + } + if (TextUtils.isEmpty(dsuSlot)) { dsuSlot = DEFAULT_DSU_SLOT; } |