Commit Graph

7608 Commits

Author SHA1 Message Date
TreeHugger Robot
ec995b8df7 Merge "Add nullability annotation to Theme#getAttributeResolutionStack" 2019-03-01 21:26:35 +00:00
TreeHugger Robot
1fa00a503f Merge changes from topic "staged_userdata_restore"
* changes:
  Followup cleanup after refactoring rollback states.
  Use a single list for available and committed rollbacks.
2019-03-01 18:23:42 +00:00
TreeHugger Robot
abc2a7d55c Merge "Mark role related APIs as test API." 2019-03-01 18:23:06 +00:00
Aurimas Liutikas
6c15bc08ea Add nullability annotation to Theme#getAttributeResolutionStack
Bug: 126700353
Test: None
Change-Id: I50979abbdffbf347f8ee2ac85df119fe76abf841
2019-03-01 10:04:21 -08:00
Jeff Sharkey
a09312df67 Merge "All Parcelable CREATOR fields are @NonNull." 2019-03-01 14:58:28 +00:00
Richard Uhler
6f8a33bf2f Use a single list for available and committed rollbacks.
So that there is a single source of truth for pending backups and
pending restores. This fixes rollback of userdata for staged rollbacks.

Included in this change:
* Distinguish between PENDING_AVAILABLE, AVAILABLE, and COMMITTED
  rollback states.
* Separate completeEnableRollback from makeRollbackAvailable.
* Make timestamp @NonNull and set it when rollback is made available.
* Don't listen for SESSION_UPDATED broadcasts.
* Factor out common code for ignoring saveRollbackData IOException.
* Other minor cleanups.

Test: atest RollbackTest
Test: atest StagedRollbackTest
Test: atest AppDataRollbackHelperTest
Bug: 124044231

Change-Id: I654a7827e9ed15659d0cb80e5a2c29c2660aea08
2019-03-01 13:53:43 +00:00
Martijn Coenen
20ee3dc94f Merge "Add PARSE_IS_SYSTEM_DIR when parsing /system APEXes." 2019-03-01 10:43:50 +00:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
If they were null, then the Parcelable would fail to work.

Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
2019-02-28 23:29:04 -07:00
Jeff Sharkey
cb4dd2791a Merge "Translate selection arguments that are paths." 2019-03-01 06:28:24 +00:00
TreeHugger Robot
b5544cd8e7 Merge "Added NPE check on verifySameType()." 2019-03-01 04:42:45 +00:00
Felipe Leme
50a8c75b49 Merge "Autofill, Content Capture, and Augmented Autofill API fixes:" 2019-03-01 02:04:30 +00:00
TreeHugger Robot
92be54d329 Merge "Call into role controller asynchronously when holding mPackages." 2019-03-01 00:03:47 +00:00
Jeff Sharkey
bffd25082c Translate selection arguments that are paths.
Also migrate MediaProvider logging to more general-purpose location
on the ContentProvider.Transport, where we can log exact input/output
values to aid debugging.

Bug: 124347872
Test: manual
Change-Id: I6aba60879ded4e0892d2d1cdd717c23cebaaabd8
2019-02-28 16:39:30 -07:00
Adam He
c78e5d7152 Added NPE check on verifySameType().
Fixes: 120240686
Test: atest CtsAutoFillServiceTestCases
Change-Id: Ic7fe6e04d67e661e18a4c0e970bbaf5c22f74815
2019-02-28 12:55:26 -08:00
Felipe Leme
ce6877b0e4 Autofill, Content Capture, and Augmented Autofill API fixes:
- Added @Nullable / @NonNull on some returned values.
- Removed APIs that won't be implemented for Q.
- Made Builders final.

Test: m update-api

Bug: 123100695
Fixes: 126702168
Fixes: 126701052
Fixes: 126702191
Fixes: 126700602
Fixes: 126700135
Fixes: 126700413
Fixes: 126698817
Fixes: 126698792

