Commit Graph

9309 Commits

Author SHA1 Message Date
Dmitri Plotnikov
28db144f87 Merge "Propagate exception thrown by ContentProvider.canonicalize" into rvc-dev am: f7b0b5a373 am: 59e9279749 am: 571716c3e3 am: 7d21a21b23
Change-Id: I33dad7364541f20c7e830dfa05f706df8456b1ac
2020-03-26 23:56:29 +00:00
Dmitri Plotnikov
f7b0b5a373 Merge "Propagate exception thrown by ContentProvider.canonicalize" into rvc-dev 2020-03-26 23:03:31 +00:00
Todd Kennedy
96644cf155 Merge "Define permission for installer API v2" into rvc-dev am: fb590035e1 am: 1e83e7a905 am: 523d6f4e27 am: 50fe08d6a7
Change-Id: I436f73820be65eb0c4c6d30bb0c055ef56ff91b4
2020-03-26 22:47:58 +00:00
Todd Kennedy
fb590035e1 Merge "Define permission for installer API v2" into rvc-dev 2020-03-26 21:50:17 +00:00
Daniel Colascione
278a867396 Merge "Autocork package invalidations" 2020-03-26 20:21:12 +00:00
Alex Kershaw
2b86df4979 Merge "Add hidden API to clear all cross-profile app-ops" into rvc-dev am: 59da30ff38 am: df42fbc034 am: eede878abc am: 5d2dc20861
Change-Id: I5bbfcbf4b262d3bc345f8ed87d3a09b69b84e698
2020-03-26 12:05:56 +00:00
Dmitri Plotnikov
da4f3c8353 Propagate exception thrown by ContentProvider.canonicalize
Test: atest FrameworksCoreTests:android.content.ContentResolverTest
Fixes: 149184281
Change-Id: Id200748c9d54222aaf669209a43cbaa5675d8331
2020-03-25 18:34:11 -07:00
TreeHugger Robot
c7079b4f67 Merge "Support multiple requiredSystemProperty in overlay" 2020-03-26 01:28:36 +00:00
Todd Kennedy
66ed8dff37 Define permission for installer API v2
The package installer v2 APIs were marked as @SystemApi merely as
a convenience for development. These APIs may change in the next
version of Android and their usage must be strictly controlled.

Bug: 151716357
Test: Manual. Use old Shell and see that incremental installation fails with a SecurityException
Test: Manual. Request INSTALLER_V2 permission for shell and see that incremental installation succeeds
Change-Id: I9612dc145eadda20083bcc43e7a35ef3cd90aa40
2020-03-25 12:57:05 -07:00
Alex Kershaw
ec19b8d075 Add hidden API to clear all cross-profile app-ops
Reset the INTERACT_ACROSS_PROFILES app-op for all apps on the device
when creating a new work profile. This ensures that user grants for
previous work profiles (perhaps with a different admin) are not saved
and also not restored with backup-and-restore.

Also, clear the shared preference storing which oem-whitelisted apps the
user has granted. This ensures that the user sees them all again
during work profile provisioning.

Fixes: 151145623
Test: atest com.android.managedprovisioning.task.CreateManagedProfileTaskRoboTest
Change-Id: I5f5c5aea1c36bd17a74c02e1b6fa9b4047f15003
2020-03-25 18:21:19 +00:00
Dmitri Plotnikov
90dbbdcdb4 Merge "Propagate exception thrown by ContentProvider.getType" into rvc-dev am: f903ef10e5 am: 84a2bbf8b9 am: 15ff963c63 am: 4dacc75262
Change-Id: I320c81243d3bdf0fdc04b2c5a06342fb2293c0d6
2020-03-25 18:19:14 +00:00
Automerger Merge Worker
3c484a8451 Merge "Merge "Switch auto-revoke manifest flag to a tri-state" into rvc-dev am: 2f54a864d5 am: 1bfe8d5609" into rvc-d1-dev-plus-aosp am: 9659bb9b3b am: 6f4d36e95b
Change-Id: I376428be9e49e6ea5cb316eab6887bb5227954a1
2020-03-25 18:18:41 +00:00
Dmitri Plotnikov
f903ef10e5 Merge "Propagate exception thrown by ContentProvider.getType" into rvc-dev 2020-03-25 17:24:31 +00:00
Eugene Susla
2f54a864d5 Merge "Switch auto-revoke manifest flag to a tri-state" into rvc-dev 2020-03-25 17:03:32 +00:00
Automerger Merge Worker
f70851c505 Merge "Merge "PackageManager: Restrict some camera intents to MATCH_SYSTEM_ONLY" into rvc-dev am: 9bbdb759d8" into rvc-dev-plus-aosp am: 55eec9a5b2 am: 2ef42bddeb am: 26d15c6efd
Change-Id: I810839ee443c33a64126120add9543aed999cefa
2020-03-25 09:11:51 +00:00
TreeHugger Robot
9bbdb759d8 Merge "PackageManager: Restrict some camera intents to MATCH_SYSTEM_ONLY" into rvc-dev 2020-03-25 08:34:12 +00:00
Jeongik Cha
5e6a87013f Support multiple requiredSystemProperty in overlay
As-is: Only one requiredSystemProperty is allowed
To-be: It supports several requiredSystemProperty

