Commit Graph

346613 Commits

Author SHA1 Message Date
Donald Chai
fb365516de Fix a minor typo.
Test: N/A
Change-Id: I56d76640c8a06f524b829fa316612954b43809ff
2017-10-25 21:51:01 -07:00
Donald Chai
d1ac6e1f9e AAPT: treat "-I" with lower precedence than main APK for dumping.
This is the desired behavior if resource IDs may overlap, and also happens to
improve the behavior of:

  aapt dump -I base.apk badging feature.apk

when both APKs use the same package name with different package IDs
(base=0x7F, feature=0x80).  Previously, the final call to
DynamicRefTable::addMapping was for base.apk, and all references to 0x80 were
rewritten in DynamicRefTable::lookupResourceId to 0x7F.  After this
change resources defined in both APKs are resolved correctly.

Note that this is a bit of kludge, and APKs should use different names
to avoid conflating the package IDs.

Fixes: 67070085
Bug: 64058531
Test: manual with sample in b/67070085#comment2
Change-Id: I285adb6f44a297440b08fc7a1f9ad73c700eb9bc
2017-10-12 21:34:22 -07:00
TreeHugger Robot
96a30ab84c Merge "Improve shortcut backup & restore." 2017-10-11 23:55:33 +00:00
Jeff Sharkey
27531d11ec DO NOT MERGE. KEY_INTENT shouldn't grant permissions. am: 04b96d76a9 am: d20cad62ee am: e62d479921 -s ours am: e9d2113af7 am: 8860624853 am: 7512875224 am: 44adace6c6 am: af93051ac4 -s ours am: 620c5cfda0 am: e286f08000 am: e68565b630
am: d10a908242  -s ours

Change-Id: I538192067abbc5daed3bec9849c6b3140b29db8a
2017-10-11 23:46:52 +00:00
Brad Ebinger
d1525d9767 Merge "Add new Download Error Codes" am: e9bd5449b5 am: 946ff79971 am: 014d73e287
am: bb38194a55

Change-Id: I3f1c18c3a9017c48aeba29e7344c27ba24d1a037
2017-10-11 23:43:09 +00:00
Jeff Sharkey
d10a908242 DO NOT MERGE. KEY_INTENT shouldn't grant permissions. am: 04b96d76a9 am: d20cad62ee am: e62d479921 -s ours am: e9d2113af7 am: 8860624853 am: 7512875224 am: 44adace6c6 am: af93051ac4 -s ours am: 620c5cfda0 am: e286f08000
am: e68565b630

Change-Id: I5bb8f3b3bd5200b88a17fa4f090ee432c7ab5b52
2017-10-11 23:28:24 +00:00
Jeff Sharkey
df043ee75c Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-dev am: 254369967a am: 4a60106aa0 am: 72df97053c am: da3d10591a am: 97f6a0da40 -s ours am: 3b47256ccf am: a7f0504849" into oc-dr1-dev-plus-aosp am: 6ef8866b04
am: 6530612cee  -s ours

Change-Id: I4f9d6946e30f63200b66c0c04744feccc03f267a
2017-10-11 23:06:17 +00:00
Jeff Sharkey
1c65520aeb Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-dev am: 254369967a am: 4a60106aa0 am: 72df97053c am: da3d10591a am: 97f6a0da40 -s ours am: 3b47256ccf am: a7f0504849 am: 5712d1fb47" into oc-mr1-dev-plus-aosp
am: da968fb57f  -s ours

Change-Id: Iec09725428ddb1ae2cea3936395b9ce9c84ecc84
2017-10-11 23:01:06 +00:00
Brad Ebinger
bb38194a55 Merge "Add new Download Error Codes" am: e9bd5449b5 am: 946ff79971
am: 014d73e287

Change-Id: I7c7dc265bf5ba27b61794d114937c2c4c0816470
2017-10-11 22:56:47 +00:00
Dan Albert
cd4e159bbf Merge "Add missing includes." am: 4be4bb3db7 am: 41c08f49b4 am: e9aaf3c546
am: caebafaf94

