Commit Graph

7584 Commits

Author SHA1 Message Date
Mehdi Alizadeh
6d4ce1e5bb Merge "Make ShortcutInfo@getPersons() systemApi" 2019-02-25 21:02:11 +00:00
TreeHugger Robot
a984bb74b1 Merge "Enforce MANAGE_APP_PREDICTIONS on hasShareTargets" 2019-02-25 20:54:55 +00:00
Paul Duffin
869f5c42a0 Merge "Update backwards compatibility support for android.test.base" am: 617e556477 am: f4dfe50594
am: 70828b499b

Change-Id: Ic8b18c2e4fc86717e0fe5c3090c5e7cbaf9b05d6
2019-02-25 09:26:13 -08:00
TreeHugger Robot
d138be09df Merge "Add Foldable feature flag" 2019-02-25 16:57:50 +00:00
Paul Duffin
70828b499b Merge "Update backwards compatibility support for android.test.base" am: 617e556477
am: f4dfe50594

Change-Id: I9ad5a85431e0ea747fff208430b3a61826674b62
2019-02-25 08:43:04 -08:00
Dario Freni
7d98a45672 Merge "Add "Staged" to API related to staged sessions." 2019-02-25 15:23:17 +00:00
Dario Freni
60a96c1791 Add "Staged" to API related to staged sessions.
Also, throw an IllegalArgumentException is these APIs are called on
sessions that are not marked as staged.

Test: tested new apis with an ad-hoc app. atest RollbackTest
StagedRollbackTest
Fix: 124507718

Change-Id: I3529aaff404d644ab6dad98f29411141e8df865d
2019-02-25 13:09:48 +00:00
Ivan Chiang
a46ade3cc1 Add @RequiresPermission annotations to getCahce and putCache
Add @RequiresPermission annotations to the methods so that
it's clear what permission is protecting these APIs.

Test: make
Change-Id: I203ce997319c7fc8a13e91b55f3c55d844429be8
Fix: 123661724
2019-02-25 11:30:34 +08:00
Ricky Wai
905908f743 Do not return AppDetailsActivity in PackageInfo
Also, update javadoc for LauncherApps.getActivityList()

Bug: 119789943
Test: atest android.content.pm.cts.PackageManagerTest#testGetPackageInfo
Change-Id: I1a183207e6eb880a68811d4c2a5cf77d3f71f0b0
2019-02-23 00:26:57 +00:00
Chandan Nath
8715260984 Merge "[Multi-user] add PackageInstaller.installExistingPackage with IntentSender which is fired only after the asynchronous restore is complete" 2019-02-22 23:34:04 +00:00
Ricky Wai
ccac071827 Merge "SystemAPI for setting app details activity state" 2019-02-22 20:19:03 +00:00
Chandan Nath
e8e463bd84 [Multi-user] add PackageInstaller.installExistingPackage with IntentSender which is fired only
after the asynchronous restore is complete

This is a better alternative to the existing synchronous PackageManager.installExistingPackage
method where the restore operation happens asynchronously but the method itself will return
success before the restore finishes.

Bug: 122881085

Test: 1) cts-tradefed run cts -m CtsBackupHostTestCases
-t android.cts.backup.ProfileKeyValueBackupRestoreHostSideTest
2) atest RunBackupFrameworksServicesRoboTests
3) Install Hangouts on work profile. Then install on primary profile, backup and uninstall.
Now install again and immediately hit Open. Before this change, the app will crash after a few
seconds (when the background restore operation finishes). With this change and a corresponding
Play Store change to use this new method, Open shows up only after restore has finished so the
app doesn't crash.

Change-Id: I5d2e1f3bb5509894bedd6bbcfac32ed6cf946a80
2019-02-22 19:14:53 +00:00
Nikita Ioffe
3cbd4a584e Merge "Require INSTALL_PACKAGES permission for setInstallAsApex" 2019-02-22 17:04:17 +00:00
Nikita Ioffe
4501c11cb0 Require INSTALL_PACKAGES permission for setInstallAsApex
Bug: 123314638
Fixes: 123314638
Test: apex_e2e_tests
Change-Id: I2a78a5e7496554c0c3eecbfd28f2d793b4ba2196
2019-02-22 14:03:41 +00:00
Wale Ogunwale
c6506833e3 Merge "Added some TestApi that are already used by CTS" 2019-02-22 12:51:57 +00:00
Philip P. Moltmann
933c8e06e8 Merge changes from topics "policy_fixed_set_via_perm_controller", "protect-policy-flags"
* changes:
  Ask Perm Controller to set policy-fixed perms
  Guard changing policy_fixed flag behind permission
