Commit Graph

73 Commits

Author SHA1 Message Date
Bill Yi
c6898ccb44 Revert "Import translations. DO NOT MERGE ANYWHERE"
This reverts commit 35cf1c92f3.

Reason for revert: Incorrect import

Change-Id: I771d3cd65a1ccaf9852a913bc1974088a1411226
2020-11-20 03:05:31 +00:00
Bill Yi
35cf1c92f3 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I7b9bedab94f9cfd1d57ecb27e9830edc219ef719
2020-11-19 04:01:09 +00:00
Bill Yi
6e8fad2e38 Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: Ib8f6104bc0b45e0c857fcd93a7702d695f854f90
2020-11-09 15:58:10 -08:00
Yo Chiang
9a12c2be5d Merge "Disable DSU in executeRebootToNormalCommand()" am: 0b6bf88ccd am: f785394fb3 am: b8f884150d am: 7d1a821d9d am: e5a9e4a354
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1470783

Change-Id: I466380e067d60fc5ea82660828ad3a8c12616692
2020-10-30 08:55:51 +00:00
Yo Chiang
e5a9e4a354 Merge "Disable DSU in executeRebootToNormalCommand()" am: 0b6bf88ccd am: f785394fb3 am: b8f884150d am: 7d1a821d9d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1470783

Change-Id: I795daab4a881b78cc6717cee41bfa01637d93e37
2020-10-30 08:20:29 +00:00
Yo Chiang
b8f884150d Merge "Disable DSU in executeRebootToNormalCommand()" am: 0b6bf88ccd am: f785394fb3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1470783

Change-Id: Ie3cccfbeb1d4d187bcf2282fe0fcdbcbc22ca261
2020-10-30 07:44:22 +00:00
Yo Chiang
0b6bf88ccd Merge "Disable DSU in executeRebootToNormalCommand()" 2020-10-30 06:55:43 +00:00
Yo Chiang
68e2d6b360 Disable DSU in executeRebootToNormalCommand()
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
2020-10-29 16:03:38 +08:00
Howard Chen
210e5c1161 Merge "Add a mutability flag to the PendingIntent in DynamicSystemInstallationService" am: dc0b992c75 am: 5107e43858 am: 46a6aee06d am: 0e0af4cf47 am: 09e1c8925c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1479478

Change-Id: Icb1fbe19717ad3e477fec9530865b655f3a04d85
2020-10-29 07:47:32 +00:00
Howard Chen
09e1c8925c Merge "Add a mutability flag to the PendingIntent in DynamicSystemInstallationService" am: dc0b992c75 am: 5107e43858 am: 46a6aee06d am: 0e0af4cf47
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1479478

Change-Id: I7fb65a386b3a058c4da0f2d539e2903aae180987
2020-10-29 07:28:44 +00:00
Howard Chen
46a6aee06d Merge "Add a mutability flag to the PendingIntent in DynamicSystemInstallationService" am: dc0b992c75 am: 5107e43858
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1479478

Change-Id: I78b38fdf4bd8ddad4eb6abf9ddf89c15e6537093
2020-10-29 06:35:55 +00:00
Howard Chen
54653ba116 Add a mutability flag to the PendingIntent in DynamicSystemInstallationService
Bug: 171718124
Test: DSU installation
Change-Id: Id352e37238aad6499841dc379b006f2e0150181d
2020-10-29 11:06:26 +08:00
Jeff Sharkey
f80597de7e Merge "Enable Error Prone to detect obscure bugs." am: f7dee0be43
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12911914

Change-Id: Ic8d1a73aaa0549bea697788fbcf228c4cae59352
2020-10-24 17:30:53 +00:00
Jeff Sharkey
d23b5379c0 Enable Error Prone to detect obscure bugs.
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
2020-10-23 16:55:30 -06:00
Yo Chiang
3a57889d28 Merge "Dismiss DSU notification in executeDiscardCommand()" am: 3313038017 am: 7af64dd1f7 am: 9e47644314 am: 970bd09428 am: 8dd34a1749
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1448418

Change-Id: I03fcbb9a46fa5192b96af042d501968c1d978453
2020-10-06 06:21:50 +00:00
Yo Chiang
8dd34a1749 Merge "Dismiss DSU notification in executeDiscardCommand()" am: 3313038017 am: 7af64dd1f7 am: 9e47644314 am: 970bd09428
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1448418

Change-Id: Ib2314a9423f132a7c9ec001acb380369426c870d
2020-10-06 05:56:28 +00:00
Yo Chiang
9e47644314 Merge "Dismiss DSU notification in executeDiscardCommand()" am: 3313038017 am: 7af64dd1f7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1448418

Change-Id: Ia170a72614648614cb33c8ff079531f1507899d0
2020-10-06 05:13:34 +00:00
Yo Chiang
7af64dd1f7 Merge "Dismiss DSU notification in executeDiscardCommand()" am: 3313038017
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1448418

Change-Id: Id0a2b1fb7752e3d9de83f3613d0290c0ecf9096a
2020-10-06 04:38:53 +00:00
Yo Chiang
569c31cef6 Dismiss DSU notification in executeDiscardCommand()
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
2020-10-05 08:57:50 +00:00
Bill Yi
c7be32a1b1 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I923ae5fe5c949911dc0b49cc9ad43dbbbf448431
2020-10-04 23:33:11 -07:00
Bill Yi
078b413289 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I7df5410104e4be01cb906e0f607a3acc730bfbe7
2020-09-10 10:57:30 +00:00
Bill Yi
70726e8fad Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ic9f70d811812b888832db3c4f302f628d757bafc
2020-09-04 17:36:13 +00:00
TreeHugger Robot
3a301e8671 Merge "Import translations. DO NOT MERGE ANYWHERE" into stage-aosp-master 2020-09-03 01:07:47 +00:00
Bill Yi
31ccff50f7 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I7672d1bacef6d243b623cd0c222cf4e438b65631
2020-09-02 23:21:32 +00:00
Yo Chiang
50c284871b Merge "Check error status after installing each DSU partition" am: fbd85db85d am: 73d5afb2cb am: dbe6d55157 am: 9b2f226473 am: 52a88df94a am: 309f789948
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404669