Here is format for multiple fields.
  android:requiredSystemPropertyName="rw.num,rw.char"
  android:requiredSystemPropertyValue="1,a"

Test: m
Test: Make two overlay with different condition
      Check if it works properly depending on condition
      If there is no overlay package matching the condition, both aren't
      applied

Bug: 137628879
Change-Id: I4c8c4a1304dc52d6568767d90e3dcbf6acef024a
2020-03-25 11:08:36 +09:00
Dmitri Plotnikov
be61c4468c Propagate exception thrown by ContentProvider.getType
Test: atest FrameworksCoreTests:android.content.ContentResolverTest
Fixes: 149184281
Change-Id: If3c33e58b1d0f3b88148eb3d2085c9d23cf12fc2
2020-03-24 15:49:15 -07:00
Eugene Susla
49b84c3495 Switch auto-revoke manifest flag to a tri-state
Test: presubmit
Bug: 146513245
Change-Id: I179f91d10d1de7f2907cebe3e2bc0cfb0ab2300d
2020-03-24 11:54:01 -07:00
Automerger Merge Worker
9c7eec251f Merge "Merge "Suspend newly installed apps when personal apps are suspended" into rvc-dev am: 70b1c45a9e am: 82625f9d7f" into rvc-d1-dev-plus-aosp am: e91cb68a3c am: 848e1dcbbb
Change-Id: I7eec0e3a397ab8d9b2bd431905e1e3e31ac0e19d
2020-03-24 18:14:27 +00:00
Pavel Grafov
70b1c45a9e Merge "Suspend newly installed apps when personal apps are suspended" into rvc-dev 2020-03-24 17:42:11 +00:00
TreeHugger Robot
6c1153ac24 Merge "Add new hidden API in CrossProfileApps and other minor changes" into rvc-dev am: 59fc7d573e am: 7b1edf2818 am: da62ecbf7e am: 7e437fef61
Change-Id: Id6c7426f875004d73d4474c8070fca94436c3635
2020-03-24 14:46:20 +00:00
Pavel Grafov
97bb33b93c Suspend newly installed apps when personal apps are suspended
Also make use of PackageManager.getUnsuspendablePackages() which
already takes care of launcher and dialer packages and some
other critical apps, like package verifier, package
[un-]installer, etc.

For newly installed packages it PackageManager.getUnsuspendableApps()
seems to be sufficient since that app won't be critical for the
functioning of the device.

Test: Test: atest
    OrgOwnedProfileOwnerTest#testPersonalAppsSuspensionInstalledApp
Bug: 149394138
Change-Id: Ic3196dbfdd5c506e708563d305a42494391dc878
2020-03-24 12:28:07 +00:00
Narayan Kamath
83084f25f7 PackageManager: Restrict some camera intents to MATCH_SYSTEM_ONLY
These intents permit the handler to write camera / video images
directly to a supplied FD or Uri, and can be used to circumvent
EXIF redaction and may leak location info. Therefore, they are
restricted to pre-installed apps only, which can be CTS tested

Test: atest AvailableIntentsTest
Bug: 117223876
Change-Id: If0a77d0b8a6747da30803681cb1b813aee476b2b
2020-03-23 19:48:47 +00:00
kholoud mohamed
2459a08f86 Add new hidden API in CrossProfileApps and other minor changes
* Added a new hidden API canUserAttemptToConfigureInteractAcrossProfiles
to be used in settings.
* Changed canRequestToInteractAcrossProfiles to return true when app is
not whitelisted by the admin or installed in the other profile, this
enables the app to navigate the user to the cross profile settings page
were more information about why they can't grant the permission will be
provided.

