Commit Graph

7202 Commits

Author SHA1 Message Date
Narayan Kamath
2c07da7945 Merge "Add ModuleInfo class" 2018-12-13 17:34:24 +00:00
Sahin Caliskan
a37ca569b0 Merge "Move RCS APIs to android.telephony.ims" 2018-12-13 16:30:20 +00:00
TreeHugger Robot
e64ba8b491 Merge "fragileUserData-apps might keep data on uninstall" 2018-12-13 06:24:34 +00:00
TreeHugger Robot
6d2b0fd462 Merge "Implement DELEGATION_PACKAGE_INSTALLATION" 2018-12-13 01:20:15 +00:00
TreeHugger Robot
4510b4444f Merge "Add system APIs to query intent components and application info." 2018-12-12 23:53:49 +00:00
Hai Zhang
8c7e93b1d0 Add system APIs to query intent components and application info.
This change adds the system APIs to query intent components and
application info, which is required for the Default apps UI in
permission controller to work for work profile.

Bug: 110557011
Test: build
Change-Id: I7e2d92f9ccae2e764a1ce0040a7f84bc4f21dbb5
2018-12-12 23:49:35 +00:00
Rubin Xu
fd4a3b441b Implement DELEGATION_PACKAGE_INSTALLATION
Previously a Device Owner or an affliated Profile Owner of the DO can silently
install APKs via PackageInstaller APIs. This CL additionally grants delegates
of DO the same access.

Bug: 112982695
Test: atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegation
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegation
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDelegation
Change-Id: I777ee6aa1ecd036ee56270fc6b4e86b74d1042a6
2018-12-12 23:22:59 +00:00
Philip P. Moltmann
ae4a4b987b fragileUserData-apps might keep data on uninstall
If an app declares that is has flagile user data, all the user to choose
to keep the app-data on uninstall.

Test: Unistalled apps that set the new flag and app that did not.
      Verified that the KEEP_DATA flag was set when checkbox was
      clicked.
Change-Id: I032fb21854352bbc175934ae5eb68a1430b1d403
Fixes: 117578306
2018-12-12 13:37:44 -08:00
Varun Shah
fcfb51fa4e Merge "Moved getWellbeingPackage() from SystemApi to TestApi." 2018-12-12 21:34:53 +00:00
Sahin Caliskan
84dd3061d9 Move RCS APIs to android.telephony.ims
This is due to being compatible with other RCS related changes by breadley@

Reviwed in aosp/840289, CP'ed here due to merge conflict.

Test: Existing tests pass

Bug: 109759350
Change-Id: Id56df22e9c313c5e0700eda3b2c489d2f84ea0cd
2018-12-12 16:05:06 +00:00
Dario Freni
ec06c25360 Merge "Add Mock APIs for staged installs." 2018-12-12 11:55:01 +00:00
Todd Kennedy
3dbf83a23d Add ModuleInfo class
The ModuleInfo class contains details about mainline modules. We're
not sure about what kind of information we'll need, so, creating
a placeholder structure and accessor methods that can be adjusted
later.

While the package manager does not know anything about what a "module"
is, we use the package manager as convenience to not creating a new
MainlineManager class.

Bug: 119220828
Test: Workspace still builds
Change-Id: I42cbc5e119652edd3eda155ddef861e3e0889479
2018-12-12 10:19:03 +00:00
Dario Freni
aac4ba4b24 Add Mock APIs for staged installs.
This CL just adds the isStaged setting on SessionParams, and if it is
set the session info are cached in a local variable. This allows
getStagedSession() (new APIs) to return the session information.

This should unblock upstream development while we implement the feature.

Test: adb install --staged, adb install-multi-package --staged. Wrote
small app to verify getStagedSessions returns correct info.
Bug: 118865310
Bug: 112669193
Bug: 120487127
Change-Id: I822be9e1737fe5cde6a6dd63621631cdef4f6fff
2018-12-12 01:20:04 +00:00
Jeff Sharkey
05ab573f4a Merge "Define protection level for document manager." 2018-12-11 20:53:47 +00:00
Jeff Sharkey
b867b4c49e Merge "Iteration on contributed media APIs." 2018-12-11 18:49:20 +00:00
Jeff Sharkey
dc50d4ca38 Iteration on contributed media APIs.
Offer an explicit DELETE_CONTRIBUTED_MEDIA flag that can be used when
uninstalling an app to indicate that any contributed media should be
deleted.

