Commit Graph

9059 Commits

Author SHA1 Message Date
Jeff Sharkey
189e00a46b Merge "Use flags to indicate reason for Uri changes." into rvc-dev 2020-03-06 00:04:24 +00:00
TreeHugger Robot
8caff7dc81 Merge "DO NOT MERGE: Remove AppSearch from Android R." into rvc-dev 2020-03-05 21:09:00 +00:00
Jeff Sharkey
d70325359e Use flags to indicate reason for Uri changes.
As part of MediaProvider becoming a Mainline module, some partners
need to understand more details about what triggered a Uri change
notification.  This helps listening apps avoid making expensive and
race-condition-prone calls back into MediaProvider; typically when
they're only interested in insert and delete operations.  This change
uses the existing "flags" argument to communicate the reason.

This change adds overloads to ContentObserver for listening apps to
receive these flags.  In addition, we add overloads that deliver a
clustered set of multiple Uris together in a single Binder transaction
to improve overall efficiency.  (This matches well with the existing
CR.notifyChange() API that we added earlier this year, since they
both work with Iterable<Uri>.)

Tests to verify that we only collapse Uris together when all other
method arguments are identical.

Bug: 147778404, 144464323
Test: atest CtsDatabaseTestCases
Test: atest CtsContentTestCases:android.content.cts.ContentResolverTest
Test: atest FrameworksServicesTests:com.android.server.content.ObserverNodeTest
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I0bbd8a8b4a898ab6f891d085de0ecb4d68cbe302
2020-03-05 11:01:23 -07:00
Galia Peycheva
fc1430a39e Merge "Make ActivityInfo.preferMinimalPostProcessing a flag" into rvc-dev 2020-03-05 15:45:06 +00:00
Patrick Baumann
3b91ac3e6c Merge "Logs for test & debug blocks" into rvc-dev 2020-03-05 15:25:46 +00:00
Khaled Abdelmohsen
759dbb7cf6 Merge "Extract source stamp during app install" into rvc-dev 2020-03-04 23:47:33 +00:00
Songchun Fan
ecd96c2be4 Merge "make IDataLoaderManager and IDataLoader stable interfaces" into rvc-dev 2020-03-04 22:53:12 +00:00
Patrick Baumann
4b4918782c Logs for test & debug blocks
This change adds logging for debuggable and test-only apps when they are
the caller and visibility of another app is blocked due to app
enumeration.

It also adds an adb command to turn logging on and off for other apps to
help developers while debugging issues.

Test: atest AppsFilterTest AppEnumerationTests PackageManagerPerfTest
Bug: 145623959
Change-Id: I1fa930ef40bf08b00c41f51aa25c50b2189395bf
2020-03-04 13:47:33 -08:00
Khaled Abdelmohsen
02067c2e4f Extract source stamp during app install
Bug: 148006415
Test: atest FrameworksServicesTests:AppIntegrityManagerServiceImplTest
Change-Id: I3453c94d93e35b01de1a353d592e01db514e8921
2020-03-04 19:36:11 +00:00
Ryan Mitchell
1c275d93d2 Merge "Restore PackageParser UnsupportedAppUsage" into rvc-dev 2020-03-04 18:00:05 +00:00
Jason Hsu
6820d68e25 Merge "Support settings activity for accessibility shortcut target" into rvc-dev 2020-03-04 12:13:42 +00:00
Songchun Fan
6381d6193e make IDataLoaderManager and IDataLoader stable interfaces
Instead of using Bundle, explicitly specify params when initializing a data loader.

BUG: 150406132
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I2f89d3c3ea1058fdbd689da0d5cb801bf4d9a0b4
2020-03-03 21:18:30 -08:00
Winson Chiu
2b1fa477ff Merge "Fix cross profile attribute parsing" into rvc-dev 2020-03-04 00:48:53 +00:00
Winson
a20ba0beee Fix cross profile attribute parsing
Was lost in a rebase.

Bug: 150398686

Test: atest com.android.cts.devicepolicy.QuietModeHostsideTest
Test: manual verify no other ParsingPackage changes were lost

