- When registering and notifying observers, we should use the user in the
context as opposed to current user.
- Relax the permission check while registering and notifying content observers
to use INTERACT_ACROSS_USERS instead of INTERACT_ACROSS_USERS_FULL permission.
Change-Id: I973936903d4a2272c5722f3b98a057a40c0402be
Fixes: 32955100
Test: Created managed profile and verified that there are not failures.
runtest -x core/tests/coretests/src/android/content/SecondaryUserContentResolverTest.java
runtest -x core/tests/coretests/src/android/content/ManagedUserContentResolverTest.java
I found there was a dead lock among main, android.display and GC threads
when running monkey test.
- Main thread got a mutex and was suspended by GC thread.
- Android.display thread waited for mutex held by main thread.
- GC thread waited for suspention of android.display thread.
This will lead to ANR or screen freeze.
Fixes: 32480078
Test: builds
Change-Id: I13cf1eca3cb3b7c01aa754874f2b48aab0b472e8
This CL adds an API to set up an IPSec Security Association
and Security Policy to perform Transport-Mode and Tunnel-Mode encapuslation
of IP Packets.
Bug: 30984788
Bug: 34811752
Test: 34812052, 34811227
Change-Id: Ic9f63c7bb366302a24baa3e1b79020210910ac0a
Both inherit from package private BaseParceledListSlice.
This is still bad, but it's not as bad. The existing code that uses
this can just do Foo.bar().getList() now instead of having to marshal
to and from an oddball type at either end as well.
In the longer term ParceledListSlice<> should be eliminated, but it's
not clear how far into the future that is going to happen.
Test: runtest -x services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: runtest -x core/tests/coretests/src/android/content/pm/ParceledListSliceTest.java
Change-Id: Ie69b96b5215d6e04990f6d31345772cdfee21d78
Telephony stack is relying on non-existant ContentProviders for
sending Uri change notifications; it'll eventually need to move over
to using real ContentProviders, but apply this band-aid for now.
Test: builds, boots, SMS send/receive works
Bug: 35792675
Change-Id: Ice66278f876f1c754852300da7eb045a7c778d14
They should be providing themes when resolving certain resources,
but they aren't anyway, so try to provide it free of charge, when
possible. Also, nothing is ever free.
Test: Open app that uses old/bad resource methods
Change-Id: Icd57aadf1202ddffb1dd73ab45119fae7e5d6130
Fixes: 35656110
These were never part of any public API level, so apps should never
have been using them.
Test: builds, boots
Bug: 31241513
Change-Id: I4fc8f5c325da56694a5db98acc995a22d4947805
As per CDD: The "android.*" namespace for intent constants is reserved for public
Android API in AOSP. (Whether public to the full SDK, @SystemApi or
defined in AOSP support libraries.)
ACTION_CARRIER_SETUP intent is generally useful for carrier privileged
apps which is unbundled carrier apps, thus move to public APIs
Bug: 33679956
Test: Manual
Change-Id: I202398f868d35e7e9046e7cc41330a3c26dca0b0
Merged-in: Ie2b5d072406513f04676210d08c43d91623c3cd2
Content changed notifications are really only valid for content://
Uris, which are really only valid when we have a valid ContentProvider
backing them. This has been implicit for a long time, but we actually
need to start enforcing it based on target API.
We also now tell developers about why their notification requests
are being denied, instead of silently logging.
Test: builds, boots, common operations work
Bug: 34049049
Change-Id: Ie8ab8d8674cff13e3e9269ffddc4ad998cb848c4
We're checking all the other Intent objects, but we forgot this one.
Test: builds, boots
Bug: 34072700
Change-Id: I4f328950f3122258e0bdea7e87f78d7d0afdedbb
ASEC containers have been deprecated since MNC, which is when we
introduced the "adoptable storage" feature. Adoptable storage is a
much better user experience, since we move both the APK and private
app data together as a single unit, making it much easier to explain
to users.
Test: builds, boots
Bug: 32913676
Change-Id: I97385d081a50a79fc005d4e23e09999f9ae6cfc1
As per CDD: The "android.*" namespace for intent constants is reserved for public
Android API in AOSP. (Whether public to the full SDK, @SystemApi or
defined in AOSP support libraries.)
ACTION_CARRIER_SETUP intent is generally useful for carrier privileged
apps which is unbundled carrier apps, thus move to public APIs
Bug: 33679956
Test: Manual
Change-Id: Ie2b5d072406513f04676210d08c43d91623c3cd2
Instant apps are unique in that any application can start them
with a VIEW/BROWSABLE while only very few apps can see an
instant app using queryIntentActivites, etc... In order to
support this dichotomy, we need an internal hook to resolution
for activity start.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Bug: 25119046
Change-Id: If6974c09c733ff0417ef72cabb9d9e9aca86c37c
There were a few places where access to the mStringBlocks were
not protected.
The crashes seen where similar to:
java.lang.NullPointerException: Attempt to invoke virtual method \
'java.lang.CharSequence android.content.res.StringBlock.get(int)' on a null object reference
at android.content.res.AssetManager.getResourceValue(AssetManager.java:222)
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:188)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2110)
at android.content.res.Resources.getLayout(Resources.java:1111)
java.lang.NullPointerException: Attempt to invoke virtual method \
'java.lang.CharSequence android.content.res.StringBlock.get(int)' on a null object reference
at android.content.res.AssetManager.getPooledStringForCookie(AssetManager.java:312)
at android.content.res.TypedArray.loadStringValueAt(TypedArray.java:1212)
at android.content.res.TypedArray.getValueAt(TypedArray.java:1198)
at android.content.res.TypedArray.getColor(TypedArray.java:446)
What happened was that thread 1 was creating a new mStringBlocks in
makeStringBlocks while thread 2 was accessing mStringBlocks. The
makeStringBlocks starts off by overwriting mStringBlocks with a new
empty array and when thread 2 accessed its content NPE happened.
Bug: 30802713
Test: None (just added synchronization to help prevent races)
Change-Id: I810da26b161a6528b0dd241048dde5b239089244
Hand over ownership of overlays to OverlayManagerService.
Changes to a package's overlays are propagated using the activity life
cycle. Affected activities will be recreated as needed. This provides a
well-defined point to modify an application's assets while the
application is paused.
Consolidate how overlays targeting the system and overlays targeting
regular applications are handled. Previously, system overlays were
handled as a special case. Now, everything is handled identically. As a
side effect, the call to idmap --scan during Zygote boot has become
obsolete and is removed.
Information on what overlays to use is recorded in
ApplicationInfo.resourceDirs. The PackageManagerService is responsible
for the creation of ApplicationInfo objects. The OverlayManagerService
is responsible for informing the PackageManagerService in advance about
what resourceDirs to use.
When launching an application, the ApplicationInfo is already populated
with up-to-date information about overlays.
When enabling or disabling an overlay for a running application, the
OverlayManagerService first notifies the PackageManagerService about the
updated resourceDirs. It then tells the ActivityManagerService to push
the new ApplicationInfo object to the application's ActivityThread.
Finally the application requests its ResourcesManager to create new
ResourcesImpl objects based on the updated paths.
Change-Id: Ib8afa05ccab4e2db558f89ce4423983c086bb61a
Co-authored-by: Martin Wallgren <martin.wallgren@sonymobile.com>
Signed-off-by: Zoran Jovanovic <zoran.jovanovic@sonymobile.com>
Bug: 31052947
Test: run tests from 'OMS: tests for OverlayManagerService'
A split may be declared in an application's base manifest, but,
defined in a feature split. When resolving such a component,
invoke the installer to download and install the necessary split(s)
At the moment, this only works for instant apps. However, the
implementation is generic and could be applied to any application.
Bug: 25119046
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: I6598abb34becfd049fc03199813226736e5057b1
CP2 will need it to scan GAL providers faster.
Test: Manual test with CP2 under development
Bug: 35388445
Change-Id: I1202420078b1bbe48f6eb4bb9e3f705c71df9c0c