Adjust APIs to accept a specific UserHandle so we can pre-flight
check for valid UserManager state.

Bug: 116344240
Test: atest android.provider.cts.MediaStoreTest
Change-Id: Ief0ba27c913791d60f86a5d7252525c9c4539fc6
2018-12-11 09:43:13 -07:00
Jeff Sharkey
15707b3f4d Define protection level for document manager.
Similar to what we've done for services like the installer, verifier,
and text classifier, we're creating a new permission protection level
for the "document manager" on the device, called the "documenter" in
this change.

There should be exactly one "documenter" on the device, since it
handles the sensitive MANAGE_DOCUMENTS permission.

Bug: 117745631
Test: atest CtsPermission2TestCases
Test: atest android.permission.cts.ProviderPermissionTest
Change-Id: I92c9fcfee24feae8dc3a7516cde093e8f3bf0e56
2018-12-11 09:41:58 -07:00
Ivan Chiang
b6c167c16b Merge "Expose @Public for EXTRA_AUTO_LAUNCH_SINGLE_CHOICE" 2018-12-11 07:49:25 +00:00
Ben Lin
0ddbce0be5 Merge "Obtain dependency information from permissions files for SharedLibs." 2018-12-11 04:35:12 +00:00
Varun Shah
dad9b86571 Moved getWellbeingPackage() from SystemApi to TestApi.
Changed PackageManager#getWellbeingPackage from System to Test API since
the related GTS using the API is now being built against the test sdk.

Bug: 119330345
Test: atest com.google.android.wellbeing.permissionpolicy.gts.WellbeingPermissionPolicyTest
Change-Id: Id80f52a327f3faa292e7c647cac2b1fa0e03275f
2018-12-10 20:17:31 -08:00
TreeHugger Robot
708249b94d Merge "Expose @SystemApi and @Public for unbundling DocumentsUI" 2018-12-11 04:11:54 +00:00
Varun Shah
93d5e80341 Merge "Privileged apps can now launch their activities across profiles." 2018-12-11 02:04:16 +00:00
Ben Lin
71c16d714d Obtain dependency information from permissions files for SharedLibs.
Bug: 120096113
Test: Build with built-in libraries that declares new depedency flag, no
more boot errors (tested with cheets_x86_64 and crosshatch_userdebug)
Change-Id: I6b3e2ab7626ed8f04c0bf1a5b3c32204a2f2c56b
2018-12-10 16:31:09 -08:00
Varun Shah
f17440439e Merge "Added a new "wellbeing" protection flag." 2018-12-10 22:46:14 +00:00
Philip P. Moltmann
573095244b Merge "Move RuntimePermissionPresenter to android.permission" 2018-12-10 20:51:31 +00:00
Hui Yu
af4fcdcb91 Merge "Add manifest service attribute foregroundServiceType" 2018-12-10 18:59:49 +00:00
Ivan Chiang
fd3415c49a Expose @SystemApi and @Public for unbundling DocumentsUI
* Expose getCache and putCache to @Public. Filed a bug
  b/117636111 to implement the maximum bounds
* Expose getTypeDrawable to @SystemApi

Change-Id: I81ab2e2198d2da1a2fa1c327ed7f9f66cb999755
Fix: 117636111
Test: make
2018-12-10 13:59:25 +08:00
Jeff Sharkey
4ba6923975 Offer API to detect ContentProvider ANRs.
If a system component calls to a remote provider, and that provider
hangs, we end up burning that Binder thread until the remote process
is killed for some unrelated reason.

This change adds an API to detect these hangs, and kill the remote
process after a specific timeout, but only when the caller holds a
permission that lets them kill other apps.

Bug: 117635768
Test: atest android.content.cts.ContentResolverTest
Change-Id: I81b0d993d9d585cdeb5e2559c68052ba6cbbced9
2018-12-08 14:56:48 -07:00
Jeff Sharkey
e770d22dc9 Make DocumentsContract methods more general.
Accepting only ContentResolver arguments was quite limiting, so use
the newly created super-interface ContentInterface, which lets
callers use a ContentResolver, and ContentProviderClient, or even a
specific ContentProvider.

This is a safe API change, since we're accepting a more-general
argument, and existing API users can continue passing ContentResolver
to these methods.

Bug: 117635768
Test: atest DocumentsUITests
Test: atest android.appsecurity.cts.DocumentsTest
Change-Id: I8f0cd1335c9b763dd81eeb237fb0517e9073b625
2018-12-08 11:48:31 -07:00
Jeff Sharkey
633a13e2fa Extract common methods into ContentInterface.
Existing APIs that accept a ContentResolver are too restrictive when
the caller has their own ContentProviderClient already bound and
configured, so we're in the market for a solution to open those
existing APIs to accept a wider range of inputs.