Bug: 149742043
Test: atest CrossProfileAppsServiceImplRoboTest
Test: atest CrossProfileAppsPermissionHostSideTest
Test: CrossProfileAppsTest
Change-Id: I9c7734d7ab0c7436d84a27604146ff539e1cb26a
2020-03-23 17:23:17 +00:00
Automerger Merge Worker
5a0e3a7955 Merge "Merge "Remove Context.NETWORK_POLICY_SERVICE from @SystemApi" into rvc-dev am: 9f48409dd1 am: fa5baf3550" into rvc-d1-dev-plus-aosp am: e554dfc3f9 am: fe2c32bf62
Change-Id: I1bb8aa47db85591d80829f58366a66b098f426d9
2020-03-23 11:03:36 +00:00
Aaron Huang
cd44942a14 Remove Context.NETWORK_POLICY_SERVICE from @SystemApi
Hide Context.NETWORK_POLICY_SERVICE as it has no usage.

Bug: 151266974
Test: make checkapi, build
Change-Id: I0586a5ef22f76fa1407219b96cb246f162f02947
2020-03-23 15:15:40 +08:00
JW Wang
ad95ea97ef Merge changes Ied68ad03,I83e1cfed
* changes:
  Don't reference RollbackManagerService directly (2/n)
  Move service registration code into a System API (1/n)
2020-03-23 06:11:36 +00:00
Remi NGUYEN VAN
b699dbe7e6 Merge "Fix javadoc for Context.TETHERING_SERVICE" into rvc-dev am: 1f0355a1cd am: 1844189950 am: 259539fe82 am: ac59f9ebfa
Change-Id: Ifefa3f975fcab0e32d40f5ed8b6311f1850f5350
2020-03-23 02:41:15 +00:00
JW Wang
5ea50ff36f Move service registration code into a System API (1/n)
This is an effort to modularize RollbackManager.

AIDL interfaces (IRollbackManager in this case) can’t be used across
module boundaries. We need to add a wrapper around the service
registraction code to expose to SystemServiceRegistry.

The approach is the same as ag/9746851.

Bug: 150347230
Test: m
Change-Id: I83e1cfedf4b4f6bf796e8a4a0ea81d813390f622
2020-03-23 10:08:11 +08:00
Remi NGUYEN VAN
1f0355a1cd Merge "Fix javadoc for Context.TETHERING_SERVICE" into rvc-dev 2020-03-23 01:20:13 +00:00
TreeHugger Robot
d73afef082 Merge "Un-expose APIs added for telephony mainline." into rvc-dev am: 9a58d5747a am: 9c614e6fe6 am: cb0dc65b6d am: bcd1229948
Change-Id: Idb363dde8ef5b5f88d7b531bbc4f70a92c101c6d
2020-03-21 22:10:56 +00:00
TreeHugger Robot
9a58d5747a Merge "Un-expose APIs added for telephony mainline." into rvc-dev 2020-03-21 21:17:33 +00:00
Evan Severson
b81a3c4418 Merge "Add one-time flag to test api" into rvc-dev am: 4846c5e3a9 am: 80b953200c am: 4b09ca65ed am: 89f0088d25
Change-Id: I69be6e9077cb3dbfbe9516f3438bb4e2595224a3
2020-03-21 06:41:15 +00:00
Evan Severson
4846c5e3a9 Merge "Add one-time flag to test api" into rvc-dev 2020-03-21 05:44:34 +00:00
Daniel Colascione
4849c3a996 Autocork package invalidations
Bug: 140788621
Test: m; strace -s512 -f -p 1 2>&1 | grep 'cache_key'
Change-Id: Iceaabee5ea8eac42934c1cc4914cdf43d2f11f58
2020-03-20 17:26:07 -07:00
Amit Mahajan
4009110b3b Un-expose APIs added for telephony mainline.
Will be reworked on in R.