2019-02-22 04:39:31 +00:00
Wale Ogunwale
691af68a3c Added some TestApi that are already used by CTS
Allows us to remove the use of private platform API from CTS.

Bug: 124134247
Test: builds
Change-Id: Iceb81ff7c9385e877d2612fbb7b506245d116928
2019-02-21 20:15:56 -08:00
Philip P. Moltmann
2a537a6ef5 Guard changing policy_fixed flag behind permission
- Allow an app to change policy_fixed permissions
- Disallow apps >= Q to change the polic_fixed flag

Bug: 124128308
Test: Changed permissions that were policy_fixed
Change-Id: Ia94bae1b993bd8a18c93f866df2114c740fa17bd
2019-02-21 16:56:25 -08:00
Mehdi Alizadeh
627d4db703 Enforce MANAGE_APP_PREDICTIONS on hasShareTargets
ShortcutManager#hasShareTargets() is used in ShareSheet, which is moving
out of system process. So we need to annotate hasShareTargets as systemApi
and enforce permission on the caller.

Bug: 123779604
Test: atest ShortcutManagerTest1
Change-Id: Ib2352f0e8600b0e792405af5b9b61b380c050d28
2019-02-21 18:55:16 +00:00
Mehdi Alizadeh
8887365f2a Make ShortcutInfo@getPersons() systemApi
Bug: 123892900
Test: None
Change-Id: Ic86fbd577f5473f882f806d4a8e98a923a39f0fb
2019-02-21 18:54:37 +00:00
Felipe Leme
a4f39cd150 Refactored Autofill properties that are optimized on application level.
Prior to this CL we were just caching whether the service supported compatibility mode for the app,
but now we're also caching the logging level and whether the app is whitelisted for augmented
autofill - although right now the augmented autofill info is not used, it will allow us to trigger
it in the scenarios where autofill is disabled for the app.

Bug: 123099842
Bug: 123100824
Test: atest CtsAutoFillServiceTestCases:AugmentedLoginActivityTest \
            CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest
      atest CtsAutoFillServiceTestCases # sanity check, although still flaky

Change-Id: Iaf8ea6634ca94e5e61131890ec17c96c2fbb329a
2019-02-21 10:44:39 -08:00
Ricky Wai
92cd00622b SystemAPI for setting app details activity state
Priv-app can use it to enable / disable AppDetailsActivity of an app

Bug: 124378857
Test: Able to compile
Change-Id: I3122d7c1a18362cecdcea17b14d21b7c0ce12754
2019-02-21 17:31:13 +00:00
Nikita Ioffe
3383005724 Merge "RMS: Pass in rollback_id in the calls to installd" 2019-02-21 11:09:26 +00:00
Paul Duffin
5d70cdf262 Update backwards compatibility support for android.test.base
Previously, the plan was for android.test.base to be removed from the
bootclasspath in P, i.e. in the same release as org.apache.http.legacy.
Any apps that targeted < P were to have the android.test.base library
added to their app classpath in order to maintain backwards
compatibility.

Unfortunately, it was not possible to remove android.test.base from P
and instead it is being removed from Q. This update prepares for that
by updating the backwards compatibility support and its tests to add
the android.test.base library to apps that target < Q.

The affected code is only used at runtime when
REMOVE_ATB_FROM_BCP=true.

Bug: 73711752
Test: atest FrameworksCoreTests with and without REMOVE_ATB_FROM_BCP=true
Change-Id: I76b40dad14193cd174114a351b1350c18d647bed
2019-02-21 10:42:12 +00:00
TreeHugger Robot
3ffadce8b9 Merge "Optimized Content Capture workflow by caching some state at the application level." 2019-02-21 05:34:34 +00:00
Felipe Leme
326f15a392 Optimized Content Capture workflow by caching some state at the application level.
Content Capture for an activity and/or package is only available when the Content Capture service
explicitly whitelists it. As the whitelist is kept at system-server level, it's better to fetch that
info when the application is started and cache it locally, so we can optimize the
ContentCaptureManager APIs to return quickly when it's disabled.

This CL also caches other values such as the buffer parameters.

