Commit Graph

11634 Commits

Author SHA1 Message Date
Kweku Adams
aec1bdf2ac Merge "Indicate that UID_REMOVED has EXTRA_REPLACING." 2022-01-14 17:18:51 +00:00
Artur Satayev
8b326737de Merge "Introduce initOrder for apex-system-services." 2022-01-14 13:15:44 +00:00
Felka Chang
255f348a49 Tidy up CtsAppSecurityHostTestCases for PM test plan
According to the go/audit_pm_test_plan_sheet_2021, the following tests
are necessary to run for the presubmit process.
* android.appsecurity.cts.ApkVerityInstallTest (ag/15434575)
* android.appsecurity.cts.AppSecurityTests (ag/16473520)
* android.appsecurity.cts.ApplicationVisibilityTest (ag/15151833)
* android.appsecurity.cts.EphemeralTest (ag/16097868)
* android.appsecurity.cts.ExternalStorageHostTest (ag/16473520)
* android.appsecurity.cts.InstantAppUserTest (ag/16097868)
* android.appsecurity.cts.IsolatedSplitsTests (ag/15509173)
* android.appsecurity.cts.OverlayHostTest (ag/15938874)
* android.appsecurity.cts.PackageVisibilityTest (ag/15461803)
* android.appsecurity.cts.PkgInstallSignatureVerificationTest
  (ag/16095666)
* android.appsecurity.cts.PrivilegedUpdateTests (ag/15744081)
* android.appsecurity.cts.SharedUserIdTest (ag/7013394)
* android.appsecurity.cts.SplitTests (ag/15509173)

CtsAppSecurityHostTestCases contains some tests not belonging
to PackageManager. It annotates @Presubmit for those classes belonging
to PackageManager. It will be triggered via
frameworks/base/core/java/android/content/pmTEST_MAPPING by the
presubmit process.

Test: TP="CtsAppSecurityHostTestCases:android.appsecurity.cts"; atest \
     ${TP}.ApkVerityInstallTest \
     ${TP}.AppSecurityTests \
     ${TP}.ApplicationVisibilityTest \
     ${TP}.EphemeralTest \
     ${TP}.ExternalStorageHostTest \
     ${TP}.InstantAppUserTest \
     ${TP}.IsolatedSplitsTests \
     ${TP}.OverlayHostTest \
     ${TP}.PackageVisibilityTest \
     ${TP}.PkgInstallSignatureVerificationTest \
     ${TP}.PrivilegedUpdateTests \
     ${TP}.SharedUserIdTest \
     ${TP}.SplitTests

Bug: 180650365
Change-Id: I0b626e311a598d0fb953019a016a1dbafc380f81
2022-01-14 03:47:13 +00:00
Felka Chang
6d3144beae Merge "Add StaticSharedLibsHostTests as PackageManager presubmit" 2022-01-14 03:46:04 +00:00
Kweku Adams
159ca40bc5 Indicate that UID_REMOVED has EXTRA_REPLACING.
Bug: 140731248
Change-Id: Ia24a688f277580ed4edc1fac12ad05b8f7deb919
Test: N/A
2022-01-13 18:56:52 +00:00
satayev
8308d9e981 Introduce initOrder for apex-system-services.
This allows to have a relative order between apex system services if
needed due to dependencies.

Bug: 192880996
Test: atest ApexSystemServicesTestCases PackageParserTest ApexManagerTest
Change-Id: Ib9700be48390f8a78135c76e79ad2bc4cb6e8577
2022-01-13 14:06:13 +00:00
Gareth Vaughan
6856e6804f Merge changes from topic "START_CROSS_PROFILE_ACTIVITIES"
* changes:
  Add START_CROSS_PROFILE_ACTIVITIES to startActivity
  Add new permission START_CROSS_PROFILE_ACTIVITIES
2022-01-13 13:17:37 +00:00
TreeHugger Robot
8fb380494d Merge "BaseParceledListSlice: remove List reference once transfer completes" 2022-01-13 02:50:15 +00:00
Treehugger Robot
9b21bb0fec Merge "Make ACTION_SETTING_RESTORED SystemApi" am: 2e2a97c04b am: d8ef70a405 am: 2f68d6bc5c am: 082f6e9f08
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1945287

Change-Id: I87c03ec850e15670db5884d619bd1e52784d5954
2022-01-13 02:35:34 +00:00
Treehugger Robot
082f6e9f08 Merge "Make ACTION_SETTING_RESTORED SystemApi" am: 2e2a97c04b am: d8ef70a405 am: 2f68d6bc5c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1945287