Test: basic sanity
Bug: 140908357
Change-Id: Ib18b66c9351b0434d7c46e004cd162928d7133f7
2020-03-21 00:21:48 +00:00
Evan Severson
1da1137fd1 Add one-time flag to test api
Test: Build
Fixes: 152076715
Change-Id: I63d327ff9df6075b4420db7df8ee2430fb7922ae
2020-03-20 15:16:54 -07:00
Taras Antoshchuk
2dd259b061 Merge "Change dynamic MIME feature accodring to API review" into rvc-dev am: 2ecaeeba03 am: 923deb5735 am: 92e9b389ca am: 52b51b73a8 am: fbd86a73cf
Change-Id: I81b4d0763f0755645f93edc20b4d6d8a2ba4416b
2020-03-20 21:43:58 +00:00
Jeff Sharkey
3943ce915d Merge "Add missing symmetrical ContentResolver method." into rvc-dev am: cb31e0486c am: 020c1e2525 am: 1cca7bd3ee am: 517ae1c487 am: 7d64a0f270
Change-Id: Id4a7c8ff0cee693fb48c4dc16dc6e32127ab8aca
2020-03-20 21:41:35 +00:00
Taras Antoshchuk
2ecaeeba03 Merge "Change dynamic MIME feature accodring to API review" into rvc-dev 2020-03-20 21:04:15 +00:00
Jeff Sharkey
cb31e0486c Merge "Add missing symmetrical ContentResolver method." into rvc-dev 2020-03-20 20:31:52 +00:00
Ryan Mitchell
15869daf9e Merge changes from topic "res_loader_dir" into rvc-dev am: b0544a733c am: c5f968d58b am: f0e186808a am: a857a184f8
Change-Id: I7ff89185051adb674b245082d0069768bc5bcc25
2020-03-20 18:44:14 +00:00
Ryan Mitchell
b0544a733c Merge changes from topic "res_loader_dir" into rvc-dev
* changes:
  Allow using loaders on non-RM Resources instances
  Move AssetsProvider to native layer
  Add ResourcesProvider.loadFromDirectory
  Refactor tests for ApkAsset loading APIs
  Refactor ApkAsset loading APIs
  Fix bugprone-use-after-move warnings
  Fix bugprone-use-after-move warnings
2020-03-20 18:16:30 +00:00
Taras Antoshchuk
8a6002477d Change dynamic MIME feature accodring to API review
Remove PackageManager#clearMimeGroup method. Add expected best
practices of the MIME group naming to Javadocs.
getMimeGroup/setMimeGroup throw in case of undefined MIME group.

Bug: 151101912
Test: atest CtsDynamicMimeHostTestCases
Change-Id: Ica468c77785cb0f9862b412a0bbc664f23e2f2d4
2020-03-20 17:07:56 +01:00
Jeff Sharkey
ce8a353b8b Add missing symmetrical ContentResolver method.
We have a new ContentProvider.checkUriPermission() method, but we
forgot to add the symmetric ContentResolver.checkUriPermission() to
the public API, and a first-party developer helped identify this
oversight.

Bug: 151165313
Test: atest CtsContentTestCases:android.content.cts.ContentResolverTest
Change-Id: Ic5496b5a6fda14c25cb3752f5af2f71564d003ba
2020-03-19 21:41:57 -06:00
Ryan Mitchell
39cacf2de7 Allow using loaders on non-RM Resources instances
Currently there is a limitation where ResourcesLoaders cannot be  used
on Resources object not created through ResourcesManager. This change
creates an update handler for Resources objects that are not registered
with ResourcesManager.

The handler changes the loaders on the asset manager owned by the
Resources instance.

Bug: 151666644
Test: atest ResourceLoaderValuesTest
Change-Id: I5a89f686386bdb088dc964014e7becc0c2b4770f
2020-03-19 18:33:55 -07:00
Ryan Mitchell
4ea1e42889 Move AssetsProvider to native layer
Querying in the native layer for assets provided through
AssetsProviders does not currently work. This change refactors the
AssetProvider API to return a file descriptor that is read in the
native layer and can bubble up to the java layer.

This change also removes the InputStream API to favor of developers
using memfd_create.

Bug: 142716192
Test: atest ResourceLoaderValuesTest
Change-Id: I1a7eca0994c3b7cc32008d9a72bf91086ff0e816
2020-03-19 18:33:55 -07:00
Ryan Mitchell
c07aa70270 Add ResourcesProvider.loadFromDirectory
This API allows a directory to be loaded as if it was a zipped APK.
This is a substitute for the DirectoryAssetProvider API that
currently does not work in the native layer.

Bug: 142716192
Test: atest FrameworksResourceLoaderTests
Change-Id: Ia13e15653e75b421423dd56f9fe89e183ab4cb9a
2020-03-19 18:33:55 -07:00
Ryan Mitchell
ef40d2e832 Refactor ApkAsset loading APIs
To add the partner requested ResourcesProvider#loadFromDir APIs, this
change adds format type integer that allows us to reduce the number of
ApkAssets loading overrides.

This change also adds hidden offset and length based ResourcesProvider
APIs that could not make R.

Bug: 142716192
Test: atest FrameworksResourceLoaderTests
Change-Id: I926fde257cae701901dcd4ca408024feae8c90a6
Merged-In: I926fde257cae701901dcd4ca408024feae8c90a6
2020-03-19 18:33:55 -07:00