Commit Graph

8140 Commits

Author SHA1 Message Date
Varun Shah
10909fd386 Merge "Add OnSharedPreferencesClearListener for Editor#clear." 2019-07-20 10:51:01 +00:00
Eric Jeong
e7ead1ba88 Add isHeadlessSystemUserMode() to UserManager
- isHeadlessSystemUserMode() returns whether the device is running with
headless system user (go/multi-user-headless-user0)
- RoSystemProperties.MULTIUSER_HEADLESS_SYSTEM_USER is replaced by
isHeadlessSystemUserMode()

Bug: 137755681
Test: Bluetooth service and Network policy manager should work fine with
headless system user. A profile user should be created with headless
system user.

Change-Id: Ic48d98426f7a5ea47dde2008ae51f78855f622e6
2019-07-19 15:10:04 -07:00
Shafik Nassar
963c5337c8 Merge "Make setRequestDowngrade @TestApi" 2019-07-19 08:42:32 +00:00
Mohammad Samiul Islam
8df6f16038 Merge "Add .apex suffix to apex files during validation" 2019-07-18 13:09:11 +00:00
TreeHugger Robot
c3edd4a600 Merge changes from topic "providers"
* changes:
  Move few remaining permission methods
  Move providers to permission manager
2019-07-18 01:06:34 +00:00
Eric Jeong
6c8693e5dc Merge "Add condition to check if a user can have profile user" 2019-07-18 00:21:47 +00:00
Todd Kennedy
c5b0e860a4 Move few remaining permission methods
This should be the last method movement. More work needs to
happen with the intenral APIs between the permission manager
and the package manager. There is still a lot of package
manager internal logic inside the permission manager.

Bug: 135279435
Test: atest PermissionUpdateListenerTest
Test: atest android.content.pm.cts.PackageManagerTest
Test: atest android.permission2.cts.RestrictedPermissionsTest
Change-Id: Iec118d198cb4ce3c4789991ddbdd2928dbc4bf6f
2019-07-17 15:29:42 -07:00
TreeHugger Robot
89a82157ab Merge "Remove @Deprecated && @removed method in ClipData." 2019-07-17 20:18:16 +00:00
Eric Jeong
da1aa8f747 Add condition to check if a user can have profile user
- In Auto, headless system user is used, instead of split system user.
- When a profile user is being created based on a normal user, the normal
user should not be a system user if headless system user is enabled.
- We could consider defining isHeadlessSystemUser in UserManager.

Bug: 137195727
Test: Creating profile user in Android Auto should work in hawk_md
environment.

Change-Id: I47192d8f92320296d4220ded285a36b376e6d971
2019-07-17 16:55:55 +00:00
Mathew Inwood
085b1a5c44 Merge "Compatibility API implementation for app processes." 2019-07-17 14:07:41 +00:00
Jeongik Cha
168267660f Merge changes from topic "system_ext"
* changes:
  Consider overlay in system_ext as system's
  Support /system_ext partition
2019-07-17 10:24:58 +00:00
Todd Kennedy
583378df9c Move providers to permission manager
Bug: 135279435
Test: atest PermissionUpdateListenerTest
Test: atest android.content.pm.cts.PackageManagerTest
Test: atest android.permission2.cts.RestrictedPermissionsTest
Test: atest TeleServiceTests
Test: atest DataConnectionTest
Change-Id: Ife563589929b2662c60e1a0ab0ec8f6a2d7e4c12
2019-07-16 13:09:33 -07:00
Jeff Sharkey
ee50d80842 Merge "Detailed ContentProvider permissions checks." 2019-07-16 15:03:32 +00:00
Mathew Inwood
80652db77e Compatibility API implementation for app processes.
Pass the set of disabled changes from the system server into the app in the
bindApplication() call. Use this to instantiate an implementation of
Compatibility.Callbacks() to implement the API.

Test: Manual.
Bug: 135010838
Change-Id: I2fcf25264c62acc801f9e62967072cd04e4641e7
2019-07-16 11:58:49 +01:00
Brad Ebinger
55f7a2c065 Merge "Make RcsMessageStore a top level API" am: bac258f22e am: 53f6c34039 am: 36cc070c24
am: 545a4c369e

Change-Id: I8588b6035f16ed52da6b5e61675a266998e748a1
2019-07-12 15:33:27 -07:00
Brad Ebinger
36cc070c24 Merge "Make RcsMessageStore a top level API" am: bac258f22e
am: 53f6c34039