The solution we've come up with is to introduce a super-interface
which contains the common ContentProvider APIs, and then make
ContentProvider, ContentResolver, and ContentProviderClient all
implement that interface for consistency.

After this change lands, we can then safely relax existing APIs to
accept this new ContentInterface, offering a clean path to solving
the problem outlined above.

Bug: 117635768
Test: atest android.content.cts
Test: atest android.provider.cts
Change-Id: Ic5ae08107f7dd3dd23dcaec2df40c16543e0d86e
Exempted-From-Owner-Approval: keep tests working
2018-12-08 11:25:13 -07:00
Varun Shah
5f303659c2 Added a new "wellbeing" protection flag.
Permissions that have the new wellbeing protection flag will be granted
to the wellbeing app, as defined by the OEM in the system resource.

The ACCESS_INSTANT_APPS permission is updated to use the wellbeing
flag. The SUSPEND_APPS permission will also follow the same model now.

Bug: 119330345
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Test: atest com.android.server.pm.SuspendPackagesTest
Test: atest com.google.android.suspendapps.permissionpolicy.gts.SuspendAppsPermissionPolicyTest
Change-Id: Iffedc7704824292be48a4ef198fff97c1e5c39da
2018-12-07 17:10:28 -08:00
Benedict Wong
c02acadd9b Merge "Add IPsec tunnel mode feature flag" 2018-12-07 19:42:21 +00:00
Varun Shah
acad138eda Privileged apps can now launch their activities across profiles.
Introduced a new INTERACT_ACROSS_PROFILES privileged permission which
allows an application to start a managed profile activity from its personal
profile activity.

Added CrossProfileApps#startAnyActivity(ComponentName, UserHandle) which
requires the INTERACT_ACROSS_PROFILES permission and enables an app from
a personal profile to launch an activity within its managed profile app.

Bug: 118186373
Test: atest com.android.server.pm.CrossProfileAppsServiceImplTest
Test: atest cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CrossProfileAppsHostSideTest.java
Change-Id: I28aa05c7e54f60eb6144275d31eaf8813e2f10ad
2018-12-07 11:05:13 -08:00
Hui Yu
1ea855202f Add manifest service attribute foregroundServiceType
Foreground service must use attribute foregroundServiceType to
specify its foreground service type in <sevice> element of manifest
file, otherwise a warning message is printed when startForeground()
method is called. (We will replace the warning message with a security
exception when the feature is formally activiated.)
The manifest attribute is:
android:foregroundServiceType="<type>"

Allowed types are: "sync", "mediaPlay", "phoneCall",
"location", "deviceCompanion", "ongoingProcess".

Bug: 111453223
Test: atest frameworks/base/tests/FrameworkPerf
Change-Id: I5d2ab203d400f3c549cd153480b6252a2f9adb3c
2018-12-06 16:59:18 -08:00
Felipe Leme
749b889889 Yet another (major) refactoring on Content Capture and Augmented Autofill.
Bunch of changes:

- Split public SmartSuggestionsService info ContentCaptureService and
  AugmentedAutofillService
- Renamed 'intelligence' packages to either 'contentcapture' or
  'autofil.augmented'
- Renamed internal packages and classes.
- Changed permissions, resource names, etc...
- Moved Augmented Autofill logic from IntelligeceManagerService (R.I.P.) to
  Autofill.
- Optimized IPCs by passing a String instead of the InteractionSessionId
  (that also solves the view -> service dependency).

Test: atest CtsContentCaptureServiceTestCases \
            CtsAutoFillServiceTestCases \
            FrameworksCoreTests:SettingsBackupTest
Test: manual verification with Augmented Autofill Service

Bug: 119638877
Bug: 117944706