Change-Id: I447d2f861e1c05f9483fe60e48e45918c448adfd
2022-01-13 02:24:11 +00:00
Chun-Wei Wang
1227d3af24 Merge "Rename STAGED_SESSION* error codes (2/n)" 2022-01-13 02:15:16 +00:00
Treehugger Robot
2f68d6bc5c Merge "Make ACTION_SETTING_RESTORED SystemApi" am: 2e2a97c04b am: d8ef70a405
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1945287

Change-Id: Ia012adfcf1febe63dc5dc8a89d5b2133fe909590
2022-01-13 02:09:42 +00:00
Ashwini Oruganti
776b439703 Merge "Revert "Migrate unsafe parcel APIs in framework-minus-apex"" 2022-01-12 23:07:08 +00:00
Thomas Vannet
4c09f45a59 Merge "Add self revocation public API" 2022-01-12 21:44:32 +00:00
Michael Groover
5af00f9e0f Merge "Fix typo for userFilter when registering for ACTION_USER_REMOVED" 2022-01-12 21:12:15 +00:00
William Escande
543d84f6b2 Make ACTION_SETTING_RESTORED SystemApi
Because Bluetooth is going mainline, we need to remove call to hidden
API.
Intent.ACTION_SETTING_RESTORED and extra are currently hidden.
There is no known alternative, so this CL make them SystemApi.

Bug: 211851706
Test: Build + start bt
Tag: #refactor
Change-Id: I7a105946f075819f21b91a39bc37c6e167439bf4
2022-01-12 19:33:02 +00:00
Gareth Vaughan
4851724447 Add START_CROSS_PROFILE_ACTIVITIES to startActivity
This allows holders of START_CROSS_PROFILE_ACTIVITIES permission to start an activity of the caller package in the other profile.

Test: atest CrossProfileAppsHostSideTest (with new tests in change I661d4b7132291950c8bcb4690d90154a78751b1e)
Ignore-AOSP-First: seeking internal review on WIP change prior to merging in AOSP
Bug: 207117478
Change-Id: I5afa2e458b2eda4f53cfceabe3af950c0df63ad7
2022-01-12 12:47:03 -05:00
Bernardo Rufino
331be9a643 Revert "Migrate unsafe parcel APIs in framework-minus-apex"
This reverts commit 90bb3709dc.

Reason for revert: b/214053959

Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
2022-01-12 17:44:44 +00:00
Rhed Jao
58f8fb0e20 Merge "Fix queries tag for browsers matches intent filters incorrectly" 2022-01-12 10:44:57 +00:00
JW Wang
af8ff1c9a3 Rename STAGED_SESSION* error codes (2/n)
Rename the error codes as they will be used by
non-staged sessions as well.

Bug: 210359798
Test: atest StagingManagerTest \
            PackageInstallerSessionTest \
            CtsStagedInstallHostTestCases

Change-Id: Iec572d7a85f2615204ac069a42edb569ecadb294
2022-01-12 15:12:13 +08:00
TreeHugger Robot
02bfe89079 Merge "Add CtsInstallHostTestCases/ApkVerityTest into PM test plan" 2022-01-12 05:22:27 +00:00
Michael Groover
c91f86ea34 Fix typo for userFilter when registering for ACTION_USER_REMOVED
This commit fixes a typo in the RegisteredServicesCache when
registering for the ACTION_USER_REMOVED broadcast; previously this
action was added to the sdFilter that was defined for the previous
call to registerReceiver, but then the last call to registerReceiver
used the empty userFilter.

Fixes: 214122859
Test: Manually verified receiver was successfully registered with action
Change-Id: I72b49fa02845844fe7788817430f289f2aad7bc4
2022-01-11 19:00:28 -08:00
Thomas Vannet
af615e7baf Add self revocation public API
Test: Manual test using a non-privileged app, atest
android.permission.cts.SelfRevokeRuntimePermissionTest

When calling the API, the permission (along with any other permissions
from the same group) for the current package is downgraded to a one-time
permission, and a one-time permission session is started.

Bug: 210387494

Change-Id: I9f061cbc8c3db720127c96200fe94a644246b6d7
2022-01-11 16:32:40 -08:00
Bernardo Rufino
c6ebb14b7d Merge "Migrate unsafer parcel APIs [2]" 2022-01-11 19:20:36 +00:00
Yurii Zubrytskyi
8fe59ba86d Merge "add FrameworkCoreTest for AndroidResources test plan" 2022-01-11 07:18:41 +00:00
Darrell Shi
a2b8c40161 Merge "Add FEATURE_DREAM_OVERLAY feature flag." 2022-01-11 00:33:07 +00:00
TreeHugger Robot
7d24159ba2 Merge "Intercept activity start to check for notification permissions" 2022-01-10 19:54:45 +00:00
TreeHugger Robot
c83044be74 Merge "Add SDK to the IntDef" 2022-01-10 19:19:41 +00:00
Felka Chang
55ed77a79b Add CtsInstallHostTestCases/ApkVerityTest into PM test plan
This patch adds the followingtest packages into PackageManager
test plan.
* ApkVerityTest
    * http://ab/I95200010006888354
    * 1 minute and 50.2 seconds
    * presubmit
