Commit Graph

11593 Commits

Author SHA1 Message Date
Lee Shombert
9a686c07ba Merge "Prepare PropertyInvalidatedCache for SystemApi" 2022-01-06 23:14:05 +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
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
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
Etienne Ruffieux
770d50ed43 Moved AttributionSource related APIs in AttributionSource
Modified myAttributionSource() to check for global AS for
process in ActivityThread and fallback to building new AS
with PackageManager#getPackageForUid(myUid()) if null.

Tag: #feature
Bug: 210467846
Bug: 210468546
Test: build
Change-Id: I7aa75395469bf0bb806100420faaf98c52057355
CTS-Coverage-Bug: 210906055
2021-12-15 22:03:50 +00:00
Evan Rosky
373c8a1803 Merge "Revert "Add XML configuration for density"" 2021-12-15 21:06:22 +00:00
Evan Rosky
45c4562041 Revert "Add XML configuration for density"
This reverts commit a822ccd755.

Reason for revert: Broke a shell-transition CTS test (b/210902428)

Change-Id: I479a6152f94cc6aff30caa8f49932c53d420db1e
2021-12-15 21:02:58 +00:00
Bernardo Rufino
3d10fb4b83 Merge "Migrate unsafe parcel APIs in framework-minus-apex" 2021-12-15 19:15:58 +00:00
Bernardo Rufino
90bb3709dc Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
2021-12-15 18:21:38 +00:00
Yandry Perez Clemente
77b0bbb413 Fixes NullPointerException.
mPendingResult is not guaranteed to have been initialized at this point.

Test: Manual.
Bug: 210266601
Change-Id: I84287a068d03dd3aac2b046d1b8fdd8e6e52803f
2021-12-15 17:27:59 +00:00
Pinyao Ting
24912ef392 Integrate LauncherApps API with AppSearch
- getShortcutIntent and startShortcut now additionally checks AppSearch
if specifed shortcuts cannot be found in memory.
- getShortcutIconFd and getShortcutIconUri now additionally checks
AppSearch if specified shortcuts cannot be found in memory.
- getShortcutIconResId is unchanged since the api is deprecated.
- Introduced ShortcutQuery.FLAG_GET_PERSISTED_DATA, when used in
getShortcuts, it additionally performs the check in AppSearch.

Bug: 151359749
Test: atest CtsShortcutManagerTestCases
Change-Id: I0e56e3d0261fc0a3cf0ab4c5decbbd59ac3d7d29
2021-12-15 00:04:40 +00:00
Hui Wang
c47df7fd76 Add new Telephony feature flags and update API annotations
Bug: 206437821
Test: make
Test: atest CtsTelephonyTestCases FrameworksTelephonyTests
Change-Id: I511afb5afc52b859a37f8ae27ab671c2b8037527
2021-12-14 20:37:47 +00:00
Pinyao Ting
00276585c5 Merge "Include new api to exlude a shortcut from launcher" 2021-12-14 20:02:31 +00:00
Makoto Onuki
6bef72dbfe Merge changes from topic "per-process-app-class-2"
* changes:
  Support per-process Application class (AM and client side)
  Support per-process Application class (package parser)
  Support per-process Application class in <process> tag
2021-12-14 17:55:58 +00:00
Felka Chang
00964e9aea Dump theme inheritance information in UnsupportedOperationException
It isn't enough to only dump the theme id and name because there is
no whole theme inheritance map. Developers need the map to figure out
why the attribute value is so strange.

A theme is a kind of style. This patch creates an API to retrieve the
parent id for any style.  And, it dumps the whole inheritance between
themes until it can't find the parent style.

Test: manual test described in b/209708201#comment5
Bug: 209708201

Change-Id: I9de0e6e9aaeff7cb9fc89dc9b8a04925e84f975c
2021-12-14 11:42:30 +08:00
Makoto Onuki
236abad797 Support per-process Application class (package parser)
Now the <process> tag supports `android:name`, which takes a custom
Application class name. If omitted, the system defaults to the
class set in the <application> tag, or the default class which is
`android.app.Application`.

Bug: 197264681
Test: atest CtsProcessTest
Test: atest PackageManagerServiceUnitTests
Change-Id: Iaf336cc34fe950c4b3d8887de557857f8c23dc83
2021-12-13 16:28:32 -08:00
TreeHugger Robot
3cb6aeccbd Merge "Add theme information during throwing exception" 2021-12-13 07:20:16 +00:00