Commit Graph

11835 Commits

Author SHA1 Message Date
Kholoud Mohamed
784e20708d Merge "Start an activity cross profile in same task." into tm-dev 2022-03-15 15:20:54 +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
Chun-Wei Wang
d0e94f92e0 Merge "Use PackageManager.INSTALL_XXX error codes (15/n)" into tm-dev 2022-03-09 01:15:06 +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
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
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
Nikita Ioffe
8056335fcd Merge "Rename SupplementalProcess to SdkSandbox" into tm-dev 2022-03-01 17:07:16 +00:00
Gareth Vaughan
10b6509d00 Start an activity cross profile in same task.
Adding new overloaded methods of startMainActivity and startActivity that allow the caller to
specify that the new activity should be added to the current task rather
than creating a new one.
Test: atest android.devicepolicy.cts.CrossProfileAppsTest FrameworksServicesTests:com.android.server.pm.CrossProfileAppsServiceImplTest
Bug: 215425075

Change-Id: I21c258c5962daefb32f65779035f4ba8f0474da7
(cherry picked from commit 96ca7241ff)
Merged-In:I21c258c5962daefb32f65779035f4ba8f0474da7
2022-03-01 15:31:49 +00:00
Nikita Ioffe
df5971335b Rename SupplementalProcess to SdkSandbox
Bug: 218314884
Bug: 220320098
Test: presubmit
Test: atest PackageManagerShellCommandTest
Test: atest SdkSandboxPermissionTest
Change-Id: I9fb98e0caee75bdaaa35d11d174004505f236799
2022-02-28 17:29:55 +00:00
Nate Myren
6510aa238e Implement API feedback for Safety Center QS
Implements API feedback about the safety center constants. Also renames
Safety Hub to Safety Center

Fixes: 215301946
Test: build
Change-Id: Ie07e8fc3ae7371e94d23ac6dfa9a446ef92da074
2022-02-25 16:56:30 +00:00
Jon Eckenrode
033c0d99bd Merge "Added return value to overloaded bindService method." am: 59d082af63 am: 7756ed8db8 am: 2348bd2d17
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1995510

Change-Id: Ice2ac318fa773a406a416316e66e92bbca5b5b1e
2022-02-25 01:25:19 +00:00
Jon Eckenrode
2348bd2d17 Merge "Added return value to overloaded bindService method." am: 59d082af63 am: 7756ed8db8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1995510

Change-Id: I2ce6164ecb95dc3ea49cc0e9c04edc4782659e81
2022-02-25 00:52:40 +00:00
Jon Eckenrode
7756ed8db8 Merge "Added return value to overloaded bindService method." am: 59d082af63
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1995510

Change-Id: I5868cc709613ee77b9cd40866582b58614dcc249
2022-02-25 00:30:46 +00:00
joneckenrode
ecbb809686 Added return value to overloaded bindService method.
Staged: https://android.devsite.corp.google.com/reference/android/content/Context#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)

Test: Built API documentation
Signed-off-by: joneckenrode <joneckenrode@google.com>
Change-Id: I9b5466441b7b5cb4deb5a8cc25cfd01a83be80ca
2022-02-24 16:21:58 +00:00
Presubmit Automerger Backend
659d441a9c [automerge] [DO NOT MERGE]Revert "Relax minimum signature scheme version for apps on system partition" 2p: 3c36fd5fee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16943318

Change-Id: I32a2db8c788ce4a25cdfb0871b725959caacd3ad
2022-02-22 18:17:19 +00:00
Michael Groover
3c36fd5fee [DO NOT MERGE]Revert "Relax minimum signature scheme version for apps on system partition"
This reverts commit b71e398935.

Revert reason: System apps should now have uncompressed dex / library
files in their APKs and should be able to satisfy the minimum V2
signature requirement when targeting API level 30+.

Fixes: 215046612
Test: Manually verified V1 only signed APK targeting API level 30
      on the system image failed to verify.
Change-Id: Ic53d2a3614e7dff4e4bfe18561d3dfbb665bbcb2
2022-02-22 18:17:11 +00:00
JW Wang
5df37ffef1 Use PackageManager.INSTALL_XXX error codes (15/n)
2 sets of error codes are a source of confusion. This CL migrates
all uses of SessionInfo.SESSION_XXX error codes to
PackageManager.INSTALL_XXX ones which provide a richer set of
error codes.

Bug: 210359798
Test: atest StagingManagerTest \
            com.android.server.pm.test.PackageInstallerSessionTest \
	    CtsStagedInstallHostTestCases

Merged-In: I0a721a48293029983ffd80912adbb2229ab4ee5d
Change-Id: I0a721a48293029983ffd80912adbb2229ab4ee5d
(cherry picked from commit 1ed3bff6c5)
2022-02-21 05:52:07 +00:00
Jeremy Meyer
6a6b931306 Change ApplicationInfo create timestamp to uptimeMillis
Bug: 188059515
Test: Manual testing on device
Change-Id: Id03a95684b4bf3ae2938bdd1b7a99f8965b24cc1
2022-02-17 17:44:13 +00:00
Jon Eckenrode
0569c3d46c Merge "Revised API documentation of Context and ServiceConnection. See b/213625234." am: 08bb407612 am: e5a25d1d7c am: 5577fb24aa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1975966

Change-Id: I5b946df3374fc6ab223378d018135f78806cd001
2022-02-15 22:37:58 +00:00
Jon Eckenrode
5577fb24aa Merge "Revised API documentation of Context and ServiceConnection. See b/213625234." am: 08bb407612 am: e5a25d1d7c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1975966

Change-Id: I3725bf4a04aaa5eb00cae32a2effd654893dc8bd
2022-02-15 22:18:57 +00:00
Jon Eckenrode
e5a25d1d7c Merge "Revised API documentation of Context and ServiceConnection. See b/213625234." am: 08bb407612
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1975966

Change-Id: I608e10bbd7208ed90f23ab25ac28c5512a3ea4ca
2022-02-15 22:02:50 +00:00
Vadim Caen
a70bdd8739 Merge "Add enableOnBackInvokedCallaback manifest attribute" 2022-02-15 19:07:27 +00:00
Winson Chiu
2fd963f3a4 Merge "Build splitPermissions manually for PackageParser" 2022-02-15 18:27:25 +00:00
Richard Gaywood
aaf134e040 Puller for PendingIntentController
Populate a new stats atom with information about PendingIntents; per-uid: (1) the total number of intents and (2) the total size of any extras bundled with the intents.

Change-Id: I04e6b368a76623c80ead6f846baf85b1a6c5ce70
Test: statsd_testdrive 10151
Bug: 217162457
2022-02-15 08:41:36 +00:00