* CtsInstallHostTestCases
    * http://ab/I17400010007073846
    * 1 hour and 25 minutes
    * postsubmit
    * ag/16118712

Test: atest ApkVerityTest
Test: atest CtsInstallHostTestCases

Bug: 180650365
Change-Id: I165412b791865707628a49e67236001ee2faf3d1
2022-01-10 23:15:57 +08:00
Rhed Jao
0815ac1372 Fix queries tag for browsers matches intent filters incorrectly
The queries tag in the manifest that declares intent's visibility
with the uri data without the host name should only match browsers'
intent filters. This CL fixes intent filters with a wildcard prefix
in the host name are matched incorrectly by the queries of browsers.

Bug: 210405218
Test: atest AppEnumerationTests
Test: atest IntentFilterTest
Change-Id: Ib4e968c1f9e6e543c1d3dece230579def10ee306
2022-01-10 20:09:54 +08:00
Makoto Onuki
8b84813b99 Merge "Do not run unnecessary code in the common case" 2022-01-07 19:26:43 +00:00
Darrell Shi
40330dfe5e Add FEATURE_DREAM_OVERLAY feature flag.
Bug: 213235276
Test: manual
Change-Id: I4228861e7bcb80274df1b2200bcebc56cb8f680f
2022-01-07 09:25:18 -08:00
Xiaoyu Jin
e67f2a5b65 Merge "Add documents for the required permission" 2022-01-07 09:50:30 +00:00
Makoto Onuki
c5b2de9dec Do not run unnecessary code in the common case
`processes` is initialized as an empty map, so we're currently always
hitting the loop case. We should avoid it.

Bug: 213021110
Test: atest PackageManagerPerfTest#testGetApplicationInfoWithFiltering
Test: atest CtsProcessTest
Test: atest PackageManagerServiceUnitTests
Change-Id: I49fa8adb0cf10e405b2251e7de78caea1bbd8fa1
2022-01-06 16:48:11 -08:00
Alex Buynytskyy
89d3f2f367 Add SDK to the IntDef
Bug: 210622326
Fixes: 210622326
Test: presubmit
Change-Id: Ib1910f18e03fa21a9c3b431c2d3e496744ae0a13
2022-01-06 15:40:47 -08:00
Lee Shombert
9a686c07ba Merge "Prepare PropertyInvalidatedCache for SystemApi" 2022-01-06 23:14:05 +00:00
Bernardo Rufino
74ee11c3f4 Migrate unsafer parcel APIs [2]
Manually migrate the few cases of:
* readArray()
* readParcelableArray()

To the new parcel APIs that take the expected type as the last
parameter. This enhances security because it prevents unexpected types
*before* running unparcelling code. More details at go/safer-parcel.

Owners, please check that the type of the objects expected is always a
subtype of the type provided as the 3rd parameter. This is usually easy
to verify due to casts that happen shortly after.

These changes often allowed further transformations but I decided to
avoid them to keep this change small and targeted.

This was manual since it's tricky to get lint to infer the type in
those cases and it was only a few.

Bug: 195622897
Test: TH passes
Change-Id: I262ed7cd6d3bc15b32e9296e88a8a67fdb59e880
2022-01-06 18:35:31 +00:00
Nikita Ioffe
1b2bd1e83a Merge changes from topic "no_app_data_storage"
* changes:
  Don't bind mount app storage for app with NO_APP_DATA_STORAGE
  Don't create app data dirs if app requests not to
2022-01-06 16:36:01 +00:00
TreeHugger Robot
c452e34460 Merge "Add 6 CTS packages into PM test plan" 2022-01-06 08:05:52 +00:00
TreeHugger Robot
efa662ec64 Merge "Integrate LauncherApps API with AppSearch" 2022-01-06 07:40:19 +00:00
Jackal Guo
2648ce4633 Merge "Add enforcement for duplicate permissions" 2022-01-06 01:53:45 +00:00
Xinyi Zhou
e0784e05bd Merge "Expose Conext.NEARBY_SERVICE as SystemApi" 2022-01-05 21:50:01 +00:00
Xinyi Zhou
1a07c53231 Expose Conext.NEARBY_SERVICE as SystemApi
Change-Id: Ie9fb547e166e6c881dfd04383050375a11f84a9b
Test: Built successfully
Bug: 189954300
2022-01-05 21:49:39 +00:00
Karishma Vakil
b66485f237 Merge "[SafetyCenter] Add broadcast action and extra constants for data refreshes" 2022-01-05 19:48:48 +00:00
Chun-Wei Wang
66b3b89f65 Merge "Move and rename some members (1/n)" 2022-01-05 10:23:03 +00:00
Felka Chang
05edac2162 Add 6 CTS packages into PM test plan
This patch adds 6 CTS packages into the PackageManager test plan.