Change-Id: I5ec663813ede4bb794691ecb5e9afc0140accb84
2017-10-11 22:56:45 +00:00
Jeff Sharkey
e68565b630 DO NOT MERGE. KEY_INTENT shouldn't grant permissions. am: 04b96d76a9 am: d20cad62ee am: e62d479921 -s ours am: e9d2113af7 am: 8860624853 am: 7512875224 am: 44adace6c6 am: af93051ac4 -s ours am: 620c5cfda0
am: e286f08000

Change-Id: Iefbf0c8df06d6cea71d7ccdcd65ff4156a156419
2017-10-11 22:51:51 +00:00
Jeff Sharkey
ff40949f5b Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr1-dev am: 9d3706046c am: b4d23d55c2 am: e1ae848970 -s ours am: 7f108b81b3 am: 4a71a2daf6 am: e2a1e9f7d8" into oc-mr1-dev-plus-aosp
am: 54bfe3acdd  -s ours

Change-Id: I75c61202b938d1cdf61755877d1ecbfb9191ddea
2017-10-11 22:48:29 +00:00
Jeff Sharkey
6530612cee Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-dev am: 254369967a am: 4a60106aa0 am: 72df97053c am: da3d10591a am: 97f6a0da40 -s ours am: 3b47256ccf am: a7f0504849" into oc-dr1-dev-plus-aosp
am: 6ef8866b04

Change-Id: Ic989ee531576564282dbc4ab065f4dd6b99a6c4c
2017-10-11 22:42:20 +00:00
Brad Ebinger
014d73e287 Merge "Add new Download Error Codes" am: e9bd5449b5
am: 946ff79971

Change-Id: I756df5c78a96a59468f54ac35e9668d66cf64901
2017-10-11 22:39:14 +00:00
Jeff Sharkey
d8a053cda2 Merge "Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into oc-dev am: 31c5adc279 am: 3f671b3194" into oc-mr1-dev am: 383ab095f5" into oc-mr1-dev-plus-aosp
am: 289b4d8c53  -s ours

Change-Id: Id4fe5d06de655a44e1b0a40aed44acc32df3b30e
2017-10-11 22:37:44 +00:00
Jeff Sharkey
e286f08000 DO NOT MERGE. KEY_INTENT shouldn't grant permissions. am: 04b96d76a9 am: d20cad62ee am: e62d479921 -s ours am: e9d2113af7 am: 8860624853 am: 7512875224 am: 44adace6c6 am: af93051ac4 -s ours
am: 620c5cfda0

Change-Id: I07805d81dbcf65993d5dcb695d9877ad4a914bac
2017-10-11 22:35:46 +00:00
Jeff Sharkey
6f2ab66f45 Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr1-dev am: 9d3706046c am: b4d23d55c2 am: e1ae848970 -s ours am: 7f108b81b3 am: 4a71a2daf6 am: 0de1d85a01" into oc-mr1-dev-plus-aosp
am: a04a837f95  -s ours

Change-Id: I6ea442a00fe0ca7a6af767ae427a0d2b8256b42c
2017-10-11 22:33:05 +00:00
Jean-Michel Trivi
900699c173 Merge "Merge "Fix alarm preview volume" into oc-mr1-dev am: b9629cd432" into oc-mr1-dev-plus-aosp
am: fd77afd548

Change-Id: I9ed6b346f9f81a338169628d9e2c955421560744
2017-10-11 22:28:57 +00:00
Android Build Merger (Role)
da968fb57f Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-dev am: 254369967a am: 4a60106aa0 am: 72df97053c am: da3d10591a am: 97f6a0da40 -s ours am: 3b47256ccf am: a7f0504849 am: 5712d1fb47" into oc-mr1-dev-plus-aosp 2017-10-11 22:28:09 +00:00
Jeff Sharkey
6694c5c6f0 Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-dev am: 254369967a am: 4a60106aa0 am: 72df97053c am: da3d10591a am: 97f6a0da40 -s ours am: 3b47256ccf am: a7f0504849
am: 5712d1fb47