Change-Id: I3e17796433686ef38e24492c3255f5ccba1f431c
2020-03-03 13:18:39 -08:00
Winson Chiu
f5f588e032 Merge changes I815bb92e,I1777f84c into rvc-dev
* changes:
  Adjust AndroidPackage String interning
  Add package parsing v1 vs v2 benchmark
2020-03-03 18:06:37 +00:00
Ryan Mitchell
cc6acd2268 Restore PackageParser UnsupportedAppUsage
The UnsupportedAppUsage annotation was accidentally removed in
e6d7a2d022. Restore the method
signature/annotation.

Bug: 150681392
Test: none
Change-Id: I6c46a777c0dbd53fa67d6e1c3e09248f636fe82b
2020-03-03 08:59:53 -08:00
Galia Peycheva
bdd66e30f8 Make ActivityInfo.preferMinimalPostProcessing a flag
Bug: 149420259

Test: atest CtsWindowManagerDeviceTestCases:MinimalPostProcessingTest

Change-Id: I250669158a532316bebed8fa8c17e009b9293ecb
2020-03-03 16:59:26 +01:00
Arthur Ishiguro
6c46c74576 Merge "Hides FEATURE_CONTEXT_HUB from Android SDK" into rvc-dev 2020-03-03 01:52:07 +00:00
Jayachandran Chinnakkannu
db5c0688f3 Merge "Make IccCardConstants APIs hidden as per API concil's feedback" into rvc-dev 2020-03-02 21:18:50 +00:00
Arthur Ishiguro
8b9db55adb Hides FEATURE_CONTEXT_HUB from Android SDK
This feature guards a @SystemApi and should be hidden from the SDK.

Bug: 150326953
Test: None
Change-Id: Ifc5087fc956efd966e38934fcaacfa46f2cd7b28
2020-03-02 18:45:55 +00:00
Ryan Mitchell
dc65c78fcf Merge "Fix overlaying shared libraries" into rvc-dev 2020-03-02 16:51:56 +00:00
Jayachandran C
6c546d00d0 Make IccCardConstants APIs hidden as per API concil's feedback
We will make the external components to use alternate APIs in S

Bug: 147320577
Change-Id: I22d35ea0fceb3071b1e21899cbdc3a26c9d8e972
2020-02-28 16:57:54 -08:00
Ryan Mitchell
41b93d8caa Fix overlaying shared libraries
Overlaying shared library support accidentally got dropped while
refactoring internal PMS structure.getAllOverlayPaths includes shared
library overlay paths.

Bug: 150446147
Test: OverlayRemountedTest
Change-Id: I5eed0f219c85156c753df6ff829970e1c4e4c4de
2020-02-28 11:40:44 -08:00
Peter Wang
879f32b1cc Merge "[API Review] Expose sendOrderedBroadcast" into rvc-dev 2020-02-28 19:05:26 +00:00
Winson
d2732995bb Skip no-state checkUseInstalled check inside PackageInfoUtils
PackageInfoWithoutStateUtils is designed for use in core when
the caller doesn't have a PackageSeting.

Because its generic generateApplicationInfo method does a simplified
checkUseInstalled check without the PackageSetting, this fails whenever
state must be taken into account.

This introduces method variants which skips the checks and defers to
PackageInfoUtils's own check.

Bug: 150328400

Test: manual verify call into PackageManager#setSystemAppState with
    SYSTEM_APP_STATE_UNINSTALLED and verify
    PackageManager#getApplicationInfo throws NameNotFoundException
    without fix and succeeds with fix
Test: atest com.android.server.pm.parsing
Test: TODO PackageInfo(WithoutState)Utils test in follow up change

Change-Id: Ie00984c2e1b80d2a3948923dc1293fbfddf01037
2020-02-27 17:07:51 -08:00
Winson Chiu
b0c5105b2d Merge changes from topic "actor-signature-policy-rvc-dev" into rvc-dev
* changes:
  Actor signature overlayable policy
  Refactor overlayable policy