Change-Id: I20710537c02051361da18370bc5cc642cc3c26e1
2019-02-28 09:25:12 -08:00
TreeHugger Robot
639e1e74ee Merge changes Iae43f695,I6ca164ad,I4f579393,Icbb67c3c
* changes:
  Rename saveAvailableRollback to saveRollbackData.
  Have RollbackData reuse RollbackInfo.
  Miscellaneous cleanup in RollbackStore.
  Rename RollbackData.inProgress to restoreUserDataInProgress.
2019-02-28 13:35:00 +00:00
Kevin Rocard
a9c3a3a47b Merge changes from topic "APC-PackageManagerNative"
* changes:
  Allow to project audio from a Screen capture MediaProjection
  Expose allowAudioPlaybackCapture to PackageManagerNative
  Introduce playback capture application manifest flag
2019-02-28 05:19:58 +00:00
Hai Zhang
fafe525798 Call into role controller asynchronously when holding mPackages.
For other cases calling synchronously is better, because callers might
expect the next get call to return the right browser. However in the
case of installing a browser app, we are holding the mPackages lock
and should not be calling into higher level components synchronously,
so use a new async call for this. This fixes the system-hang until
timeout when installing a new browser app.

Bug: 124452117
Bug: 123775970
Test: manual
Change-Id: Ib820e65c79c2315f41ff0e31268631c973af4511
2019-02-27 16:25:33 -08:00
Martijn Coenen
f4b9070e9b Add PARSE_IS_SYSTEM_DIR when parsing /system APEXes.
To prevent us from reading all APEXes at boot and verifying their
integrity; this is not necessary because /system is protected by
dm-verity.

Bug: 126514108
Bug: 117823094
Test: verified system APEXes are no longer read entirely at boot
Change-Id: I1dcf97ce63505602d2de1913e728a1d57b0e9964
2019-02-27 21:08:33 +01:00
Richard Uhler
cca637a902 Have RollbackData reuse RollbackInfo.
Rather than duplicating the same information.

This is in preparation for storing available and recently committed
rollbacks the same way so we don't end up with duplicate copies of
PackageRollbackInfo for a rollback so we can fix the bug when doing
userdata restore for staged installs.

Bug: 124044231
Test: atest RollbackTest
Test: atest StagedRollbackTest
Test: atest AppDataRollbackHelperTest
Change-Id: I6ca164adc4351b778d153d4b33296386f6833b61
2019-02-27 16:32:04 +00:00
Kevin Rocard
f91d50b620 Introduce playback capture application manifest flag
Allow apps to opt-out of their playback beeing recorded with an
application wide out-out.

Previously an application had to opt-out on each of its audio tracks.

Application targeting an SDK < Q are considered opt-out by default.
Application targeting an SDK >= Q are considered opt-in by default.

Test: adb shell audiorecorder --target /data/file1.raw &
      adb shell am start -a android.intent.action.VIEW -d file:///system/media/audio/ringtones/Lollipop.ogg -t audio/ogg
      adb dumpsys media.audio_policy # check playback is *not* recorded
      # change packages/apps/Music manifest to allowPlaybackCapture=true
      adb install out/target/product/walleye/system/product/app/Music/Music.apk
      adb shell am start -a android.intent.action.VIEW -d file:///system/media/audio/ringtones/Lollipop.ogg -t audio/ogg
      adb dumpsys media.audio_policy # check playback is recorded
      kill %1
      adb pull /data/file1.raw && sox -r 48000 -e signed -b 16 -c 2 file1.raw file.wav&& audacity file.wav
      # check that the audio file contains first silence then the ringtone after the manifest flag was added
Bug: 111453086
Change-Id: Ie617b15f481a7f148b6e9fc9d64e61acaa5ce71d
Signed-off-by: Kevin Rocard <krocard@google.com>
2019-02-27 03:15:50 -08:00
Hai Zhang
2243586454 Mark role related APIs as test API.
So that we can test them.

Bug: 125404675
Test: build
Change-Id: Id42b9b6f29db77ed2dcfa5d64b292d909094ae42
2019-02-26 16:57:47 -08:00
Varun Shah
652081146a Merge "Added @NonNull to LauncherApps#getAppUsageLimit parameters." 2019-02-26 22:12:52 +00:00
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