Commit Graph

11854 Commits

Author SHA1 Message Date
Hai Zhang
0ee35ca5ca Mention REQUESTED_PERMISSION_NEVER_FOR_LOCATION in
requestedPermissionsFlags javadoc.

Instead of only the other way around.

Bug: 225095217
Test: presubmit
Change-Id: Ia3c05b4df4c6dc7543a7e55aa0470f4205520f36
2022-03-17 22:45:15 +00:00
Naomi Musgrave
4b563a2d37 Merge "Capture the contents of a single task" into tm-dev 2022-03-17 17:03:48 +00:00
Thomas Vannet
ac4406b453 Merge changes from topics "cherrypick-selfrevokemultiuser-emqfc1tlui", "cherrypick-selfrevokerenameself-lcm1yyzp8i", "presubmit-am-8a6e07e400554464bf71e06db20e4f32", "presubmit-am-d66e407983c84f0f90928a76de0d3ef2" into tm-dev
* changes:
  Rename revokeOwnPermissionsOnKill to revokeSelfPermissionsOnKill
  Self-revocation: Call PermissionControllerManager directly from Context
  Synchronously revoke permissions on OTP session end when kill delay is 0
  Do not leak whether package exists in revokeOwnPermissionsOnKill
2022-03-17 14:47:04 +00:00
Bernardo Rufino
2e5e263d31 Merge "Add safer Intent extra APIs and deprecate old ones" am: 30e41a64b2 am: 0b0a4d71a2 am: c2fabc1d4a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2020758

Change-Id: I040b8847483a87403ec9a9e0dc2e9b1c352608ab
2022-03-17 01:11:45 +00:00
Bernardo Rufino
c2fabc1d4a Merge "Add safer Intent extra APIs and deprecate old ones" am: 30e41a64b2 am: 0b0a4d71a2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2020758

Change-Id: If0ecedefda7f6311788ad47cc17329d543edc4f6
2022-03-17 00:35:42 +00:00
Thomas Vannet
c418be3814 Rename revokeOwnPermissionsOnKill to revokeSelfPermissionsOnKill
Bug: 215555831
Test: atest android.permission.cts.RevokeSelfPermissionTest
Change-Id: I887e2b8a86868352e772537addd8cd20ef305d7b
2022-03-16 16:39:59 -07:00
Thomas Vannet
a24e244560 Self-revocation: Call PermissionControllerManager directly from Context
This fixes a bug where self-revocation didn't work in multi-user
settings. Now the correct context is used throughout the call stack and
the permission for the calling user will be revoked.

Also added a checked IllegalArgumentException (previously unchecked
SecurityException) when trying to revoke a permission that is not
currently granted.

Test: manual using two users and
atest android.permission.cts.RevokeOwnPermissionTest
Bug: 218788609

Change-Id: I3dce34b8b956b4d1eb0ac1e34b6fdbf1795aa269
2022-03-16 16:35:59 -07:00
Bernardo Rufino
30e41a64b2 Merge "Add safer Intent extra APIs and deprecate old ones" 2022-03-16 23:16:37 +00:00
Jeremy Meyer
a07474c452 Have Typeface pass a cookie of -1 to search through all assets
Without this, when font are overlayed it will fail because it is looking
in the wrong place to load the font

Bug: 151770185
Test: Manual, example app that has a font that is overlayed
Change-Id: I64c5a436b7250cfd0a75f5de36c64f07a20d523a
2022-03-15 23:52:15 +00:00
Kholoud Mohamed
784e20708d Merge "Start an activity cross profile in same task." into tm-dev 2022-03-15 15:20:54 +00:00
Naomi Musgrave
13194c3ca4 Capture the contents of a single task
Introduces layer mirorring of a single task, given the task is both
identified (future work - dependency on setup flow in SysUI) and the
flag is enabled (currently disabled).

Error handling (tearing down the VirtualDisplay if task recording setup failed)
will come in a future change

Bug: 216625226
Test: atest WmTests:DisplayContentTests
Test: atest WmTests:ContentRecorderTests
Change-Id: I16abd55ce75537ff8fbbb379e4970668ea02a230
2022-03-15 14:13:11 +00:00
Bernardo Rufino
a89fede08c Add safer Intent extra APIs and deprecate old ones
Complementing new safer Bundle APIs introduced in aosp/1988908.

