Commit Graph

5166 Commits

Author SHA1 Message Date
TreeHugger Robot
5a7c7b8e53 Merge "Remove FastJNI optimization on AssetManager to avoid dead lock." 2017-03-01 22:06:17 +00:00
TreeHugger Robot
fb64de06cd Merge "Use context's userId in ContentResolver class." 2017-03-01 21:49:30 +00:00
Sudheer Shanka
b4e2ddde4f Use context's userId in ContentResolver class.
- 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
2017-03-01 12:03:10 -08:00
Tim Zhang
fe25b1adaf Remove FastJNI optimization on AssetManager to avoid dead lock.
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
2017-03-01 10:05:19 -08:00
Nathan Harold
9ac082f8bb Merge "Add API Surface for creating IpSec Transforms" am: 7645fa2816 am: 0a6305d5dd
am: 3ddaf3e6b0

Change-Id: Idceae0e5a1af2f357378b03fc0d257dab605b217
2017-03-01 14:22:57 +00:00
Nathan Harold
0a6305d5dd Merge "Add API Surface for creating IpSec Transforms"
am: 7645fa2816

Change-Id: Ibe70a60c5c5808a7877145cccefcc1f11bfacc51
2017-03-01 14:12:55 +00:00
Nathan Harold
330e1089da Add API Surface for creating IpSec Transforms
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
2017-02-28 22:01:20 -08:00
TreeHugger Robot
1b4cdf909f Merge "Add boolean when instant apps are available" 2017-03-01 01:49:07 +00:00
Todd Kennedy
32e075de37 Merge "fix typo" 2017-03-01 00:25:04 +00:00
Todd Kennedy
bcdaf9208c fix typo
Fixes: 35840741
Test: None; it's a javadoc fix
Change-Id: Ic59fe12351c24630d7ba18ffaafeef8035be35f5
2017-02-28 16:21:03 -08:00
Sunny Goyal
e19e5677a5 Merge "Sending explicit broadcast to the launcher when a package is installed" 2017-02-28 23:58:38 +00:00
Todd Kennedy
533c9ff58d Add boolean when instant apps are available
Bug: 34168547
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Ic1072d02aa4d43947e689e4381c2c5ee43704dd0
2017-02-28 15:34:26 -08:00
TreeHugger Robot
a7aaae881c Merge "Delete ParcelableString, add StringParceledListSlice" 2017-02-28 22:09:06 +00:00
Sunny Goyal
6d7cb23236 Sending explicit broadcast to the launcher when a package is installed
Test: Manually tested on device and add CTS tests
Bug: 32920609
Change-Id: Ic23c077a469fb41d6c4e123d4bc022899f634198
2017-02-28 12:55:59 -08:00
Robin Lee
abaa0695c5 Delete ParcelableString, add StringParceledListSlice
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
2017-02-28 18:07:08 +00:00
TreeHugger Robot
ee3aa6ceab Merge "Treat Telephony as legacy app for now." 2017-02-28 04:18:18 +00:00
Jeff Sharkey
2afae796de Treat Telephony as legacy app for now.
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
2017-02-27 15:58:27 -07:00
TreeHugger Robot
6087ea2b9d Merge "Provide some compatibility story for devs in the past" 2017-02-27 20:28:58 +00:00
TreeHugger Robot
1058a3dd95 Merge "Push chooser targets to the shortcut manager." 2017-02-27 20:24:57 +00:00
Makoto Onuki
9687767d75 Merge "Allow querying providers with a specific metadata." 2017-02-27 18:35:20 +00:00
Hakan Seyalioglu
58fc95dc57 Push chooser targets to the shortcut manager.
More info at go/direct-share-push

Test: Some basic testing currently in, more to be added.

Change-Id: I069f9779988c3eca2c4d8b83ec62501983854355
2017-02-27 09:39:10 -08:00
Jason Monk
bd9836496c Provide some compatibility story for devs in the past
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
2017-02-27 09:21:53 -05:00
Jeff Sharkey
4190575960 Merge "Delete @removed APIs that never shipped." 2017-02-27 01:45:44 +00:00
Makoto Onuki
e9cedbd281 Merge "Don't include Bitmaps in activity intents" 2017-02-25 01:15:35 +00:00
Chen Xu
f4854018a2 Merge "move ACTION_CARRIER_SETUP intent to public api"
am: fcb37ffc60