2020-02-27 18:27:53 +00:00
Sudheer Shanka
442399b1c1 Merge "Include pending media as well when deleting mediastore entries." into rvc-dev 2020-02-27 17:49:53 +00:00
Rhed Jao
27c781d917 Support settings activity for accessibility shortcut target
Bug: 150277218
Test: atest AccessibilityShortcutInfoTest
Change-Id: I9afc6b2c917b0abe7bb4f5969dd665ba31157c7c
2020-02-27 12:33:26 +08:00
Winson
f56ade365a Actor signature overlayable policy
There are cases where an app can ship overlays for itself,
but the "signature" policy as described would open up
a vulnerability by allowing the system actor to create
and sign any arbitrary overlay that will apply to the target.

To prevent this, redefine "signature" as target package only,
and introduce "actor" for checking against the actor signature.
Any app that wishes to use both can include both policies.

Bug: 130563563

Test: m aapt2_tests idmapt2_tests and run from host test output
Test: atest libandroidfw_tests

Change-Id: I1c583a5b37f4abbeb18fc6a35c502377d8977a41
2020-02-26 15:59:44 -08:00
Peter Wang
2361687bec [API Review] Expose sendOrderedBroadcast
with appOp as String and options as Bundle

Bug: 139077993
Bug: 146423958
Test: Build
Change-Id: I5325e08d60016741139251813a5df9b42f2efc82
Merged-In: I5325e08d60016741139251813a5df9b42f2efc82
2020-02-26 15:58:33 -08:00
Alexander Dorokhine
0b291791c8 DO NOT MERGE: Remove AppSearch from Android R.
Test: presubmit
Bug: 150249538

Change-Id: Idb86be6586ae400552f8ceeca5c667fba8e0c43a
2020-02-25 21:15:03 -08:00
Winson
dec01d6130 Adjust AndroidPackage String interning
For the initial pass, everything was interned to take a
conservative approach.

But the time needed to intern every string has caused a significant
fixed cost every time the package is read from cache at boot.

This manually checks each string and removes interning from those
that are generally unique or don't have a significant benefit to
being interned.

Bug: 135203078
Bug: 141922546

Test: atest AndroidPackageParsingEquivalenceTest
Test: atest ScanTests
Test: atest PackageParserTest
Test: manual verify with PackageParsingPerfTest; see bug

Change-Id: I815bb92ec29d2ca38e8614d44937bc738599be55
2020-02-25 14:10:25 -08:00
Ryan Mitchell
93f2b3f9a2 Restore UnsupportedAppUsage method call
4579c0aea2 changed the method signature
of the constructor of ResourcesKey, which is marked
UnsupportedappUsage. Restore the previous signature and provide a new
constructor that is hidden.

Bug: 147359613
Test: none
Change-Id: I391167e9064b1d88f4ad75200a190e5e3b0968cf
2020-02-25 22:10:22 +00:00
Sunny Goyal
9962f03b77 Merge "Updating documentation for isDefaultApplicationIcon API" into rvc-dev 2020-02-25 17:46:23 +00:00
Makoto Onuki
9577cd78ff Merge "Squash same ApplicationInfo's in Parcel" into rvc-dev 2020-02-25 15:17:14 +00:00
Galia Peycheva
641e2e6361 Create DreamManager System Server TestApi
Bug: 141771803
Bug: 133216167

Test: atest DreamManagerServiceTests
Test: make checkbuild

Merged-In: I937061138bc8ccaf4475674f00331c3fe1c5a495
Change-Id: I937061138bc8ccaf4475674f00331c3fe1c5a495
(cherry picked from commit 4467c53c11)
2020-02-25 12:32:02 +00:00
Sunny Goyal
c25c4bb378 Updating documentation for isDefaultApplicationIcon API
Bug: 149758817
Test: N/A
Change-Id: Iaa9b29f55087204f4af849a384cb6c9b01df4465
2020-02-24 15:16:08 -08:00
Makoto Onuki
2d80ca09fc Squash same ApplicationInfo's in Parcel
ApplicationInfo now automatically tries to "squash" the same instances in a
Parcel.