Test: Working on CTS
CTS-Coverage-Bug: 224457848
Bug: 224457848
Change-Id: I1d2b15d1214f2bd2eccade45693365098200ae01
2022-03-14 09:53:25 +00:00
TreeHugger Robot
78a0333f67 Merge "Add a system API to make a package become visible to other package" into tm-dev 2022-03-11 05:21:08 +00:00
Rhed Jao
829792d752 Add a system API to make a package become visible to other package
Expose a system API PackageManager#makeUidVisible for
mainline module to make a package become visible to the caller.

Bug: 222205552
Test: atest AppEnumerationTests
Test: atest PermissionPolicyTest
Ignore-AOSP-First: (for packages/Shell/AndroidManifest.xml) Permission
Change-Id: I6cf322ddfea09a8a4c0c442a6789af4e79d294d7
2022-03-11 10:53:08 +08:00
Winson Chiu
2174fc2339 Merge "Null check signature array before comparison" into tm-dev 2022-03-10 20:11:03 +00:00
Pedro Loureiro
85f1c315d9 Merge "Parse maxSdkVersion for APK in apexes" into tm-dev 2022-03-10 14:41:31 +00:00
Charles Chen
2828207a1a Merge "Revert "Revert "Promote startActivityAsUser to SystemApi""" into tm-dev 2022-03-10 03:38:07 +00:00
Winson
b22a602359 Null check signature array before comparison
SigningDetails.UNKNOWN is defined with a null array, so if any
package fails to scan signatures, this code would crash with an
NPE.

Instead of failing, just treat it as an empty signature array.

It's unclear what caused this to pop up now, as this code hasn't
changed in a long while.

Bug: 223469467

Test: presubmit

Change-Id: Icdcfaaa3586898873b719c74dd5662b03e3fabae
2022-03-09 12:24:14 -08:00
Khalid Ramadan
fb65642df8 Merge "Send broadcast to SDK verifier." into tm-dev 2022-03-09 14:40:53 +00:00
TreeHugger Robot
fccb9247a6 Merge "Always restart apps if base.apk gets updated." into sc-v2-dev am: 95819b3100
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17112345

Change-Id: I77782a0b88a943902fe66cac657075472028a928
2022-03-09 06:20:15 +00:00
Chun-Wei Wang
d0e94f92e0 Merge "Use PackageManager.INSTALL_XXX error codes (15/n)" into tm-dev 2022-03-09 01:15:06 +00:00
Alex Buynytskyy
36b0e9e94c Always restart apps if base.apk gets updated.
Bug: 219044664
Fixes: 219044664
Test: atest PackageManagerShellCommandTest
Change-Id: I27a0c5009b2d5f1ea51618b9acfa1e6ccee71296
Merged-In: I27a0c5009b2d5f1ea51618b9acfa1e6ccee71296
2022-03-09 00:47:24 +00:00
John Wu
40249e41ad Merge "Revert "Revert "Update PackageInfo APIs to reflect shared UID st..."" into tm-dev 2022-03-08 22:54:55 +00:00
John Wu
a0d304132d Revert "Revert "Update PackageInfo APIs to reflect shared UID st..."
Revert "Revert "Update test to check PackageInfo""

Add null check to prevent possible NPEs.

Reverted Changes:
I9a0c5d5ad:Update PackageInfo APIs to reflect shared UID stat...
Ib338b21ab:Update test to check PackageInfo

Change-Id: Ic6f72f08f487bcb37cc75acd18b72427aabf91b7
2022-03-08 18:34:25 +00:00
Pedro Loureiro
3a14d0599a Parse maxSdkVersion for APK in apexes
"Normal" app installs are not affected by this change.

Test: atest apex_apkinapexmaxsdk_tests

Bug: 208239394

Change-Id: Iceb464dcb6fe1e9c26c456be85379ce709753103
2022-03-08 15:04:26 +00:00
Khalid Ramadan
521adad72d Send broadcast to SDK verifier.
Parse APK info during installing and if SDK send broadcast
to invoke SDK verifier.

Bug: 216436982
Test: manually install SDK
Change-Id: I027c1999685f582c6bce2c4be6169feb5886fdba
2022-03-08 13:32:11 +00:00
TreeHugger Robot
c972201018 Merge "Revert "Update PackageInfo APIs to reflect shared UID status"" into tm-dev 2022-03-08 11:55:06 +00:00
Winson
eb403e7d37 Isolate IPackageManager implementation
To avoid leaking IPackageManager methods directly into
PackageManagerService, moves the IPM implementation into an inner
class similar to PackageManagerInternal.