Change-Id: Id6eba925aef3a1af812039372bf5e2e87fcbb35e
2019-07-12 15:01:58 -07:00
Brad Ebinger
53f6c34039 Merge "Make RcsMessageStore a top level API"
am: bac258f22e

Change-Id: If235ead8a75dc080e1e129d83bf7f24c3c996d8c
2019-07-12 14:53:26 -07:00
Brad Ebinger
bac258f22e Merge "Make RcsMessageStore a top level API" 2019-07-12 21:40:40 +00:00
TreeHugger Robot
ad98910522 Merge "Check resource type, not directory for colors" 2019-07-12 20:45:54 +00:00
Jeff Sharkey
9edef25ede Detailed ContentProvider permissions checks.
The new MediaProvider design has an internal dynamic security model
based on the value stored in OWNER_PACKAGE_NAME, so the OS always
needs to consult the provider when resolving Uri permission grants.

Blocking calls from the system process like this are typically
discouraged, but this is the best we can do with the limited time
left, and there is existing precident with getType().

For now, use "forceUriPermissions" as a proxy for determining when
we need to consult the provider directly.

Bug: 115619667
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Change-Id: I1d54feeec93fbb4cf5ff55240ef4eae3a35ed068
2019-07-12 09:27:41 -06:00
Mohammad Samiul Islam
ad7e270673 Add .apex suffix to apex files during validation
Previously, the apex file being installed was moved into the staging
directory as same name provided during installation, due to which, when
the source apex file of installation did not have .apex suffix in its
file name, it failed validation in apexd. Now, if an apex file does not
have proper suffix, it will be concatenated during validation in
PackageInstallerSession.

Bug: 124837227
Test: atest CtsStagedInstallHostTestCases
Test: atest StagedInstallTest#testInstallStagedApexWithoutApexSuffix
Change-Id: Ice41f601dc42736ca0cdf2bad0817f0c00f50648
2019-07-12 11:46:34 +01:00
Brad Ebinger
0e93d73053 Add CAPABILITY_EMERGENCY_PREFERRED in PhoneAccount
Allow Telephony to mark a SIM PhoneAccount as
emergency preferred, meaning that Telecom will
override a user's PhoneAccount preference for
emergency calls if the PhoneAccount has the
CAPABILITY_EMERGENCY_PREFERRED capability.

Bug: 131203278
Test: Manual testing, Telecom/Telephony unit testing
Merged-In: If70d917cfb3d825f375d282012b8788d69a2f144
Change-Id: I88b8bbfa444f5445b2f0d6a1542c6406a19b240f
2019-07-11 17:55:37 -07:00
Todd Kennedy
c971a45e65 Move grant/revoke permission APIs
These were the last few APIs that used the permission callback.
Completely remove it from the package manager and full implement
in the permission manager.

Bug: 135279435
Test: atest PermissionUpdateListenerTest
Test: android.content.pm.cts.PackageManagerTest
Test: android.permission2.cts.RestrictedPermissionsTest
Change-Id: Iab7c20215c907f4718f78a98fb96afec9fef6780
2019-07-11 14:14:02 -07:00
Todd Kennedy
7e3dd3afe2 Move whitelist permissions to permission manager
Also while doing this, it made sense to move the permission change
listener to the permission manager [it resulted in fewer hacks to
get the two sides to talk to one another].

Bug: 135279435
Test: atest PermissionUpdateListenerTest
Test: android.content.pm.cts.PackageManagerTest
Test: android.permission2.cts.RestrictedPermissionsTest
Change-Id: Ie08701dfe999cd435335103f4b4daeaa0b31ef10
2019-07-11 14:14:02 -07:00
Todd Kennedy
ca1ea17a3e Move check permission methods
Bug: 135279435
Test: atest android.content.pm.PackageManagerTests
Test: atest CtsCameraApi25TestCases
Change-Id: Id96093e4106edcd5302fd8aaa020d1ab83f68258
2019-07-11 14:14:02 -07:00
Todd Kennedy
230c0a7e60 Move permission flag methods
Bug: 135279435
Test: atest android.content.pm.cts.PackageManagerTest
Test: atest android.permission2.cts.RestrictedPermissionsTest
Change-Id: I3a5a7d8d3a3ba9d0b3e0e62d178a18903a94ec26
2019-07-11 14:13:53 -07:00
Nate Myren
1a8d1110c0 Merge "Permission flag updates now notify listeners" 2019-07-10 16:03:07 +00:00
Mathew Inwood
2be379300d Merge "Add trackingBug to API used by chromium vebview." am: c25ad64386 am: 53507c3423 am: 737a7a0e4f
am: b6bb42b7b8