Change-Id: I094ca41304c8c56e06b0018312523bd332b067ed
2020-09-02 07:10:36 +00:00
Yo Chiang
309f789948 Merge "Check error status after installing each DSU partition" am: fbd85db85d am: 73d5afb2cb am: dbe6d55157 am: 9b2f226473 am: 52a88df94a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404669

Change-Id: I0b3f8dcbdfe4bf4451bb38d734aa423f489187d4
2020-09-02 06:25:57 +00:00
Yo Chiang
55668c1a49 Check error status after installing each DSU partition
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
2020-08-25 07:48:16 +00:00
Yo Chiang
67a10c275f Merge "Post a notification if reboot to DSU failed" am: 5432af8406 am: dcdec0017e am: 3a3ec27223 am: 07f7f83826 am: 2f624e15fd am: 713b48970e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404648

Change-Id: I710483957dfff555b5b056599600b9982a39fceb
2020-08-20 10:13:36 +00:00
Yo Chiang
713b48970e Merge "Post a notification if reboot to DSU failed" am: 5432af8406 am: dcdec0017e am: 3a3ec27223 am: 07f7f83826 am: 2f624e15fd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404648

Change-Id: Ie6f06c9bd5a68fdfec663d1cac0d2c3cecec1223
2020-08-20 09:49:16 +00:00
Yo Chiang
591602bf26 Post a notification if reboot to DSU failed
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
2020-08-19 20:14:04 +08:00
Treehugger Robot
6f03051433 Merge "Update language to comply with Android’s inclusive language guidance" am: f366f37aa1 am: 5383e257e2 am: 9df4a45b87 am: 240de71ebd am: 2fb3fdb5d5 am: 39867f4242
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1372976

Change-Id: I76b8517446547d37162d81d0c7b7bc00f234c3e9
2020-07-27 06:48:41 +00:00
Treehugger Robot
39867f4242 Merge "Update language to comply with Android’s inclusive language guidance" am: f366f37aa1 am: 5383e257e2 am: 9df4a45b87 am: 240de71ebd am: 2fb3fdb5d5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1372976

Change-Id: I2cf69030196c9f83af06ebe040c634a8624755ea
2020-07-27 06:47:58 +00:00
Yo Chiang
d5a6030fd2 Update language to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference

#inclusivefixit

Bug: 161896447
Test: TH presubmit
Test: atest DynamicSystemInstallationServiceTests
Change-Id: I94ab7cabc4f86ecb266c1d7d89357da1e3f88921
2020-07-27 04:26:09 +00:00
Bill Yi
4702c7eb94 Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: Ib50020255e2903fb4186a180228d4b824ab6009c
2020-04-27 14:20:42 -07:00
TreeHugger Robot
6c491c054b Merge "Import translations. DO NOT MERGE" 2020-04-26 18:31:42 +00:00
Bill Yi
a14c398f52 Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: I98d91f31c423aa8befda7d4c582623bf34e9d407
2020-04-25 17:44:19 -07:00
Po-Chien Hsueh
8f3bdb821c Extend strings.xml character limits
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
2020-04-23 14:48:08 +08:00
Po-Chien Hsueh
7ba4d3945a Keep error message notification after stop
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
2020-03-05 13:49:16 +08:00
Yo Chiang
f41e145480 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
2020-02-24 15:06:56 +08:00
Treehugger Robot
b2d41e93f8 Merge "Fix VerificationActivity Intent" 2020-02-21 05:51:24 +00:00
Yo Chiang
f8d6789233 Fix VerificationActivity Intent
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
2020-02-21 04:17:51 +00:00
Po-Chien Hsueh
5b380af950 Replace action button "Uninstall" with "Restart"
When DSU is running, restarting the device will not uninstall the
installed system update.

Bug: 149716233
Test: run DSU install
Change-Id: If4e7b2f5f9123161ae85c0be80069aa600548c74
2020-02-20 14:19:39 +08:00
Yo Chiang
be20495f0b Key revocation check is permissive when device is unlocked
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
2020-02-19 11:11:29 +00:00
Yo Chiang
a86e1ab30a Check DSU public key with key revocation list
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
2020-02-19 09:32:36 +00:00
Yo Chiang
739c45ea23 Merge "DSU to support GSI key revocation list" 2020-02-05 19:01:54 +00:00
Yo Chiang
61fc692d66 DSU to support GSI key revocation list
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
2020-01-25 21:31:21 +08:00
Treehugger Robot
03e365f649 Merge "Improve DSU log and notification message" 2020-01-16 12:15:26 +00:00
Po-Chien Hsueh
bcf2adb424 Improve DSU log and notification message
Improve DSU installation service's status log message. And, use
Notification.BigTextStyle for DSU notification message.

Bug: 132924741
Test: Run DSU installation
Change-Id: I9e821edfeff88a1f4084a005de3e0f4264338996
2020-01-16 13:52:57 +08:00
Howard Chen
69d181aecc Merge "Support multiple DSU installations" 2020-01-16 05:33:10 +00:00
Howard Chen
c6f64c44eb Support multiple DSU installations
Bug: 144247097
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/system.raw.gz \
        --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \
        --el KEY_USERDATA_SIZE 8589934592
Change-Id: Ib2f86039c4c0c1dae2bc94a702721572567bcbf2
2020-01-14 02:20:47 +00:00