Expand the "DynSystem" abbreviation to "DynamicSystem".
For simpler log grepping.
Bug: 165471299
Test: No
Change-Id: Ibec692ae45539dacd55e13ffaa903b58f3bf0417
DSU service would try to install a DSU scratch partition if host system
is debuggable.
If the scratch partition failed to install, then skip installing
scratch, as remount support should be optional.
Otherwise if the guest system is non-debuggable, then the scratch
partition would be ignored by guest, which is harmless.
Otherwise the guest system is debuggable, which means the guest system
would be able to do adb remount.
Relax partition allocation status polling rate from 10ms -> 100ms,
because there's no point polling faster than the screen framerate.
Bug: 165925766
Test: TH
Test: Install a DSU system on a debuggable host, reboot into the guest
system, and guest system can remount.
Change-Id: I9a8255483cc963ebcf7a2909e68ac69371cb369f
Instead of passing a number around as the number of installed
partitions, track the number in a member field in InstallationAsyncTask.
This makes installing partitions after installImages() had returned
possible.
Bug: 165925766
Test: TH
Change-Id: Iec45c9fa1a39f0bcc4eeaa00e44d3394d55087d3
executeRebootToNormalCommand() reboots the device only if DSU is
successfully disabled, else show a toast describing the failure.
Bug: 171380622
Test: 1. Install and boot into a DSU
2. adb shell gsi_tool enable
3. Press "Restart" in DSU notification
4. Observe the device reboots back to the original system
Change-Id: I19b3d09a64282a28ca7b99b441ca93dea45fcce0
Dismiss notification even if there is no active DSU installation.
Bug: 170072953
Test: Install a DSU system.
Reboot into guest system and reboot back to host system.
`adb shell gsi_tool wipe`
Press "Discard" in the DSU notification, the notifiction is dismissed.
Change-Id: I6f217c4ba287e4789d61182a12485db60f9605c9
Add DynamicSystemManager.closePartition() that closes a partition
installation and returns its error status.
InstallationAsyncTask may call this method to do error checking.
Bug: 165471299
Test: Observe the logcat of a failed DSU installation
Change-Id: I9d155c70c6e490899a4acfd35c8096549af005d4
Also call resetTaskAndStop() so the lingering Installation task is
cleaned up and failed states such as installation progress are cleared.
Bug: 165471299
Test: Install a failing DSU package and observe logcat
Test: Retry install DSU package and observe notification progress
Change-Id: I1ce55ea98256954bb06d46ca948cae6ca48d9679
Per linguist's suggestion, extend character limits of strings. And,
keep app's name "Dynamic System Update" not translated.
Bug: 154345776
Bug: 154345861
Bug: 154345863
Test: None
Change-Id: If57e0e0f301588f60744678f0ec942e8eb8e8a70
If the notification contains an error message, keep it even after the
service is stopped.
Bug: 149876966
Test: adb shell am start-activity \
-n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
-a android.os.image.action.START_INSTALL \
-d file:///file_does_not_exist
Change-Id: I5fdbcaf5ed28343f53d66b3f02ccb66d3c7920ff
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
VerificationActivity crashes when the Intent sent to it doesn't have an
extras Bundle. This is because VerificationActivity copies the incoming
Intents extras Bundle with getExtras() / putExtras(Bundle), and
putExtras(Bundle) doesn't expect a null Bundle.
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
Test: Dynamic system service mustn't crash
Change-Id: I111641f366d50d739b922bcc3a52993c44212759
When DSU is running, restarting the device will not uninstall the
installed system update.
Bug: 149716233
Test: run DSU install
Change-Id: If4e7b2f5f9123161ae85c0be80069aa600548c74
imageValidationThrowOrWarning() logs the error as a warning if device
bootloader is unlocked, else re-throw the error.
Device lock state is queried via PersistentDataBlockManager service.
Bug: 128892201
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 8192 \
-d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip \
--es ${IMAGE_KEY}
Test: Observe the logcat
Change-Id: I895e70d90624afda2bf7cd3b34ea8d21a1702163
Throw RevocationListFetchException if failed to fetch key revocation
list.
Throw KeyRevokedException if DSU intent or image public key is revoked.
Throw PublicKeyException if getAvbPublicKey() failed.
Bug: 128892201
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 8192 \
-d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip \
--es KEY_PUBKEY ${IMAGE_KEY}
Test: edit the code so that imageValidationThrowOrWarning() always
Test: throw and observe the logcat and device notification
Change-Id: I33733c019b305c45e7d2511c44ef1d9b446ea52e
DSU installation service fetches a key revocation list (key blacklist).
Revocation list is a https URL specified in a resource string.
Fetched result is cached in HttpResponseCache to save bandwidth, and the
cached result is always forced validated with server to ensure freshness.
In other words, fetching a revocation list is done via a "conditional GET",
such http GET returns a brief (304 NOT MODIFIED) response if ours cache is
still valid, else the server sends a (200 OK) response with new data.
TODO: Compare the installed DSU image's public key with the revocation
list and boot-ramdisk. If the public key is revoked then abort installation.
Bug: 128892201
Test: atest DynamicSystemInstallationServiceTests
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 8589934592 \
-d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip \
--es KEY_PUBKEY key1
Change-Id: I29ae088acb1bd23336ec09654f38b4fc464316d8
After aosp/1188881, DynamicSystemManager.remove() is blocked for
about 30 seconds. To give users feedbacks faster when they click on
the [Cancel] button, This CL removes the progress notification
earlier.
Bug: 145891864
Test: Clicking on the [Cancel] button
Change-Id: I4e43775b2de6eaa50d4a1cc073a5057f22f6d8d5
When VerificationActivity receives an Intent, clone the calling Intent's
extras Bundle and pass the whole Bundle into
DynamicSystemInstallationService Intent. Don't unpack and repack the
calling Intent's extras field. Since VerificationActivity aren't using the
contents of the extras Bundle, it shouldn't know about the details of extra.
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 8589934592 \
-d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip
Change-Id: Ie19b9d4d9ebcbd4623d8c76637da4fa732a4a3c3
DSU previously only supports gzipped system images. This CL enables
DSU to also read zipped files. If there are multiple images in the
zipped release, DSU will install them all.
Bug: 134353973
Test: adb shell am start-activity \
-n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
-a android.os.image.action.START_INSTALL \
-d https://dl.google.com/developers/android/qt/images/gsi/aosp_arm64-QP1A.190771.020-5800535.zip \
--el KEY_USERDATA_SIZE 8589934592
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_crosshatch-img-eng.pchsueh.zip \
--el KEY_USERDATA_SIZE 8589934592
Change-Id: I9c2137d4d81398a9c6153df63a29c16eb8339795
SparseInputStream read from upstream and detects the data format.
If the upstream is a valid sparse data, it will unsparse it on the fly.
Otherwise, it just passthrough as is.
Bug: 139510436
Test: \
java com.android.dynsystem.SparseInputStream system.img system.raw
simg2img system.img system.raw.golden
diff system.raw system.raw.golden
Change-Id: Ibc5c130127a455392484467fe32d638be642afa8