Change-Id: Idf261a366b38172a61649c0e72a51f99e6443840
2019-07-10 07:01:36 -07:00
Mathew Inwood
737a7a0e4f Merge "Add trackingBug to API used by chromium vebview." am: c25ad64386
am: 53507c3423

Change-Id: Iaa8be1cd02acfb8b271179aba0a2ceef2cd87e56
2019-07-10 06:39:08 -07:00
Mathew Inwood
53507c3423 Merge "Add trackingBug to API used by chromium vebview."
am: c25ad64386

Change-Id: I45a07ef1d02e4c18dc63bc3333bb0fcf40aa9da5
2019-07-10 06:27:13 -07:00
Treehugger Robot
c25ad64386 Merge "Add trackingBug to API used by chromium vebview." 2019-07-10 12:59:59 +00:00
TreeHugger Robot
b5f6854778 Merge "Fix potential double destroy of AssetManager" 2019-07-10 04:56:18 +00:00
TreeHugger Robot
f59b0456ef Merge "Re-hide ApplicationInfo.volumeUuid." 2019-07-10 01:38:30 +00:00
Ashley Rose
43f7c8ee54 Check resource type, not directory for colors
Previously, Resources#getDrawable() would fail when trying to load a
ColorStateListDrawable from a ColorStateList defined in a resources
directory with a qualifier.

Bug: 137141830
Test: atest android.content.res.cts.ResourcesTest
Change-Id: I2ad57dd7cfa30de64653805d4ea209388ff90f41
2019-07-09 20:14:17 -04:00
Jeongik Cha
9ec059ac1d Support /system_ext partition
This commit is mainly from I7a6a30bf8e8db9f2738594d187bb9148f138b8da, so
test cases and features are mostly same.

We change product_services partition name to "system_ext" because this
partition's purpose changes.

 - installing a RRO package for framework from /system_ext/overlay
 - installing apps from /system_ext/app
 - installing priv-apps from /system_ext/priv-app
 - installing permissions from
   /system_ext/etc/[default-permissions|permissions|sysconfig]

Bug: 134359158
Test: `mma` under frameworks/base/tests/[libs|privapp]-permissions
      adb sync && adb reboot
      adb shell cmd package list libraries
        => confirmed com.android.test.libs.system_ext library
      adb shell cmd package dump \
        com.android.framework.permission.privapp.tests.system_ext
        => confirmed that the package is a priv-app

Change-Id: Ibbccbba64156a7bc464ffb3785fb8fe69ebb973c
2019-07-09 23:55:37 +09:00
Nikita Ioffe
0ad641f9f6 Merge "Rename ApexInfo.package{Name,Path} to module{Name,Path}" into stage-aosp-master
am: 6a36ad8b7e

Change-Id: Idabee06e646addd278b0f47224da9a6401a81036
2019-07-04 08:48:49 -07:00
Nikita Ioffe
f585ed0459 Use ApexInfo.moduleName
See another CL in the topic

Bug: 132428457
Test: builds
Change-Id: I87ba3fb539d0761c515adc8e2d2acc8dfc5e6a9a
Merged-In: If0bd3d368c7373ab0028211a8a4246a9821893af
2019-07-04 15:46:08 +00:00
Mathew Inwood
7bcc174a0e Add trackingBug to API used by chromium vebview.
Bug: 136728678
Test: m
Change-Id: Ia7ff4b258ac24d6ebd165be3f294fc1500cc7fb6
2019-07-04 11:42:48 +01:00
Riddle Hsu
cfa2284cd8 Fix potential double destroy of AssetManager
Assume there is a XmlBlock [X] created by a AssetManager [A]
([A] will have mNumRefs = 2). After [A].close is called
(mNumRefs = 1) and then both [X] and [A] are going to be GCed,
if [A].finalize is called first (nativeDestroy), the later
[X].finalize will invoke [A].xmlBlockGone that triggers the
second nativeDestroy of [A] and leads to crash.

By clearing the mObject in AssetManager.finalize, the
decRefsLocked from other paths won't call nativeDestroy again.

