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
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
Instead of using Bundle, explicitly specify params when initializing a data loader.
BUG: 150406132
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I2f89d3c3ea1058fdbd689da0d5cb801bf4d9a0b4
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
The UnsupportedAppUsage annotation was accidentally removed in
e6d7a2d022. Restore the method
signature/annotation.
Bug: 150681392
Test: none
Change-Id: I6c46a777c0dbd53fa67d6e1c3e09248f636fe82b
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
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
with appOp as String and options as Bundle
Bug: 139077993
Bug: 146423958
Test: Build
Change-Id: I5325e08d60016741139251813a5df9b42f2efc82
Merged-In: I5325e08d60016741139251813a5df9b42f2efc82
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
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
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)
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>
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