Test: atest CtsContentCaptureServiceTestCases

Bug: 120494182
Bug: 121202151

Change-Id: I9d5211bca496ffa85ba9efc2a7bb32411834b787
2019-02-20 18:44:05 -08:00
Jeff Sharkey
806bece3be Flesh out CR.getTypeDrawable() with more details.
Providing icons for MIME types is generally useful, but we also
need to provide a label and content description.  This interface
can be extended internally to surface details about special MIME
types, such as "image/vnd.google.panorama360+jpg".

Bug: 122887179, 120791890
Test: atest android.content.cts.ContentResolverTest
Change-Id: Ibe655896315b9a9662dfdace3ee8ffacf1302eb8
2019-02-20 18:26:16 +00:00
TreeHugger Robot
f7612ac846 Merge "Changes on the ContentCaptureContext APIs." 2019-02-20 15:51:59 +00:00
Jeff Sharkey
b91eaa54a8 Respond to various API council feedback.
Handle many simple, smaller changes in a single CL.  Hide
CPC.closeQuietly(), now that it implements AutoCloseable.  Add more
details to CR.set/getCache() docs.  Add many @Nullable/@NonNull
annotations.

Bug: 124507578, 124447751, 124302519, 123697622
Bug: 123661322, 122887179, 122528742, 122527812, 116224797
Test: manual
Change-Id: Icee556a6ed76bbdf4c8e42b59d69d5580d461b95
2019-02-19 11:09:22 -07:00
Nikita Ioffe
5dcd179749 RMS: Pass in rollback_id in the calls to installd
- snapshotAppData gets PackageRollbackInfo and updates pending backups
  and inodes of CE user data snapshots;
- computePendingBackups/Restores is now merged into
  commitPendingBackupAndRestoreForUser;
- essentially commitPendingBackupAndRestoreForUser now gets lists of
  pending and recently executed rollbacks, computs what backups and
  restores are pending and commits them.

Bug: 124029909
Test: RollbackTest, AppDataRollbackHelperTest
Change-Id: I5aecdfd47b535492165614ee7cf9676778e292ad
2019-02-19 15:11:50 +00:00
Sam Lin
821f43aa64 Add Foldable feature flag
This CL add a feature flag for an Android device with a foldable
display.

Bug: 124406307
Test: make checkbuild
Change-Id: I4f04be938322d1d27d382d6a30c5507413a269b8
2019-02-19 05:07:06 +00:00
Jeff Sharkey
c2b55eb98f Merge changes from topic "wrapz"
* changes:
  Add tests for DocumentsContract/Provider.
  Replace ContentInterface with wrapping.
2019-02-18 16:42:07 +00:00
TreeHugger Robot
cbb05a317b Merge changes I9ed87db1,Ic0b766f6
* changes:
  Make PermissionControllerManager user aware
  Check same uid for permission and app-op
2019-02-16 22:35:22 +00:00
Philip P. Moltmann
0d05e48371 Check same uid for permission and app-op
In permission checker we used to check the permission for the passed in
uid but the opp-op for the Binder.getCallingUid. In the case the calling
identity was cleared, PermissionChecker ended up checking the app-op of the
current process (often the system server).

Now we check the uid for both the permission and the app-op.

Test: Called PermissionChecker.checkPermission with the calling indentity
cleared.
Fixes: 124116218
Change-Id: Ic0b766f6c75bba1b9dae3e91c6adce85a76ae68f
2019-02-16 12:08:25 -08:00
Felipe Leme
044c63b367 Changes on the ContentCaptureContext APIs.
- Replaced URI by a generic ID
  (which is a new class LocusId, and required)
- Createad a new Intent.ACTION_VIEW_LOCUS action
  (and Intent.EXTRA_LOCUS_ID extra)
- Removed ContentCaptureContext.getAction()
  (so the only "supported" action is ACTION_VIEW_LOCUS)
- Made the ContentCaptureContext getters public
  (getId(), getExtras())

Test: m update-api
Test: atest CtsContentCaptureServiceTestCases \
      CtsContentTestCases:LocusIdTest \
      FrameworksCoreTests:android.view.contentcapture.ContentCaptureEventTest

Bug: 123577059
Fixes: 124266664

Change-Id: Id4c28f056eb7a24dd083303ffdea7cf662cefac2
2019-02-15 20:44:35 -08:00
Jeff Sharkey
497789ebd9 Add tests for DocumentsContract/Provider.
Confirm that invoking methods on DocumentsContract will correctly
be decoded and passed through to a DocumentsProvider instance.

