Commit Graph

11607 Commits

Author SHA1 Message Date
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
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
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
Sanjana Sunil
6a47a2ca39 Fix documentation on unbinding for bindServiceAsUser()
Similar to bindService(), even if bindServiceAsUser() returns false,
unbindService() must still be called to allow the service to shut down.
The documentation is updated to reflect this.

Bug: 212663289
Test: m ds-docs-java
Change-Id: I780d307f4a0ebf8bef508932181e580f168b5578
2021-12-30 11:34:15 +00:00
Karishma Vakil
f523f15028 [SafetyCenter] Add broadcast action and extra constants for data refreshes
Test: Will add when the constants are used in b/208624002.
Bug: 208623999
Bug: 210423417
Change-Id: I16482a7101c0f2429b79bac92e5b463f47b13a2d
2021-12-29 21:35:30 +00:00
Xiaoyu Jin
74f972e215 Add documents for the required permission
In order to registerContentObserver as other user, callers need to hold
the INTERACT_ACROSS_USERS_FULL permission.

Bug: 206743591
Test: CtsContentTestCases
Change-Id: I2f373a3f064718cc87bdda35a5854b6a6fd2e7aa
2021-12-27 12:58:58 +00:00
Jackal Guo
0033c65aa9 Add enforcement for duplicate permissions
Declaring duplicate permissions with different protection levels is
not allowed. Add the scheme enforcement for manifest during parsing.

Bug: 211934395
Test: atest AppSecurityTests
Change-Id: Ieb006ab4abf19baf949e9b5bfd3e3fea16237527
2021-12-24 17:18:56 +08:00
Jeff Sharkey
e9a953fa2a Merge "Add a receiver exported flag to mark unaudited runtime receivers" 2021-12-22 21:24:08 +00:00
Xinyi Zhou
db2e52cc01 Merge "Revert "Add Neary feature to PackageManager"" 2021-12-22 20:20:59 +00:00
Michael Groover
7970fff4cd Add a receiver exported flag to mark unaudited runtime receivers
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting T or later
registering a receiver for non-system broadcasts must specify either
the exported or not exported flag when invoking #registerReceiver;
if one of these flags is not provided, the platform will throw a
SecurityException. The platform and system apps have several locations
where a receiver is registered for non-system broadcasts that have
not yet been audited to determine if they should be exported. This
commit introduces a temporary flag that can be used to meet the
new requirement that a flag be specified while also marking the
receiver as needing an audit before the T release to determine
whether the receiver should be exported or not.

Bug: 161145287
Test: atest ContextTest
Change-Id: Ie9d1e2ad6e2d831c374437ed65d085711b7dc3b7
2021-12-21 16:42:47 -08:00
Amy Gu
eb9c1fb764 Merge "Specify two item limit for EXTRA_CHOOSER_TARGETS and EXTRA_INITIAL_INTENTS" am: 73ded9f9df am: b5f0629d41 am: 379347b29a am: 9001310c40
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1858069

Change-Id: I404a2ef9bdabcd5dba6529b4ca6f4b3463e31197
2021-12-21 19:19:04 +00:00
Amy Gu
9001310c40 Merge "Specify two item limit for EXTRA_CHOOSER_TARGETS and EXTRA_INITIAL_INTENTS" am: 73ded9f9df am: b5f0629d41 am: 379347b29a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1858069

Change-Id: I9d0089997234826e6310d4fcda14cdf869ec5fdb
2021-12-21 19:06:21 +00:00
Amy Gu
379347b29a Merge "Specify two item limit for EXTRA_CHOOSER_TARGETS and EXTRA_INITIAL_INTENTS" am: 73ded9f9df am: b5f0629d41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1858069