Change-Id: I787fc2a0dbd9ad53e4d5edb0d2a9242346e4652d
2018-12-06 16:56:39 -08:00
TreeHugger Robot
151357cde2 Merge "Replace Slog with Log in ContentProvider" 2018-12-06 23:05:40 +00:00
Amin Shaikh
5fdc89c006 Document the format of EXTRA_CONTENT_QUERY.
Change-Id: Ifb8e76bf9c7e3a24a91efe7423153aef3d91eb86
Fixes: 120488579
Test: N/A
2018-12-06 15:50:21 -05:00
Eugene Susla
aaa542712b Replace Slog with Log in ContentProvider
Test: ensure noe errors on boot
Change-Id: I44efbf1a52c9c602ce6c9f8ea23b7a4566df27f3
2018-12-06 11:04:21 -08:00
TreeHugger Robot
8730cc4e6b Merge "Add documentation for passing EXTRA_PERMISSION_NAME to REVIEW_PERMISSION_USAGE." 2018-12-06 15:55:45 +00:00
Benedict Wong
dc92c69b08 Add IPsec tunnel mode feature flag
This patch adds a feature flag for IPsec Tunnel Mode. This implies VTI
(with output-mark updating), or XFRM-I in the kernels.

Bug: 117183273
Test: Compiles
Change-Id: I6dd0e429cc0bd100f2ef1140a6651f6ef5294c79
2018-12-05 23:41:02 -08:00
TreeHugger Robot
fce7ec9737 Merge "Log a string to logcat when ContentProvider access gets denied due to appop" 2018-12-06 02:42:50 +00:00
Dianne Hackborn
77b13fd30a Merge "Fix various issues in ordering of grouped bindings." 2018-12-06 00:44:24 +00:00
Dianne Hackborn
2f55e5a929 Fix various issues in ordering of grouped bindings.
Everything needed to get the CTS tests to work.

Also:

- Change process names to be unique per isolated instance,
  and no longer use isolated uid in proc stats, so we don't
  have a crazy number of process entries there.
- Again move activity manager dumpsys output so we aren't
  spewing less useful stuff at the end where it hides the
  core state about processes.
- Fix protos so that we can read InstrumentationInfo from the
  activity manager protos.  (There was confusion about writing
  protos for a PackageItemInfo vs. an ApplicationInfo.)

Test: atest CtsAppTestCases:ServiceTest\#testActivityServiceBindingLru
Bug: 111434506
Change-Id: I2c86bd1daa582a5c60950173ca12e8ec21b13ead
2018-12-05 11:03:58 -08:00
Christine Franks
ca1fd658ed Merge "Add IColorDisplayManager" 2018-12-05 16:29:51 +00:00
Ivan Chiang
6f1c51f59e Expose @Public for EXTRA_AUTO_LAUNCH_SINGLE_CHOICE
This change is for "Open with" feature in DocumentsUI.
If this is public, other apps also can have this
feature.

Test: make
Bug: 110959821
Change-Id: I9c1255419869f9983eac7e820c42a96400f15bfd
2018-12-05 14:43:44 +08:00
Joel Galenson
b995edac62 Add documentation for passing EXTRA_PERMISSION_NAME to REVIEW_PERMISSION_USAGE.
REVIEW_PERMISSION_USAGE now supports being passed a permission name.
Document that in the comment.

Bug: 120222495
Test: Compile
Change-Id: Iedd2d98b5150bdf21fa80489889a0672d58dd1f2
2018-12-04 17:32:28 -08:00
Philip P. Moltmann
dbf78b8127 Move RuntimePermissionPresenter to android.permission
Consolidate all permission related code in a single java package.

Test: atest SettingsLibRoboTests
      Looked at Settings AppInfo UI (uses RuntimePermissionPresenter)
Bug: 120221960
Change-Id: If135e984a8273e9bed80cab9fbf2d70f40a05c7f
2018-12-04 16:53:23 -08:00
Eugene Susla
b22f71eafe Log a string to logcat when ContentProvider access gets denied due to appop
Make sure testers have a way to quickly determine when an app is trying to access
call logs or SMS without being the default handler, so we don't get inundated with
bugs about correct behavior

Test: proofread
Change-Id: I46b9dc86073101f8ca08ac1bc90c79338afd114f
2018-12-04 21:16:26 +00:00
Philip P. Moltmann
4468973573 Use pooledLambda in RuntimePermissionPresenterService
And check parameters at trust boundaries

Test: Looked at AppInfo in Settings (uses RuntimePermissionPresenterService)
Change-Id: Ie70f64c1bc5435e1d284c37cc6fec208468b3a0a
2018-12-04 12:50:50 -08:00
David Brazdil
0bf7ab1631 Merge "hiddenapi: Add constants for 'greylist-max-p'" am: ec62f08f8c am: 8a822605d2
am: f29f0de34c

Change-Id: I31647f9e58e86d1bb18891534fcf1e3d4226298e
2018-12-04 03:07:34 -08:00