* CtsUsesNativeLibraryTest
  * According to ag/14340445
  * http://ab/I17400010005611830
  * 5 minutes and 10.7 seconds
* CtsAppSearchHostTestCases
  * According to ag/16097868
  * http://ab/I42500010005608800
  * 6 minutes and 35.8 seconds
* CtsSilentUpdateHostTestCases
  * According to ag/14467775
  * http://ab/I65500010005556220
  * 3 minutes and 57.1 seconds
* CtsSuspendAppsTestCases
  * According to ag/16046834
  * http://ab/I26000010005417628
  * 2 minutes and 24.3 seconds
* CtsSuspendAppsPermissionTestCases
  * According to ag/16046834
  * http://ab/I22200010005435159
  * 1 minute and 26.2 seconds
* CtsSecureFrpInstallTestCases
  * According to ag/13148012
  * http://ab/I30800010005687346
  * 1 minute and 36.3 seconds

Test: atest CtsUsesNativeLibraryTest
Test: atest CtsAppSearchHostTestCases
Test: atest CtsSilentUpdateHostTestCases
Test: atest CtsSuspendAppsTestCases
Test: atest CtsSuspendAppsPermissionTestCases
Test: atest CtsSecureFrpInstallTestCases
Test: presubmit http://ab/I42500010005584585

Bug: 180650365
Change-Id: I96c46ac1021b7099836c75670348a0e146b1c440
2022-01-05 15:43:33 +08:00
Nikita Ioffe
a8bc22f039 Don't create app data dirs if app requests not to
App can set a android.internal.PROPERTY_NO_APP_DATA_STORAGE  property in it's
AndroidManifest.xml which will tell platform to avoid creating data
directories for it.

This property is intentionally not exposed as public API because not
having private app storage is a very niche requirement.

This change also logic to prevent app updates from changing value of the
property, i.e.: if an installed app doesn't specify value of the
PROPERTY_NO_APP_DATA_STORAGE property (or has it set to false), then any
update to this app shouldn't have this property specified (or explicitly
set it to false). If an app has PROPERTY_NO_APP_DATA_STORAGE set to
true, then all updates should keep that property set to true.

Note: this change only takes into account internal storage. Removing
app's external storage will be done in the follow up cl.

Bug: 211761016
Test: atest PackageManagerShellTest
Change-Id: I3e541d947a77f5c050bf706f64009f21c24dcbc9
2022-01-04 23:50:50 +00:00
Tim Murray
122a8ec260 BaseParceledListSlice: remove List reference once transfer completes
Currently, BaseParceledListSlice will hold a reference to the List<>
until the Binder object is destroyed. However, this requires that the
receiver run GC before the sender's global Binder reference can be
removed, causing the List to be retained until both receiver and
sender perform GC. Since the List is usually the large part of the
object, instead clear the reference to the List once the transfer to
the receiver completes, allowing the List to be GC'd before the
receiver GC's its reference to the sender's Binder object.

Test: boots
Bug: 213236807
Change-Id: I22d6e56c953db3c85179911b909d5b6e7c8ba784
2022-01-04 15:09:15 -08:00
Nate Myren
ebc2f29dd6 Intercept activity start to check for notification permissions
The dialog is shown if the app is not a signature app, the system is
ready, and the app has created at least one notification channel.
Also applies the SHOULD_SHOW_REQUEST flag to all packages with implicit
POST_NOTIFICATIONS permissions

Bug: 194833441
Test: atest NotificationPermissionTest
Change-Id: I4cb8cc7bcc3635f55e291f176f722dd420a4a1bb
2022-01-04 15:04:23 -08:00
Lee Shombert
0cece3898b Prepare PropertyInvalidatedCache for SystemApi
Bug: 152453213
Tag: #refactor

This commit prepares PropertyInvalidatedCache to function as a system
api.  Specifically, the methods recompute() and bypass() which may be
overridden by clients are now public (instead of protected).  This
forces an update to all existing clients, to accommodate the change in
method visibility.

Two small changes have been made as cleanup:

 1. The awkwardly named debugCompareQueryResults() is now
    resultEquals(), which is more or less consistent with how other
    equality tests are named in Android.  This name change affects two
    clients.

 2. PackageManager has changed to use resultEquals() instead of
    maybeCheckConsistency().  This provides a simpler and more
    consistent use of the APIs.  maybeCheckConsistency() has been made
    private.

Test: atest PropertyInvalidatedCacheTests

Change-Id: I4110f8e887a4fd8c784141e8892557a9d1b80a94
2022-01-04 08:13:59 -08:00