Change-Id: I7e00c46550eba9eb810d5b5112d6a4dd30d157cf
2021-12-21 18:53:01 +00:00
TreeHugger Robot
66eca70ab0 Merge "Change close guard logged messages" 2021-12-21 15:55:19 +00:00
Ioannis Ilkos
0bde67ab00 Change close guard logged messages
Unless we are looking at stack traces (e.g. from strict mode) it's not
possible to identify which type of object is not being closed (most
methods are 'close' or 'release). Change the logged text to clarify.

Change-Id: Ib90eac716f43c2c2caf8d8c6fb64a7bd90562da9
Test: manual
2021-12-21 11:46:10 +00:00
JW Wang
8c19110bee Move and rename some members (1/n)
This is a preliminary change to apply READY/FAILED/APPLIED to
non-staged sessions.

* Move mSession* fields to PackageInstallerSession as they
  will be useful to both staged and non-staged sessions.
* Rename some members as they will be applicable to both staged
  and non-staged sessions.

Bug: 210359798
Test: atest StagingManagerTest \
            PackageInstallerSessionTest \
            CtsStagedInstallHostTestCases

Change-Id: Ie1b09aa4c7cbc843712c731a1b903d26684b2e30
2021-12-21 13:37:59 +08:00
Amy Gu
d5451fb370 Specify two item limit for EXTRA_CHOOSER_TARGETS and EXTRA_INITIAL_INTENTS
Change-Id: If3fdaabf8456cc99f4cf7819ec89b3901a7c74c6
2021-12-21 01:21:52 +00:00
Hui Wang
c1183c038e Merge "Add new Telephony feature flags and update API annotations" 2021-12-20 15:50:57 +00:00
John Wu
7a6f2c8e23 Merge "Update system package broadcasts for app ID changes" 2021-12-17 01:31:04 +00:00
Evan Rosky
1b44d86802 Merge "Revert "Revert "Add XML configuration for density""" 2021-12-17 00:52:45 +00:00
Etienne Ruffieux
5251dfbc2a Merge "Moved AttributionSource related APIs in AttributionSource" am: 70d456d06c am: 52ddc063b0 am: e5d5eefb16 am: 52dfe57f07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1922817

Change-Id: I60fa5ecea7c9b1bffbd8bfaf0ed85cafb80fa5bc
2021-12-16 22:52:35 +00:00
John Wu
4776cdee49 Update system package broadcasts for app ID changes
Whenever a package's app ID has changed, the system broadcasts should
behave as if the package is fully uninstalled and then re-installed
subsequently. Additional extras are added to indicate the app ID change
to allow components to handle this case specifically.

Test: atest SharedUserMigrationTest#testDataMigration
Bug: 179284822
Change-Id: Ie00eaed1f0a704876ea76aa0e5ae2a1b21f199df
2021-12-16 14:48:56 -08:00
Etienne Ruffieux
52dfe57f07 Merge "Moved AttributionSource related APIs in AttributionSource" am: 70d456d06c am: 52ddc063b0 am: e5d5eefb16
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1922817

Change-Id: Id6bcfb0cca120540dd251dda22c713539c5c2b8c
2021-12-16 22:08:37 +00:00
Evan Rosky
ba816ea404 Revert "Revert "Add XML configuration for density""
This reverts commit 45c4562041.

Reason for revert: Seems like reverting didn't help.

Change-Id: Ic6ac4425646100a61a978b4e7388fab88d4d0ed1
2021-12-16 22:02:55 +00:00
Etienne Ruffieux
e5d5eefb16 Merge "Moved AttributionSource related APIs in AttributionSource" am: 70d456d06c am: 52ddc063b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1922817

Change-Id: Id597191e675eca32c4d965fd4dc0e62dc2653283
2021-12-16 21:42:01 +00:00
Etienne Ruffieux
70d456d06c Merge "Moved AttributionSource related APIs in AttributionSource" 2021-12-16 21:16:58 +00:00
Joanne Chung
fcf3a92a1d Merge "Initial layout of selection toolbar." 2021-12-16 05:56:41 +00:00
Joanne Chung
41c4a0ac71 Initial layout of selection toolbar.
The initial selection toolbar related architecture. Render service
part and the implementation will be revised in the follow up changes.

Bug: 190030331
Bug: 205822301
Test: manual. Can boot to home and get manager successfully.
Ignore-AOSP-First: new file for T

Change-Id: Iab5d5f2e5e48e6258a63fb0c479194c958ea61e8
2021-12-16 11:35:23 +08:00
Yandry Perez Clemente
b9cd53b835 Merge "Fixes NullPointerException." 2021-12-15 23:30:57 +00:00