Commit Graph

11265 Commits

Author SHA1 Message Date
Kevin Hufnagle
772014d2f9 Revert "docs: Revised descriptions of binding and connecting to services."
This reverts commit 34acbc9bf9.

Reason for revert: You must always call unbindService() after
bindService(), regardless of the return value for bindService();
see https://groups.google.com/a/google.com/g/android-chatty-eng/c/reDuVZl9Tcs/m/ux52rVvoAQAJ

Bug: 37092557

Test: m ds-docs-java

Change-Id: Ie4461b9a3b64ed3fb6f32e3cb71b57976e8da90f
2021-09-23 19:08:54 -04:00
Lucas Silva
9edc52c592 Merge "Add communal feature to PackageManager" 2021-09-23 14:22:01 +00:00
Lucas Silva
a8af8afe55 Add communal feature to PackageManager
Test: n/a
Change-Id: I83d71ebf67f93ceaed14f963680152c3f8979db7
Bug: 200289502
2021-09-22 23:39:58 +00:00
Rhed Jao
b62f02cb14 Fix an IllegalStateException in the OverlayConfigParser
The issue could be reproduced when the device defined an
overlay configuration file and an overlay package which
was in the configuration file also declared the required
system property in its manifest. The device works fine when
the required system property matches the corresponding
value on the device. But an IllegalStateException was thrown
from the system if it didn't match.

The root cause is that the package parser fails to parse the
overlay package if the required system property in the manifest
does not match the corresponding value on the device. It resulted
in the OverlayConfigParser could not find the package present
in the partition and throws the exception.

To resolve this issue, this CL skips the overlay configuration
if the package not found was caused by the system property
conditionon on the device.

Bug: 193422327
Test: atest OverlayConfigTest
Change-Id: I5650d796d92e3c4825b0d035e8e3b18f36d4cb47
2021-09-22 17:15:35 +08:00
TreeHugger Robot
b55e3de50a Merge "Add warning for a known issue in a newly added API" into sc-qpr1-dev am: 697c7a819c am: 6f246f6f01 am: 9118763b05
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15583141

Change-Id: I8e55154874d77c6789fb1d9644026ed2ee1afd4b
2021-09-20 12:45:41 +00:00
TreeHugger Robot
9118763b05 Merge "Add warning for a known issue in a newly added API" into sc-qpr1-dev am: 697c7a819c am: 6f246f6f01
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15583141

Change-Id: I1b193f3c7b51620b3c6b0c3ec0c36a3eb96b3e23
2021-09-20 06:43:17 +00:00
TreeHugger Robot
6f246f6f01 Merge "Add warning for a known issue in a newly added API" into sc-qpr1-dev am: 697c7a819c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15583141

Change-Id: I944cc601dc1b0eab325f75581a3ff4a2da019b0a
2021-09-20 06:29:31 +00:00
TreeHugger Robot
697c7a819c Merge "Add warning for a known issue in a newly added API" into sc-qpr1-dev 2021-09-20 06:28:17 +00:00
Hao Ke
e08ec5fa63 Merge "Replace untyped Parcel read/write" 2021-09-16 02:06:33 +00:00
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
Abhijeet Kaur
6fa7ca47ab Add warning for a known issue in a newly added API
checkUriPermissions is a new API added in Android S to check multiple
uri permissions via single API call.
However, checkUriPermissions is not working as intended for secondary
users. The root cause has been found and the fix is merged for later
releases.

Bug: 194700183
Test: atest --user-type secondary_user CtsScopedStorageDeviceOnlyTest:android.scopedstorage.cts.device.RedactUriDeviceTest#testSharedRedactedUri_openFileForRead
Change-Id: I72db7f0b4ddf97dce14880b6341799106d711c5c
2021-09-10 11:38:43 +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
Hao Ke
bc8416152b Replace untyped Parcel read/write
Description: Replaced `Parcel.readList()` call with empty classLoader.

Calling `Parcel.readList(,null)` could be dangerous as an attacker can
abuse the call to deserialize arbitrary parcelables. To avoid such an
attack vector, we should switch in using `Parcel.readTypedList()`
instead.

Test: atest CtsInstantAppTests
Test: atest CtsWindowManagerDeviceTestCases:MultiWindowTests
Test: atest RemoteTransitionTest
Test: Boot and observe systemUI works
Bug: 195622897
Change-Id: I7c8cb23f6f3d26b1d4d47696e70982797b5f0210
2021-09-09 15:56:03 +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
9e941b8630 docs: Fix links to narrative guides am: a1796499fe am: 675a14ea2b am: 5b73be6516
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15738642

Change-Id: Ie7be9a07c51458ec7c5b07cfe95c49bbaf837c80
2021-09-01 17:58:15 +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
Kevin Hufnagle
675a14ea2b docs: Fix links to narrative guides am: a1796499fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15738642

Change-Id: I41cdd3249c0d9ab80a314221dcc5af7ba51cc5ed
2021-09-01 17:33:44 +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
Rhed Jao
012450888d DO NOT MERGE Apply a maximum char count to the load label api am: baf1f463f0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15706234

Change-Id: If48eb277933a8f50810aaa8bcd06189ec1868f5f
2021-09-01 05:33:42 +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
Rhed Jao
baf1f463f0 DO NOT MERGE Apply a maximum char count to the load label api
The system is overwhelmed by an enormous label string returned by
the load label api. This cl truncates the label string if it exceeds
the maximum safe length.

Bug: 67013844
Test: atest PackageManagerTest
Change-Id: Ia4d768cc93a47cfb8b6f7c4b6dc73abd801809bd
2021-08-31 06:05:27 +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