Bug: 136721562
Test: atest AssetManagerTest
Test: Build and install CorePerfTests
      adb shell am instrument -w -r --no-hidden-api-checks -e class \
      android.app.ResourcesPerfTest#getLayoutAndTravese,android.graphics.perftests.RenderNodePerfTest \
      com.android.perftests.core/androidx.test.runner.AndroidJUnitRunner

Change-Id: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
2019-07-04 16:10:08 +08:00
TreeHugger Robot
f10a78ceaf Merge changes from topic "perm_query"
* changes:
  Move add/remove permission
  Move permission info queries
2019-07-03 19:46:44 +00:00
Todd Kennedy
6ffc5a6eee Move add/remove permission
Bug: 135279435
Test: atest android.content.pm.cts.PackageManagerTest
Change-Id: I40a6d592031483a6dfe61906f6fa011c91910328
2019-07-03 10:14:19 -07:00
Todd Kennedy
1d29b4af0b Move permission info queries
Now begins the parade of methods that can be migrated to the
permission manager service and be removed from the package
manager service.

We will still need to maintain some sub-set of APIs in the
package manager service due to unsupported app usage. When
we finally no longer support these AIDL methods, they can
be removed from package manager service.

Bug: 135279435
Test: Manual. Builds and runs
Change-Id: If12609ffdaeb75445d3ec9bcc7f946b8829ba769
2019-07-03 10:14:09 -07:00
Nikita Ioffe
b4eee2a17d Rename ApexInfo.package{Name,Path} to module{Name,Path}
This should resolve the confusion between internal name of APEXes that
comes from apex_manifest.json and packageName that comes from
AndroidManifest.xml.

Follow-up CLs:
* Rename package to module for all apexservice binder APIs.
* Rename package to module in apexd codebase.

Test: atest apexservice_test
Test: atest CtsStagedInstallHostTestCases
Bug: 132428457
Change-Id: If0bd3d368c7373ab0028211a8a4246a9821893af
Merged-In: If0bd3d368c7373ab0028211a8a4246a9821893af
(cherry picked from commit ec67395d7d)
2019-07-03 14:27:01 +01:00
TreeHugger Robot
9e63c33f9e Merge "Create permission manager AIDL" 2019-07-02 23:26:07 +00:00
Dmitry Dementyev
35355827e5 Merge "Revert "Do not load xml metadata for unchanged packages in RegisteredServicesCache"" into qt-dev am: 660c234e9a am: a51df29cf5
am: 0a5a744df7

Change-Id: Ic1386954d8c0be43525919e1ef0719dd5cc7c85c
2019-07-02 14:25:55 -07:00
Todd Kennedy
8f135982a8 Create permission manager AIDL
Today, the package manager largely routes any permission related
method to the PermissionManagerService. But, PermissionManagerService
is a service in name only. Instead, we will make the
PermissionManagerService a real service and direct API calls directly
to it.

We will likely need to maintain all of the public permission APIs
that already exist on PackageManager. However, the public -> private
implementation will go directly to PermissionManagerService.

Bug: 135279435
Test: Manual. Device boots
Change-Id: Ia4992ba6d1f4b9050db98c7d7647d51a5d45fcbe
2019-07-02 13:17:05 -07:00
Dmitry Dementyev
0a5a744df7 Merge "Revert "Do not load xml metadata for unchanged packages in RegisteredServicesCache"" into qt-dev am: 660c234e9a
am: a51df29cf5

Change-Id: Iabaa05958523390aa6cba6c2da33411f3d621e7f
2019-07-02 12:39:45 -07:00
Dmitry Dementyev
45e4f2e836 Merge "Revert "Do not load xml metadata for unchanged packages in RegisteredServicesCache"" into qt-dev
am: 660c234e9a

Change-Id: I466b3e4a3631614064be6aed38f1e74fde48544a
2019-07-02 12:29:39 -07:00
Dmitry Dementyev
40431ae1bc Revert "Do not load xml metadata for unchanged packages in RegisteredServicesCache"
This reverts commit 8094880025.

Reason for revert: changed services order
Test: manual
Bug: 136261465

Change-Id: I2f78f0dbbace212309b87f779efad020cf255196
2019-07-02 03:59:17 +00:00
shafik
ce3889323a Make setRequestDowngrade @TestApi
Test: build
Bug: 134653708
Change-Id: Idf99e0810e2e9040f49f06a00722567ac15bbe18
2019-07-01 20:28:25 +01:00