This will help enforce snapshot consistency by ensuring that all
non-IPM PMS methods can always take in a Computer instance to re-use.

Bug: 217961172

Test: presubmit

Change-Id: Ibf7bd3d1d90a40786279763ba8d62eb9348bb760
2022-03-07 23:10:41 -08:00
Sam Dubey
8472fdb563 Revert "Update PackageInfo APIs to reflect shared UID status"
Revert "Update test to check PackageInfo"

Revert submission 17050883-leave_shared_uid_pkginfo

Reason for revert: Breaks AppIntegrityManagerTest* tests
Bug: 223167660
Reverted Changes:
I9a0c5d5ad:Update PackageInfo APIs to reflect shared UID stat...
Ib338b21ab:Update test to check PackageInfo

Change-Id: I7b5debf8c0ba38bf168a4fff36108ceef4e294a8
2022-03-08 05:05:23 +00:00
Michael Groover
115740d022 Merge "Revert "[DO NOT MERGE]Revert "Relax minimum signature scheme ver..."" into sc-v2-dev 2022-03-08 00:42:19 +00:00
Michael Groover
a64720dab3 Merge "Revert "[automerge] [DO NOT MERGE]Revert "Relax minimum signatur..."" into sc-v2-dev-plus-aosp 2022-03-08 00:42:19 +00:00
Michael Groover
01c3d11b83 Revert "[DO NOT MERGE]Revert "Relax minimum signature scheme ver..."
Revert submission 16943318-presubmit-am-bc566b73c1674298b82a1153c03313a1

Reason for revert: This change breaks Better Bug.
Reverted Changes:
I32a2db8c7:[automerge] [DO NOT MERGE]Revert "Relax minimum si...
Ic53d2a361:[DO NOT MERGE]Revert "Relax minimum signature sche...

Bug: 223079119

Change-Id: I987bda9df92543f082700936c20aad06f992bdb0
2022-03-08 00:05:17 +00:00
Michael Groover
26e383f664 Revert "[automerge] [DO NOT MERGE]Revert "Relax minimum signatur..."
Revert "[DO NOT MERGE]Revert "Relax minimum signature scheme ver..."

Revert submission 16943318-presubmit-am-bc566b73c1674298b82a1153c03313a1

Reason for revert: This change breaks Better Bug.
Reverted Changes:
I32a2db8c7:[automerge] [DO NOT MERGE]Revert "Relax minimum si...
Ic53d2a361:[DO NOT MERGE]Revert "Relax minimum signature sche...

Change-Id: I847740b01073d4a7adde1e7b80243cd98cf2e722
2022-03-07 22:15:46 +00:00
Hao Ke
e89ba03962 Merge "Change unsafe readSparseArray call in ApplicationInfo." am: db4e1b7369 am: ce853414e6 am: de47f43890
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2004550

Change-Id: If8689584af819b0e1a4e6cd145835e567d970dff
2022-03-07 19:52:53 +00:00
Hao Ke
de47f43890 Merge "Change unsafe readSparseArray call in ApplicationInfo." am: db4e1b7369 am: ce853414e6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2004550

Change-Id: Iedf232fe99b2e70b3d56c848d213a46dc2593ff6
2022-03-07 19:19:54 +00:00
Hao Ke
ce853414e6 Merge "Change unsafe readSparseArray call in ApplicationInfo." am: db4e1b7369
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2004550

Change-Id: I6e196e5270893bbab37a66c8079e2170cdab0d7d
2022-03-07 18:47:51 +00:00
John Wu
a8196fc56c Merge "Update PackageInfo APIs to reflect shared UID status" into tm-dev 2022-03-07 11:47:05 +00:00
Charles Chen
b66b090814 Revert "Revert "Promote startActivityAsUser to SystemApi""
This reverts commit 07f7f3ff5b.

Currently, Context#startActivityAsUser(Intent, UserHandle) has
already been a System API. This CL furthur makes
startActivityAsUser with ActivityOptions a System API.
This is enssential to launch an Activity to the secondary display
by setting launched display ID in ActivityOptions.

This also align the behavior of startActivity. We made all versions
of startActivity public APIs.

