Commit Graph

8126 Commits

Author SHA1 Message Date
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
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
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
Nikita Ioffe
ec67395d7d 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
2019-07-01 12:20:18 +01:00
Andrew Sapperstein
3fa7bd5c62 Merge "Allow granting URI permissions to com.android.settings.module_licenses." into qt-dev am: 9dd0c5628b am: f08f33b97b
am: d31df7f72e

Change-Id: I2a68d073c8c8b588fb87efa07e364aa735d98261
2019-06-28 11:07:13 -07:00
Andrew Sapperstein
f08f33b97b Merge "Allow granting URI permissions to com.android.settings.module_licenses." into qt-dev
am: 9dd0c5628b

Change-Id: Ia58094614151af83aadd36bb04e0389050dd05be
2019-06-28 10:28:00 -07:00
Nate Myren
d3a6385686 Permission flag updates now notify listeners
Added a version of the onPermissionUpdated and
onInstallPermissionUpdated methods which will notify
OnPermissionChangedListeners, and added this to the
PermissionManagerService "updatePermissionFlags" and
"updatePermissionFlagsForAllApps" methods. Also adds
OnPermissionsChangedListener to @TestApi

Fixes: 135937566
Test: atest PermissionUpdateListenerTest
Change-Id: I906598c366234c3daaa202261678bca04837cb13
2019-06-28 16:56:26 +00:00
Andrew Sapperstein
9dd0c5628b Merge "Allow granting URI permissions to com.android.settings.module_licenses." into qt-dev 2019-06-28 16:56:04 +00:00
Mathew Inwood
46f7f16a4d Merge "Restore some greylist entries." into qt-dev am: f76bdce6e0 am: 13ffa87a6d
am: 89f02cc81c

Change-Id: Ib5bc4e76d81ad69f7c3293e6cb72393e1aee7ed9
2019-06-28 09:36:40 -07:00
Mathew Inwood
13ffa87a6d Merge "Restore some greylist entries." into qt-dev
am: f76bdce6e0

Change-Id: I320e33be57b8124ff7c132a67c8981d53802f8f5
2019-06-28 07:43:43 -07:00
TreeHugger Robot
bcc1a887ba Merge "Use "commit" for rollbacks instead of "execute"." 2019-06-28 14:14:43 +00:00
Richard Uhler
f498dabccc Use "commit" for rollbacks instead of "execute".
Fix a couple lingering references to "executing" rollbacks. We've long
since switched to the terminology "commit", to highlight that a staged
rollback that has been committed will not take effect until the device
reboots.

Fixes: 136044234
Test: atest RollbackTest
Change-Id: Ic364778c253ff59af8206824a66df72569ab1307
2019-06-28 10:30:10 +00:00
Mathew Inwood
3a75f264a8 Restore some greylist entries.
In Q, these APIs were either:
- removed from the greylist entirely without good reason
- Moved to the restricted greylist without any public alternative
  information added

So they are being moved back to the greylist for Q.

Test: Treehugger
Bug: 136102585
Change-Id: I5ac8b8b9b23c3789d80239cf456072cc7dfa1203
2019-06-28 10:15:37 +01:00
Richard Uhler
798b859b2b Add TestApi to block the RollbackManagerHandlerThread.
To eliminate flakiness when testing timeout conditions for
RollbackTest.testEnableRollbackTimeoutFailsRollback.

Test: atest RollbackTest.testEnableRollbackTimeoutFailsRollback in a loop
Bug: 134373106
Change-Id: I01f3e769711ffa51fa714ff4bc81e70887f427ad
2019-06-26 10:51:23 +01:00
Andrew Sapperstein
93f5ed6c18 Allow granting URI permissions to com.android.settings.module_licenses.
Exempts this new ContentProvider for providing mainline module licenses.

Also sets ApplicationInfo.publicSourceDir for APEXes.

Bug: 135183006
Test: open module licenses, click app, verify file opens
Change-Id: Iec4f1de198525f7cd176a52d8448a2c71b6aabc0
2019-06-24 18:24:52 -07:00