Commit Graph

11250 Commits

Author SHA1 Message Date
Winson Chiu
be3c8efc93 Merge "Revert "Revert "Open up AndroidPackage as @SystemApi""" 2021-09-10 23:07:18 +00:00
Winson Chiu
d7adbb01ba Revert "Revert "Open up AndroidPackage as @SystemApi""
This reverts commit 750ce30b84.

Reason for revert: b/199246839 fixed, re-introduce change

Change-Id: I48f3fd20ac14c823c85de55f667d1860dade1f97
2021-09-10 16:50:01 +00:00
Rhed Jao
7d0ce7f7df Allow application to inspect query-ability of other package
This CL creates a new API PackageManager#mayPackageQuery for
applications that share details about other applications to
determine if those details should be withheld from callers
that do not otherwise have visibility of them.

Bug: 145916881
Test: atest AppEnumerationTests
Change-Id: I2dfba1169bce3d9fa88a75c92a22f53e1efe01b5
2021-09-10 16:02:05 +08:00
Winson Chiu
d433d2cd9a Merge "Revert "Open up AndroidPackage as @SystemApi"" 2021-09-09 23:29:51 +00:00
Winson Chiu
750ce30b84 Revert "Open up AndroidPackage as @SystemApi"
This reverts commit b013a475eb.

Reason for revert: b/199246839, breaks some builds

Change-Id: If71cb271c6f4bb32f3cc9b31822fa0b9dbab7c37
2021-09-09 21:01:38 +00:00
Fabian Kozynski
d53d2d0d23 Merge "Add API for requesting add TileService" 2021-09-09 17:35:26 +00:00
TreeHugger Robot
31142f4918 Merge "Open up AndroidPackage as @SystemApi" 2021-09-07 15:07:07 +00:00
Jacob Hobbie
eb393dca7b Merge "Adding support for FLAG_EXPORTED and FLAG_NOT_EXPORTED to registerReceiverAsUser and registerReceiverForAllUsers" 2021-09-03 20:09:45 +00:00
Winson
b013a475eb Open up AndroidPackage as @SystemApi
Moves all the PackageInfo/ApplicationInfo values into core SDK side
interfaces which represent all the mirrored functionality.

Creates AndroidPackageApi, PackageState, and a new PackageUserState
interface that act as the actual exposed interfaces for consumers like
mainline.

To avoid taking the PackageManagerService lock, and to avoid mutability
issues, PackageSettings are shallowly copied into PackageState objects.
And class PackageUserState objects into interface PackageUserState.

Eventually PackageSetting/class PackageUserState should be migrated to
the corresponding interfaces.

Miscellaneous additional changes:
 - Removes PackageSetting#uidError, was never used
 - Removes PackageUserState#categoryHint, was a package level field
   without per-user difference, use PackageSetting#categoryHint instead
 - Add locking to class PackageUserState overlay paths so they can be
   copied for the new interface.

Bug: 173455397

Test: atest com.android.server.pm.ScanTests

Change-Id: Ib98c66a9b4d78d09151724eaf14c16074c3621c9
2021-09-02 10:39:04 -07:00
Jacob Hobbie
bd012f4109 Adding support for FLAG_EXPORTED and FLAG_NOT_EXPORTED to
registerReceiverAsUser and registerReceiverForAllUsers

Test: not needed, added an override method. Manually tested
Bug: 161145287
CTS-Coverage-Bug: 197772228
Change-Id: I2c8220c8d54b9ec5cb9481cef98735395db76e27
Topic: registerReceiverAsUser
2021-09-02 16:30:17 +00:00
Jackal Guo
3bf1dc6894 Merge changes I91a61b38,Ia7e4e035
* changes:
  Convert Integer/Float/Boolean to primitive types
  Using float instead of Float in ParsedActivity
2021-09-01 23:28:49 +00:00
Kevin Hufnagle
8b0445b2d5 docs: Fix links to narrative guides am: a1796499fe am: 5e59f40ed5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15738642

Change-Id: Ib96dd172c3f18ed5a3981f867e4ec8cdd0020942
2021-09-01 17:45:37 +00:00
Kevin Hufnagle
5e59f40ed5 docs: Fix links to narrative guides am: a1796499fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15738642