Bug: 199829817
Change-Id: I334c2a98483e709559162ad64f3b69cbd3b615d2
Test: atest AnnotationTest
CTS-Coverage-Bug: 222189824
2022-03-07 14:17:58 +08:00
Michael Groover
7026055322 Merge "[DO NOT MERGE]Revert "Relax minimum signature scheme version for apps on system partition"" into sc-v2-dev 2022-03-05 00:02:48 +00:00
Michael Groover
dd244b19a4 Merge changes from topic "presubmit-am-bc566b73c1674298b82a1153c03313a1" into sc-v2-dev-plus-aosp
* changes:
  [automerge] [DO NOT MERGE]Revert "Relax minimum signature scheme version for apps on system partition" 2p: 3c36fd5fee
  [DO NOT MERGE]Revert "Relax minimum signature scheme version for apps on system partition"
2022-03-05 00:02:48 +00:00
Alex Buynytskyy
b9cc7bc021 Always restart apps if base.apk gets updated.
Bug: 219044664
Fixes: 219044664
Test: atest PackageManagerShellCommandTest
Change-Id: I27a0c5009b2d5f1ea51618b9acfa1e6ccee71296
2022-03-04 20:11:57 +00:00
John Wu
07ad5ff07a Update PackageInfo APIs to reflect shared UID status
Properly reflect the current status of shared UID in several
PackageManager public APIs that returns PackageInfo.

For getPackageArchiveInfo, we only consider the sharedUserMaxSdkVersion
attribute as a best effort to reflect the APK status.

Test: atest CtsSharedUserMigrationTestCases
Bug: 220015249
Change-Id: I9a0c5d5ad0dee19a86ab9f2af6deb254d8b5cbb7
2022-03-04 10:36:58 -08:00
Riley Jones
39ce6918c7 Merge "Revert "Promote startActivityAsUser to SystemApi"" into tm-dev 2022-03-03 23:34:39 +00:00
Riley Jones
07f7f3ff5b Revert "Promote startActivityAsUser to SystemApi"
This reverts commit c2817ca17f.

Reason for revert: DroidMonitor-triggered revert due to bug b/222503182.

Change-Id: I8ab687811b7b0a76587bcb0903055ebbc35f729a
2022-03-03 23:19:13 +00:00
Charles Chen
c4c1ac53fd Merge "Promote startActivityAsUser to SystemApi" into tm-dev 2022-03-03 14:26:27 +00:00
Vadim Caen
8fa5667732 Merge "Move OnBackInvokedCallback to window package." into tm-dev 2022-03-03 10:03:41 +00:00
Vadim Caen
72077726f5 Move OnBackInvokedCallback to window package.
Originally, View was implementing onBackInvokedDisptacherOwner, but now
only Activity and Dialog and since back event are related to the
window, it makes sense to move them into the android.window package

This follow up comment at:
ag/c/platform/frameworks/base/+/16764116/comments/e131f3ef_e3e1d2e0

Test: atest BackNavigationTests
Bug: 221401221
Change-Id: Ia2f26162beb6a41b6e162b31e599e882f8bf7320
2022-03-02 16:28:57 +01:00
Charles Chen
c2817ca17f Promote startActivityAsUser to SystemApi
Currently, Context#startActivityAsUser(Intent, UserHandle) has
already been a System API. This CL furthur makes
startActivityAsUser with ActivityOptions a System API.
This is enssential to launch an Activity to the secondary display
by setting launched display ID in ActivityOptions.

This also align the behavior of startActivity. We made all versions
of startActivity public APIs.

Bug: 199829817
Test: presubit
CTS-Coverage-Bug: 222189824
Change-Id: Ia1db353d4b91a8952d4d21b970253e1ac03e8173
2022-03-02 03:16:59 +00:00
Jeremy Meyer
b21e7cee30 Fix a ConcurrentModificationException when dumping resources
Since the sResourcesHistory set is synchronized, an attemp to modify the
set will block while the forEach() method is running in the rare case
resources are being dumped. With a normal for loop, modifying the set
while in the loop results in a ConcurrentModificationException.

Fixes: 219609463
Test: Manual
Change-Id: I9b7bb965aa390e5dec696be07599f777c807c1e3
2022-03-01 19:23:07 +00:00
Hao Ke
9baf0dc3b1 Change unsafe readSparseArray call in ApplicationInfo.
Replace the unsafe readSparseArray API call with the typed version.

Bug: 195622897
Change-Id: Ia874fd8e454ddb145d2e999afb08cb79f693566c
Test: Builds and Boots.
2022-03-01 19:18:16 +00:00