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
We've been writing many new framework-specific Error Prone checkers
to help detect obscure platform bugs, and this change starts enabling
those checkers for more packages across the platform.
Bug: 155703208
Test: manual
Exempt-From-Owner-Approval: trivial blueprint changes
Change-Id: I1db3412b0be40f6f78c68331ae01756887192071
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