Change-Id: Ie4336eae2db46942e1112a6df65baaa7b68b3b20
2021-09-01 17:33:46 +00:00
TreeHugger Robot
c21f736077 Merge "Dismiss the suspend dialog if conditions have been modified." 2021-09-01 16:50:47 +00:00
Kevin Hufnagle
a1796499fe docs: Fix links to narrative guides
Cannot use both `{@docRoot}` and leading `/` when specifying URLs

Bug: 197663210
Change-Id: If6762b95a3d6991b4732684853d974a06da032bc
Test: make ds-docs
Exempt-from-Owner-Approval: Docs-only change
2021-09-01 15:43:02 +00:00
Fabian Kozynski
1b6920d2ea Add API for requesting add TileService
This CL adds the API to StatusBarManager, as well as the constants. It
also wires things into SystemUI so the API actually works as intended.

TODO:
  * Rate limit requests (b/197534249)

Fixes: 197207978
Test: manual using test app
Test: atest SystemUITests

Change-Id: I2a9d18535fde1d77e9d6792bd45002ce04b49dab
2021-09-01 15:25:40 +00:00
Lucas Silva
c0c0a0c60e Add new Intent category for hub mode.
We will use this new intent filter to determine which activities have opted-in to hub mode.


Test: locally on device`
Change-Id: I518763c7b43d60c7b90ea331895d2701ffd01139
Bug: 198325938
2021-08-31 21:14:33 +00:00
Varun Shah
25e73a8b9e Dismiss the suspend dialog if conditions have been modified.
Whenever suspension conditions change, if there is a user-visible
suspension-related dialog, dismiss it to ensure the user is never
looking at stale information.

Bug: 169137795
Test: atest SuspendPackagesBroadcastTest#sendPackagesSuspendModifiedForUser
Test: manual (steps below)
-enable EBS, tap on suspended app to see dialog
-enable Focus mode, ensure dialog is dismissed
-tap on suspended app again to see relevent dialog,
 disable Focus mode, ensure dialog is dismissed
-tap on suspended app again to see relevant dialog,
 disable EBS, ensure dialog is dismissed correctly
-can permute enable/disable steps to further verify

Change-Id: Ib1650f910f7441498424ab4bc92185ce432ac405
2021-08-30 15:34:53 -07:00
Jackal Guo
16e84e6193 Merge "Fail install if required split type is missing" 2021-08-30 08:34:52 +00:00
Jackal Guo
dfd7a656b5 Fail install if required split type is missing
An application can declare that it must be installed with a specific
split types using the manifest attribute "android:requiredSplitTypes".
Listing the required split types in this attribute, the application
can't be installed without these split types.

Bug: 189882156
Test: atest android.appsecurity.cts.SplitTests
Test: atest android.appsecurity.cts.IsolatedSplitsTests
Change-Id: Icf6cde57596fe0fdf9764ef0f1a3812da16ec5ff
2021-08-30 09:45:03 +08:00
Jackal Guo
ee5b44c889 Convert Integer/Float/Boolean to primitive types
In order to avoid unnecessary auto-boxing/unboxing, these fields to
primitive types in the parsed components.

Fix: 197579270
Test: atest -p core/java/android/content/pm \
        services/core/java/com/android/server/pm
Change-Id: I91a61b38ccbb7242f12859d1db298c3262254a63
2021-08-26 10:13:50 +08:00
Jackal Guo
026512d21d Using float instead of Float in ParsedActivity
In order to avoid auto-boxing/unboxing, replace Float object with
primitives float.

Fix: 188697840
Test: atest AspectRatioTests AspectRatioSdk25Tests
Test: atest AndroidPackageTest ParsedActivityTest
Change-Id: Ia7e4e035ed023b1387d03ed82d782fae69f2c3f8
2021-08-26 09:36:52 +08:00
Jackal Guo
b5663f10f2 Merge "Move CtsContentTestCases to group presubmit-large" 2021-08-25 23:21:35 +00:00
Aaron Labiaga
a956351633 Merge "Update locusID documentation to capture privacy around LocusId usage." 2021-08-25 16:50:14 +00:00
Jackal Guo
ccc91c4fa9 Move CtsContentTestCases to group presubmit-large
The test config takes longer than 900 seconds to run. Move it to a
dedicated group for running slow presubmit Test Mapping test.

Some more context is in the referenced bug, e.g, b/174495337
The group will work exactly the same as presubmit for now.

Bug: 174654670
Bug: 174495337
Test: treehugger
Change-Id: Id9769bbc625b42257af603d69098ae69c0fabb80
2021-08-25 16:47:25 +08:00
Aaron Labiaga
8f61cdadcd Update locusID documentation to capture privacy around LocusId usage.
Bug: 194374710
Test: n/a

Change-Id: I7e72e1394562788c31e2a6c86f43a028a3e85e0b
2021-08-25 02:56:28 +00:00
John Wu
b3e917360e Merge "Update Intent#resolveTypeIfNeeded() for intent filter matching" 2021-08-25 00:38:02 +00:00
John Wu
19da953ee1 Update Intent#resolveTypeIfNeeded() for intent filter matching
With the change ag/15315839, explicit intents also have to match the
declared intent filters. The existing implementation of
resolveTypeIfNeeded() assumes all explicit intents will always be
delivered and will skip resolving types for content:// uris. Update the
implementation to only skip resolution if the intent is bound to the
same app it was created, or the caller is either root or the system.

Bug: 196573010
Test: atest CtsContentTestCases:PackageManagerTest
Change-Id: Ic3b51c68fd971422242db42af35e13f691d65c07
2021-08-24 16:01:48 -07:00
Jacob Hobbie
50324497d0 Making runtime receivers safer by default
Bug: 161145287
Test: Manually verified receiver was not exported without the new flag
Change-Id: Ib36a7413e96433a07bbac0f38588547e079fba11
2021-08-23 20:59:52 -07:00
Treehugger Robot
4d019b5ca7 Merge "OverlayManager: use typed collection type in AIDL" am: 497e28ecf3 am: c1a5b99f86 am: 444b1e27b0 am: 51121c1e70 am: 7a885d18d5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1801774

Change-Id: Ib41e05a971afd678e7b98c4dcb070dc9d4c017be
2021-08-24 02:56:29 +00:00
Treehugger Robot
7a885d18d5 Merge "OverlayManager: use typed collection type in AIDL" am: 497e28ecf3 am: c1a5b99f86 am: 444b1e27b0 am: 51121c1e70
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1801774

Change-Id: I899a971e248d682bfe076f96b735f92be50d207f
2021-08-24 02:44:13 +00:00
Treehugger Robot
444b1e27b0 Merge "OverlayManager: use typed collection type in AIDL" am: 497e28ecf3 am: c1a5b99f86
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1801774

Change-Id: I73df9c8a2133c93b92e20d9357013f86023b93f6
2021-08-24 02:14:18 +00:00
Treehugger Robot
c1a5b99f86 Merge "OverlayManager: use typed collection type in AIDL" am: 497e28ecf3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1801774

Change-Id: I2c504229c8251d5429d9105a1a6f6dfedb788cb7
2021-08-24 02:03:04 +00:00
Cherie Cheung
3667b31ae9 UserInfo.isDemo() to also check UserInfo.FLAG_DEMO
With the refactoring in ag/9507174, UserInfo.FLAG_DEMO is
deprecated, but ARC demo mode is still relying on it. This is
a temporary fix to keep ARC demo mode working. A proper fix will
be put in by b/179010471.

Bug: 178460880
Bug: 179010471
Test: UserManager.isDemoUser() returns true during ARC demo session.
Apps show demo mode behaviors.

Change-Id: I825d3e6c0a799005982372baa3fea5fa16c99fd2
(cherry picked from commit b652b79cb36166092063ff9df82e404129f67f3c)
(cherry picked from commit 3a72c3ec0bbc0a1dc41a8187c37504f3db4c1da1)
2021-08-23 10:51:59 +00:00
John Wu
fcf473ba58 Merge "Introduce the sharedUserMaxSdkVersion attribute" 2021-08-20 19:38:42 +00:00
John Wu
5c65211ec0 Introduce the sharedUserMaxSdkVersion attribute
We need a mechanism to allow developers to opt-out of
shared UID without removing the android:sharedUserId
attribute to maintain compatibility with older Android
versions.

The developer can set the highest API level at which the
sharedUserId attribute will be recognized, analogous to
using maxSdkVersion in <uses-permission>.

Bug: 196261070
Test: build + flash + TH
Change-Id: I12d2bc0997d1291991b1289a7b0dda0d954f2bd2
2021-08-19 16:05:34 -07:00
Jooyung Han
8ed699e610 OverlayManager: use typed collection type in AIDL
Use Map<K,V> and List<V>.

Bug: 192615532
Test: m
Change-Id: I5ad7f67b4b08b646362a58214c3b62cd1ada28c0
2021-08-19 15:56:48 +09:00
Sumit Bhagwani
65ce8c0b09 Merge "Adding Intent Extra for subattribution." 2021-08-18 20:43:48 +00:00
Treehugger Robot
7e07876fb3 Merge "Update OWNERS for Intent* and Content*" am: 6e3ea69863 am: 82a84c8c8d am: affce2a5bc am: 765af3eda0 am: 206c8c9128
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1799046

Change-Id: Id4cea1627646941b8d467df921fdae0381c98844
2021-08-18 01:33:08 +00:00
Sumit Bhagwani
7943e9c7a2 Adding Intent Extra for subattribution.
Bug: 191048348

Test: CTS will follow
Change-Id: I513aca6d5a0b4f10eba3e30cde18966716dc1156
2021-08-18 01:01:12 +00:00
Treehugger Robot
206c8c9128 Merge "Update OWNERS for Intent* and Content*" am: 6e3ea69863 am: 82a84c8c8d am: affce2a5bc am: 765af3eda0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1799046

Change-Id: I4ce6e29aaec4e160174d6ef4d9979972abff5031
2021-08-18 00:02:25 +00:00
Treehugger Robot
affce2a5bc Merge "Update OWNERS for Intent* and Content*" am: 6e3ea69863 am: 82a84c8c8d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1799046

Change-Id: Ide71c74d49f328a634c890a9afd3dcfd25faf420
2021-08-17 23:43:57 +00:00
Treehugger Robot
82a84c8c8d Merge "Update OWNERS for Intent* and Content*" am: 6e3ea69863
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1799046

Change-Id: Icea95dd713a074ecad5e7fcf4ab001e6e780db47
2021-08-17 23:27:51 +00:00
TreeHugger Robot
cde9018509 Merge "Component Alias initial (rudimentary) prototype" 2021-08-17 21:54:56 +00:00
Makoto Onuki
ea8407635c Update OWNERS for Intent* and Content*
Test: Build
Change-Id: I2232342d3e68cc8e1eea14bfa999f32b15ba5789
2021-08-17 14:27:35 -07:00
Makoto Onuki
fc00792884 Component Alias initial (rudimentary) prototype
See go/component-alias-prototype-overview for what it does.

This is disabled by default. Enable it via device config.

Test: atest ComponentAliasTests
Bug: 196254758
Change-Id: I2d177f6a475d878abbde55c3642c09da99dfea30
2021-08-17 10:39:06 -07:00
Rhed Jao
a3fa61a198 Merge "Add multiple components support for component enabled setting updates" 2021-08-17 01:32:17 +00:00
Winson Chung
dfc6488457 Merge "Add logging for app drag and drop" into sc-v2-dev am: 2428a73a7f am: efd8d5a710
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15537847

Change-Id: Id03e8fb834322bae299d1005d1809a6da0a929d3
2021-08-16 16:41:34 +00:00
Winson Chung
efd8d5a710 Merge "Add logging for app drag and drop" into sc-v2-dev am: 2428a73a7f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15537847

Change-Id: I4fd85899dac61cbc557e908dd89412e90b1e7072
2021-08-16 16:29:13 +00:00
Rhed Jao
db587c6e5d Add multiple components support for component enabled setting updates
This cl creates a new API setComponentsEnabledSetting in PackageManager.
It accepts a list of component changes that applies them all atomically
in order to improve performance and minimize the risk of errors for the
applications.

Bug: 189883959
Test: atest PackageManagerTest
Change-Id: I64d9f46198e26e001e79ca9c198c26929adf8596
2021-08-16 17:17:31 +08:00