Change-Id: Id5d6dd68924837f09d6f2b1178ce41c2d1e81219
2017-10-11 22:26:38 +00:00
Brad Ebinger
946ff79971 Merge "Add new Download Error Codes"
am: e9bd5449b5

Change-Id: I8fa3c3dcc5104a5326a680ae186c9285a7e47358
2017-10-11 22:24:58 +00:00
Jeff Sharkey
620c5cfda0 DO NOT MERGE. KEY_INTENT shouldn't grant permissions. am: 04b96d76a9 am: d20cad62ee am: e62d479921 -s ours am: e9d2113af7 am: 8860624853 am: 7512875224 am: 44adace6c6
am: af93051ac4  -s ours

Change-Id: I93ce23ee4d45491a79346d11aed2cdb0fed0ef9f
2017-10-11 22:23:16 +00:00
Dan Albert
caebafaf94 Merge "Add missing includes." am: 4be4bb3db7 am: 41c08f49b4
am: e9aaf3c546

Change-Id: I41e4375d053ad5aa64bd4ca3a78b23644b2c725b
2017-10-11 22:22:04 +00:00
Android Build Merger (Role)
54bfe3acdd Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr1-dev am: 9d3706046c am: b4d23d55c2 am: e1ae848970 -s ours am: 7f108b81b3 am: 4a71a2daf6 am: e2a1e9f7d8" into oc-mr1-dev-plus-aosp 2017-10-11 22:16:07 +00:00
Jeff Sharkey
e8af749eec Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into oc-dev am: 31c5adc279 am: 3f671b3194 am: 8bfef31ce0
am: c4649e252d  -s ours

Change-Id: I874d8afcbd14d28bf7ade224fc7cb72093482e1d
2017-10-11 22:15:44 +00:00
Android Build Merger (Role)
6ef8866b04 Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-dev am: 254369967a am: 4a60106aa0 am: 72df97053c am: da3d10591a am: 97f6a0da40 -s ours am: 3b47256ccf am: a7f0504849" into oc-dr1-dev-plus-aosp 2017-10-11 22:14:32 +00:00
Jeff Sharkey
b969ac5fd0 Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr1-dev am: 9d3706046c am: b4d23d55c2 am: e1ae848970 -s ours am: 7f108b81b3 am: 4a71a2daf6
am: e2a1e9f7d8

Change-Id: I7a72aa1793c5e45434f50c4d810164fbbfd70ef9
2017-10-11 22:13:37 +00:00
Jeff Sharkey
af93051ac4 DO NOT MERGE. KEY_INTENT shouldn't grant permissions. am: 04b96d76a9 am: d20cad62ee am: e62d479921 -s ours am: e9d2113af7 am: 8860624853 am: 7512875224
am: 44adace6c6

Change-Id: I3d0c489f0a6b3522f93b6d3b4db7892d081dc11c
2017-10-11 22:12:39 +00:00
Brad Ebinger
e9bd5449b5 Merge "Add new Download Error Codes" 2017-10-11 22:12:26 +00:00
Jeff Sharkey
5712d1fb47 Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-dev am: 254369967a am: 4a60106aa0 am: 72df97053c am: da3d10591a am: 97f6a0da40 -s ours am: 3b47256ccf
am: a7f0504849

Change-Id: Ib17c9471d7f3bdde18e3de4ad693fd9ef5312059
2017-10-11 22:11:51 +00:00
Jeff Sharkey
a54bfed476 Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-dev am: 254369967a am: 4a60106aa0 am: 72df97053c am: da3d10591a am: 97f6a0da40 -s ours am: 3b47256ccf
am: a7f0504849

Change-Id: I08b0a31acd8044b1fb1676052f853bbc1b1201a1
2017-10-11 22:11:49 +00:00
Dan Albert
e9aaf3c546 Merge "Add missing includes." am: 4be4bb3db7
am: 41c08f49b4