NOTE: This CL still does *not* optimize the package manager APIs that return a
list. e.g. PM.queryContentProviders() still return duplicate AppInfo's.
We can optimize them by making ParcelableListSlice call "allowSquashing",
but that *could* have negative side effects, so I'm not doing it in this CL.
I think we can do that for S.

Bug: 148588589
Test: atest CtsContentTestCases # except for two preexsiting failures:
- android.content.pm.cts.PackageManagerTest#testGetIcon
- android.content.pm.cts.PackageManagerTest#testGetPreferredActivities

Test: Use the debugger and make sure bindApplication() is not receiving
duplicate AppInfo's in the provider list.

Change-Id: I3ba2c047a469169340c0f75c36bdfd394bc5d627
(cherry picked from commit 7d09275d70)
2020-02-24 22:22:13 +00:00
Sudheer Shanka
7d28b5bf81 Include pending media as well when deleting mediastore entries.
Bug: 146914674
Bug: 140565622
Bug: 137381621
Test: manual
Change-Id: I903a13deb467b45839a7d03b60754c8fc464456c
2020-02-24 05:50:33 +00:00
Evan Severson
2aa3230ca0 Merge "Add method to give a permission revoke a reason" 2020-02-21 23:16:09 +00:00
Julius D'souza
4358010076 Merge "Add background thread notes for package restriction serialisation." 2020-02-21 23:08:52 +00:00
Julius D'souza
5745b057ec Add background thread notes for package restriction serialisation.
Serialising package restrictions uses synchronous disk access; callers
of these methods should probably use background threads for this.

Bug: 149216360
Test: TreeHugger
Change-Id: I6607a7225bf7daaad8a78e4d1e4c585ba5ac3efc
Signed-off-by: Julius D'souza <jdsouza@google.com>
2020-02-21 12:49:40 -08:00
Tim Murray
8a9c5795e0 Merge "Cache package and permission information" 2020-02-21 20:22:19 +00:00
Danning Chen
876a4ab9c0 Merge "Adds ShortcutChangeCallback in LauncherApps - Service side" 2020-02-20 20:28:08 +00:00
Mehdi Alizadeh
b754b7ac7a Adds ShortcutChangeCallback in LauncherApps - Service side
Bug: 148615405
Test: atest com.android.server.pm.ShortcutManagerTest1 \
            com.android.server.pm.ShortcutManagerTest2 \
            com.android.server.pm.ShortcutManagerTest3 \
            com.android.server.pm.ShortcutManagerTest4 \
            com.android.server.pm.ShortcutManagerTest5 \
            com.android.server.pm.ShortcutManagerTest6 \
            com.android.server.pm.ShortcutManagerTest7 \
            com.android.server.pm.ShortcutManagerTest8 \
            com.android.server.pm.ShortcutManagerTest9 \
            com.android.server.pm.ShortcutManagerTest10

Change-Id: Ida60b2d0b3d5792e7013ffa703b2f3b45361a4db
2020-02-20 10:05:54 -08:00
Dmitri Plotnikov
23132a29eb Merge "Add async version of "canonicalize"" 2020-02-20 17:42:52 +00:00
Daniel Colascione
a46b7b3f5e Cache package and permission information
We use the package settings class as a central point for invalidating
on package information changes; for permission changes, we invalidate
from inside the individual permission data objects.

Bug: 140788621
Test: boots, package tests (pending)
Change-Id: Iec14d4ec872124e7ef4612c72d94c89a7319ace0
2020-02-20 09:24:32 -08:00
Charles Chen
c56ce6fd08 Merge "Exempt-From-Owner-Approval: Report non-visual Context misuse" 2020-02-20 12:30:06 +00:00
Alex Kershaw
f0f598a711 Merge "Enforce the cross-profile intent check." 2020-02-20 11:40:54 +00:00
Mehdi Alizadeh
f1bdf99b89 Merge "Adds ShortcutManager#pushDynamicShortcut(ShortcutInfo)" 2020-02-20 03:06:28 +00:00