Bug: 123725500, 123660195
Test: atest android.provider.cts.DocumentsContractTest
Change-Id: I16e7da808db83645db06f16a6be2c9575d9a3d06
2019-02-15 19:53:49 -07:00
Jeff Sharkey
a13887fa63 Replace ContentInterface with wrapping.
After much discussion, we can't safely introduce ContentInterface,
so instead offer ContentResolver.wrap() methods.

Bug: 120974438
Test: manual
Change-Id: I0b399192a19948a8986146efa916375022c38b59
2019-02-15 19:45:18 -07:00
TreeHugger Robot
0c2101c6d4 Merge "Add IntDef annotation to parameter foregroundServiceType." 2019-02-16 01:23:18 +00:00
Hui Yu
b8dcbeeff1 Add IntDef annotation to parameter foregroundServiceType.
For methods Service.startForeground(int, Notification, int).
Also add IntDef annotation on return value of
ServiceInfo.getForegroundServiceType().

Change-Id: I3f0df5ff44dfb1b0cf2150d6e40d39ac0cd2b2b5
Fix: 124331268
Test: NA.
2019-02-15 11:49:48 -08:00
Philip P. Moltmann
3e4961757b Expose permission flag APIs for tests
tests need to make sure the flags are set correctly.

Bug: 116738135
Test: atest CtsBackupTestCases:android.backup.cts.PermissionTest#testRestorePermReviewed
Change-Id: Ia1000de3594e910c3345e205679bee37be898d17
2019-02-15 08:57:16 -08:00
Philip P. Moltmann
4845667a81 Move permission restore code into permission controller.
- Split system-server internal interface in two. One accessible only
  inside of the services part of system server. One accessible
  everywhere. This is necessary as the second part needs to be
  accessible by the PermissionBackupHelper. But the former uses internal
  data structures that should not be moved into android.permission.
- Remove old delayed permission restore code from
  PermissionManagerService and Settings. This code now lives in
  permission controller
- Keep the logic to remember which users still have delayed permissions
  left. It is quite expensive to call into permission controller for
  ever install of an app, hence this check is necessary. Currently this
  mirrors the original logic. This can be improved further later.

Test: Built
Change-Id: Ibc1d5183c361dc55896882db1f7b765e1bee6e84
2019-02-15 08:57:16 -08:00
Remi NGUYEN VAN
0d49d3863b Merge "Move NetworkStack to services.net" am: 762f9f0c24
am: 51490ad0fa

Change-Id: I6a0ddc23bf95039d9d51a4fde9dd87d2f5bf71ee
2019-02-15 03:10:18 -08:00
Remi NGUYEN VAN
51490ad0fa Merge "Move NetworkStack to services.net"
am: 762f9f0c24

Change-Id: Iab45985aedb8069ad50fd2913ef6e828989cdd0d
2019-02-15 03:01:11 -08:00
Remi NGUYEN VAN
584b1378a8 Merge "Move NetworkStack to services.net" 2019-02-15 07:25:09 +00:00
Remi NGUYEN VAN
5db454c28d Move NetworkStack to services.net
NetworkStack is only used in services.net or clients of services.net. It
cannot stay in framework.jar because it needs to depend on AIDL
interfaces, which would conflict with app implementations if they were
in framework.jar.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: Ib1d08a3669983640119d008db7e2990fa798724f
Merged-In: I501b125a388c1100c2182bde4670944c2f0d7a02
2019-02-15 12:20:17 +09:00
Xin Li
07ec9dbec5 Merge "DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into stage-aosp-master" into stage-aosp-master 2019-02-14 22:11:32 +00:00
TreeHugger Robot
f9723ba1e7 Merge changes from topic "accessibility-usage-dialog"
* changes:
  Make the accessibility op string a SystemApi.
  Add a new intent for reviewing running accessibility services.
2019-02-14 21:04:32 +00:00
TreeHugger Robot
b225c56f06 Merge "Use role for default home." 2019-02-14 19:59:59 +00:00
TreeHugger Robot
2934daf1ba Merge "Add an intent to launch the permission toggle screen." 2019-02-14 18:40:02 +00:00
Xin Li
0e71b4f19b DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
2019-02-14 09:48:06 -08:00