Change-Id: I67b30cd624fe42521097c20cc45ee6db19c0d43e
2017-10-11 22:07:46 +00:00
Android Build Merger (Role)
289b4d8c53 Merge "Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into oc-dev am: 31c5adc279 am: 3f671b3194" into oc-mr1-dev am: 383ab095f5" into oc-mr1-dev-plus-aosp 2017-10-11 22:06:40 +00:00
Jeff Sharkey
e3e396ac41 Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into oc-dev am: 31c5adc279 am: 3f671b3194" into oc-mr1-dev
am: 383ab095f5

Change-Id: Ic1d6542b99aa8e559c17826a32ed128610c964b0
2017-10-11 22:02:35 +00:00
Jeff Sharkey
44adace6c6 DO NOT MERGE. KEY_INTENT shouldn't grant permissions. am: 04b96d76a9 am: d20cad62ee am: e62d479921 -s ours am: e9d2113af7 am: 8860624853
am: 7512875224

Change-Id: I55e255c4089089403a327cb0e24f750b5b9975ec
2017-10-11 22:00:35 +00:00
Android Build Merger (Role)
a04a837f95 Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr1-dev am: 9d3706046c am: b4d23d55c2 am: e1ae848970 -s ours am: 7f108b81b3 am: 4a71a2daf6 am: 0de1d85a01" into oc-mr1-dev-plus-aosp 2017-10-11 21:59:03 +00:00
Jeff Sharkey
2771394e89 Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr1-dev am: 9d3706046c am: b4d23d55c2 am: e1ae848970 -s ours am: 7f108b81b3 am: 4a71a2daf6
am: 0de1d85a01

Change-Id: I61273206efb364da1317666b199fda6a0ecb5c12
2017-10-11 21:56:49 +00:00
Dan Albert
41c08f49b4 Merge "Add missing includes."
am: 4be4bb3db7

Change-Id: Icdae2b63df8e5d61e6acabb6fb85efa28026d535
2017-10-11 21:52:41 +00:00
Jeff Sharkey
a7f0504849 Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-dev am: 254369967a am: 4a60106aa0 am: 72df97053c am: da3d10591a am: 97f6a0da40 -s ours
am: 3b47256ccf

Change-Id: Ie321b5922ec83367ec93e528993fb205ebcad1ac
2017-10-11 21:52:08 +00:00
Android Build Merger (Role)
fd77afd548 Merge "Merge "Fix alarm preview volume" into oc-mr1-dev am: b9629cd432" into oc-mr1-dev-plus-aosp 2017-10-11 21:50:42 +00:00
Makoto Onuki
a4f89b1251 Improve shortcut backup & restore.
From http://go/p-shortcut-restore :

Currently on pre-P builds, there are 6 cases where shortcuts won't be restored.

Launcher issue:
A: Launcher is downgraded
B: Launcher has allowBackup="false"
C: Launcher's signature changed.
A-C would result in not restoring any shortcuts from any apps.

App issue:
D: App is downgraded
E: App has allowBackup="false"
F: App's signature changed.
D-F would result in not restoring any shortcuts from individual apps.

In P, we'll restore all pinned shortcuts anyway except in case B and C.

The new behavior would be:
A: We'll restore all pinned shortcuts anyway even if the launcher is downgraded.
B: If the launcher doesn't support backup&restore, we still don't restore shortcuts.
C: If the launcher has a different signature, we still don't restore shortcuts.

D, E, F: All pinned shortcuts will be restored, but are disabled.