Change-Id: Iaa09a2c35a88d58a6c6df4122bf7f1f87bd7075e
2017-02-25 01:12:09 +00:00
Makoto Onuki
8abba3a641 Don't include Bitmaps in activity intents
Bug: 35515740
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutHostTestCases

Change-Id: Ibb94728eb03997bb850b08c61c756f283bd90a08
2017-02-24 15:37:38 -08:00
Jeff Sharkey
dd9bda81f6 Delete @removed APIs that never shipped.
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
2017-02-24 13:41:20 -07:00
TreeHugger Robot
e44f60ec35 Merge "Require valid authorities for Uri notifications." 2017-02-24 20:26:33 +00:00
Jeff Sharkey
2140cd6431 Merge "Block new installs into ASEC containers." 2017-02-24 19:32:09 +00:00
TreeHugger Robot
4b2f751ebf Merge "Check EXTRA_INTENT as part of leaving process." 2017-02-24 18:49:24 +00:00
fionaxu
6a5ac3b922 move ACTION_CARRIER_SETUP intent to public api
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
2017-02-24 10:34:07 -08:00
Chen Xu
f73da9c7ed Merge "move ACTION_CARRIER_SETUP intent to public api" 2017-02-24 18:15:46 +00:00
Jeff Sharkey
912e80d345 Require valid authorities for Uri notifications.
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
2017-02-24 11:00:59 -07:00
Jeff Sharkey
c6fe23df52 Check EXTRA_INTENT as part of leaving process.
We're checking all the other Intent objects, but we forgot this one.

Test: builds, boots
Bug: 34072700
Change-Id: I4f328950f3122258e0bdea7e87f78d7d0afdedbb
2017-02-24 09:40:52 -07:00
Jeff Sharkey
8c61e39e04 Block new installs into ASEC containers.
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
2017-02-24 09:26:30 -07:00
TreeHugger Robot
08880f2ffa Merge "Delete some more @removed APIs." 2017-02-24 05:29:06 +00:00
Jeff Sharkey
4669098625 Delete some more @removed APIs.
Test: builds, boots
Bug: 25434584
Change-Id: I34d5a67c3c96ee0fbe2f2b8ef1327348a8bef04f
2017-02-23 20:24:48 -07:00
TreeHugger Robot
9584868f88 Merge "Add new internal resolve method" 2017-02-24 01:22:52 +00:00
fionaxu
adfe7009f2 move ACTION_CARRIER_SETUP intent to public api
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
2017-02-23 16:50:54 -08:00
TreeHugger Robot
8a362bb9a5 Merge "Fix mStringBlocks race in the AssetManager" 2017-02-24 00:42:02 +00:00
TreeHugger Robot
bd9e74cae0 Merge "OMS: integrate OverlayManagerService into framework" 2017-02-24 00:07:42 +00:00
Todd Kennedy
4d1de7da79 Add new internal resolve method
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
2017-02-23 15:38:55 -08:00
Jiaquan He
339dc75d46 Merge "Fix ColorStateList bug." 2017-02-23 23:14:00 +00:00
Johan Redestig
22723ffaba Fix mStringBlocks race in the AssetManager
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
2017-02-23 14:46:05 -08:00
Mårten Kongstad
2e0d0f3111 OMS: integrate OverlayManagerService into framework
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'
2017-02-23 14:01:38 -08:00
Todd Kennedy
e991022423 Load splits on-demand
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
2017-02-23 10:19:04 -08:00
Makoto Onuki
3275729203 Allow querying providers with a specific metadata.
CP2 will need it to scan GAL providers faster.

Test: Manual test with CP2 under development
Bug: 35388445
Change-Id: I1202420078b1bbe48f6eb4bb9e3f705c71df9c0c
2017-02-23 09:36:09 -08:00
Guang Zhu
df0824ad4c Merge "Revert "OMS: integrate OverlayManagerService into framework"" 2017-02-23 07:36:16 +00:00
Guang Zhu
9545980692 Revert "OMS: integrate OverlayManagerService into framework"
Bug: 31052947
Bug: 35697944

This reverts commit 21a3d1ad68.

Change-Id: I2d86931020301524c26cf8c8e80d557c97fdd6c3
2017-02-23 07:35:39 +00:00
TreeHugger Robot
0f09817859 Merge "OMS: integrate OverlayManagerService into framework" 2017-02-23 03:59:01 +00:00