In case of D, E, F, shortcuts would be:
1. ShortcutInfo.isEnabled() will return false. They are not launchable.
2. If it's case D (downgrade), shortcuts will be re-enabled once a publisher app
is updated to the original version or higher.
3. getDisabledMessage() will return a special, canned message explaining why
they're disabled.
4. A new API getDisabledReason() will return one of the following values:
 - DISABLED_REASON_NOT_DISABLED (for non-disabled shortcuts)
 - DISABLED_REASON_BY_APP (for shortcuts disabled by apps)
 - DISABLED_REASON_APP_CHANGED (for shortcuts disabled when a manifest shortcut is gone.)
 - DISABLED_REASON_VERSION_LOWER (case D)
 - DISABLED_REASON_BACKUP_NOT_SUPPORTED (case E)
 - DISABLED_REASON_SIGNATURE_MISMATCH (case F)
 - (DISABLE_REASON_OTHER_RESTORE_ISSUE for future use)
Launcher can opt to use this API to show a custom error message, rather than
using the canned system message from getDisabledMessage().

5. This spec change is completely transparent to publisher apps.
In case D,E,F, the disabled shortcuts will only be visible to the launcher,
and from the publisher app's point of view, they still don't exist.
APIs such as getPinnedShortcuts() will not return them, and updateShortcuts()
will not affect them. The enableShortcut() will not enable them either.

Bug 62451035
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutHostTestCases

Change-Id: Ib4d73aa44a0395f5e37c8ad0c9cd041a9038fb66
2017-10-11 14:50:38 -07:00
Jeff Sharkey
c4649e252d Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into oc-dev am: 31c5adc279 am: 3f671b3194
am: 8bfef31ce0

Change-Id: I79106ed066b76f9597d74e56498fa3a9c6258f7f
2017-10-11 21:48:19 +00:00
Jean-Michel Trivi
47aa351692 Merge "Fix alarm preview volume" into oc-mr1-dev
am: b9629cd432

Change-Id: If5bc5bbdb5239609db61e4706c6b2395b0231f83
2017-10-11 21:48:00 +00:00
Jeff Sharkey
3700554d86 Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr2-dev am: 09984216e6 -s ours am: 5f17a285f9 am: 98371ee7c9 am: e0e1c8ae4c
am: b49d357915  -s ours

Change-Id: Ib8d2efccb01873827335ca6eece42ca738b67e0c
2017-10-11 21:43:30 +00:00
Jeff Sharkey
7512875224 DO NOT MERGE. KEY_INTENT shouldn't grant permissions. am: 04b96d76a9 am: d20cad62ee am: e62d479921 -s ours am: e9d2113af7
am: 8860624853

Change-Id: Iea7736cd9e60673296bd39377393fa785bd58b17
2017-10-11 21:41:50 +00:00
Android Build Merger (Role)
dc5d89e59a Merge "Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr2-dev am: 09984216e6 -s ours am: 5f17a285f9 am: 98371ee7c9 am: e6f60d0fcb am: 4a69ee914c -s ours" 2017-10-11 21:38:31 +00:00
Jeff Sharkey
e2a1e9f7d8 Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr1-dev am: 9d3706046c am: b4d23d55c2 am: e1ae848970 -s ours am: 7f108b81b3
am: 4a71a2daf6

Change-Id: Id8a401121d8bff24b5695f0ad0d4c923da93995c
2017-10-11 21:38:30 +00:00
Treehugger Robot
4be4bb3db7 Merge "Add missing includes." 2017-10-11 21:37:28 +00:00
Jeff Sharkey
0de1d85a01 Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr1-dev am: 9d3706046c am: b4d23d55c2 am: e1ae848970 -s ours am: 7f108b81b3
am: 4a71a2daf6

Change-Id: I0fef13605c0a2da1b787bc11ac4ec06926665ba2
2017-10-11 21:36:45 +00:00
Jeff Sharkey
68408918c2 Merge "DO NOT MERGE. KEY_INTENT shouldn't grant permissions." into nyc-mr2-dev am: 09984216e6 -s ours am: 5f17a285f9 am: 98371ee7c9 am: e6f60d0fcb
am: 4a69ee914c  -s ours

Change-Id: Id50190ce08ae0d0f1e417db0f7290b3c7ea5c2fe
2017-10-11 21:35:48 +00:00