Commit Graph

11640 Commits

Author SHA1 Message Date
Calin Juravle
3bec94d78b Use the class loader context when optimizing secondary dex files
Record the class loader context for secondary dex loads and pass it to
dexopt during compilation.

The class loader context is passed from libcore every time a
BaseDexClassLoader is created and its recorded in the package dex usage
file.

Note that the context may be:
- unknown: if the dex file was not use after the the upgrade and its
context was not yet updated
- unsupported: if any of the class loaders from the loading context is
unsupported (only PathClassLoader and DelegateLastClassLoader are
supported).
- variable: if it changes over time, form one run to another.

In all the above cases the old compilation behavior is preserved for
now.(i.e. the dex file with be compiled with SKIP_SHARED_LIBRARY_CHECK)

Bug: 38138251
Test: runtest -x
services/tests/servicestests/src/com/android/server/pm/dex/
      adb shell cmd package compile -f -m quicken ^Csecondary-dex
com.google.android.gms

Change-Id: I2486522fb811f9fc58a44b92642f43a41e7d5bac
2017-07-24 14:51:00 -07:00
Geoffrey Pitsch
3fe668a015 resolve merge conflicts of 180f4ee7f7 to master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ic6a7751e75899c5faf32bb2b392fa623d6482e7b
2017-07-21 10:35:11 -04:00
Geoffrey Pitsch
07532c3f79 Allow apps to downgrade importance in createNotificationChannel
Only takes effect if the user has not changed any fields.
Some tangential cleanup of the test file:
 - Rename member variable "uid" to "mUid"
 - Use correct PKG instead of "test_pkg"
 - Some character limit fixes

Test: runtest systemui-notification
Fixes: 63755460
Change-Id: I3c2df0c03ec333f320ac7a0fe90792f1b0ef02ce
2017-07-20 12:45:30 -04:00
Andrii Kulian
8d5a505d6a Merge changes from topic 'activity_view_v2'
* changes:
  VirtualDisplay wrapper with input forwarding
  ActivityView be gone!
2017-07-20 15:48:26 +00:00
Selim Cinek
4de4de3fa3 Merge "Reducing bitmap sizes in notifications" 2017-07-19 23:37:32 +00:00
TreeHugger Robot
d2eb1035ef Merge "Fix Fragment.onCreate() not being called in some cases." 2017-07-19 22:15:24 +00:00
Andrii Kulian
ed76e7473f VirtualDisplay wrapper with input forwarding
New version of ActivityView that doesn't use expensive
ActivityContainer, but utilizes VirtualDisplays instead.

Creation of this view is only allowed for callers who have
android.Manifest.permission.INJECT_EVENTS permission.

Launching activities into this container is restricted by
the same rules that apply to launching on VirtualDisplays:
- Owner is allowed to launch its own activities.
- If activity that's being launched is not from the same
  app, then it must be embeddable and launcher must have
  permission to embed.

Bug: 63338670
Test: go/wm-smoke
Change-Id: Id9a25752367ebe8e59d2fc21c5d9de5cf597ea01
2017-07-19 14:52:06 -07:00
Selim Cinek
d0426628f6 Reducing bitmap sizes in notifications
Bitmap sizes could be arbitrary large when they were sent
over to the system. We're now reducing them to reasonable
sizes.s

Also fixed that notification bitmaps were not put into
ashmem anymore since it got lost in a refactor.

Test: code inspection
Bug: 62319200
Change-Id: I87db7656e749666b9eab1f67fd497f155c407e18
2017-07-19 11:05:26 -07:00
George Mount
15c21ffad9 Fix Fragment.onCreate() not being called in some cases.
Bug 62798751

When an application process has been killed with a retained instance
fragment on its back stack, and a configuration change causes
state save, the retained instance fragment was not calling onCreate()
when it was popped back into existence.

The cause of the problem is that the mRetaining flag was being set,
and when it was supposed to go through onCreate(), it was skipped.
This CL uses a new flag to judge whether or not a Fragment has
called onCreate() or not.

Test: I512f8c174f557ee7ed18a9b9dc5c0c3e7a5843a5
Support Lib Change: Ia66a1f474d815f657b6962097139c796f7fa198b

Change-Id: Ia7878f4ac67ee8cfa05903ba6749ab9851f603ee
2017-07-19 10:51:17 -07:00
Philip P. Moltmann
907ebe9a9f Merge "Make SharedPreferences check with higher precision" 2017-07-19 17:33:44 +00:00
Philip P. Moltmann
ffe74357ae Make SharedPreferences check with higher precision
When two processes modify shared preferences we use the timestamp to
figure out if the file was changes underneath. Do this with the highest
precision available (instead of sec) as before.

It would be possible to make the check more reliable by writing a unique
id to the shared pref file, but this would make this check much more
expensive in the common case that nothing changed. Considering that this
has not been a problem and we don't officially give any guarantee for
this sounds like a good middle-ground.

Change-Id: I04c96b6a946618d5599c26410c88d7cd654d31fb
Test: SharedPreferencesTest
Fixes: 62949739
2017-07-19 15:04:12 +00:00
Romain Guy
371b743090 Merge "Put generated/compiled graphics code in getCodeCacheDir()" into oc-dr1-dev am: e00bcc0fef
am: 5a92a6e074

Change-Id: Iab42acc209b1fb31d56971eb69b0140eb99e227b
2017-07-19 01:06:34 +00:00
Romain Guy
5a92a6e074 Merge "Put generated/compiled graphics code in getCodeCacheDir()" into oc-dr1-dev
am: e00bcc0fef

Change-Id: I300fa41c30c64f22c47d164f3b6d6d698e34302f
2017-07-19 01:00:13 +00:00
Romain Guy
cecbe073bb Put generated/compiled graphics code in getCodeCacheDir()
A refactoring introduced a slight regression that caused compiled
shaders to be cached in the wrong directory.

Bug: 63813783
Test: Manual
Change-Id: I863e584ff1df4cda9242c64afd643a899023ee1c
2017-07-18 22:48:59 +00:00
Lucas Dupin
3698fc8ea6 Merge "Don't recycle bitmaps we don't own" into oc-dr1-dev am: bc907cf9a8
am: 11e0e33756

Change-Id: Ifcb92445f6e8cda2a2c9eb4350be65937ea5787b
2017-07-18 20:34:49 +00:00
Lucas Dupin
11e0e33756 Merge "Don't recycle bitmaps we don't own" into oc-dr1-dev
am: bc907cf9a8

Change-Id: Ib5533fdbcfba36fc1ed82e0089cc681e73a02f05
2017-07-18 20:24:53 +00:00
TreeHugger Robot
bc907cf9a8 Merge "Don't recycle bitmaps we don't own" into oc-dr1-dev 2017-07-18 20:08:58 +00:00
Charles He
3673863f3b Opt-out for always-on VPN
Always-on VPN is a feature introduced in N. Since then, all VPN apps
targeting N+ are assumed to support the feature, and the user or the DPC
can turn on / off always-on for any such VPN app. However, a few VPN
apps are not designed to support the always-on feature. Enabling
always-on for these apps will result in undefined behavior and confusing
"Always-on VPN disconnected" notification.

This feature provides a new manifest meta-data field through which a VPN
app can opt out of the always-on feature explicitly. This will stop the
always-on feature from being enabled for the app, both by the user and
by the DPC, and will clear its existing always-on state.

A @hide API is provided to check whether an app supports always-on VPN.
Documentation is updated to reflect the behavior change.

Bug: 36650087
Test: runtest --path java/com/android/server/connectivity/VpnTest.java
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedDeviceOwnerTest#testAlwaysOnVpnUnsupportedPackage'
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedDeviceOwnerTest#testAlwaysOnVpnUnsupportedPackageReplaced'
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackage'
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackageReplaced'
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackage'
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackageReplaced'

Change-Id: I477897a29175e3994d4ecf8ec546e26043c90f13
2017-07-18 00:55:38 +01:00
Neil Fuller
34aca9e2c5 Merge "Remove TODOs that are not needed" am: 0f9842304a am: 5c2cfc51c5
am: 444616f4bf

Change-Id: I5f4265d738aa3669a0c7acb8df49b454a3e27f9c
2017-07-17 22:40:28 +00:00
Neil Fuller
444616f4bf Merge "Remove TODOs that are not needed" am: 0f9842304a
am: 5c2cfc51c5

Change-Id: Ia585380cb88829bf55171092389b77081d941f17
2017-07-17 22:32:38 +00:00
Neil Fuller
5c2cfc51c5 Merge "Remove TODOs that are not needed"
am: 0f9842304a

Change-Id: Ie46a57ce88e25e40193b073c0add69adccc14a79
2017-07-17 22:24:36 +00:00
Neil Fuller
a9f0eeb36f Remove TODOs that are not needed
Remove TODOs to add classes to the system API that are not needed
(since they are used by a platform-only app).

Bug: 31008728
Test: make droid
Change-Id: I0d75686ddeae929e9d87c5ca8703a609a1450d76
Merged-In: I600e7b08853b86b27463193411cf85207ae09ce8
2017-07-17 17:57:11 +01:00
TreeHugger Robot
ba85991139 Merge "Add TimeZoneRulesDataContract to system API" 2017-07-17 16:44:47 +00:00
Lucas Dupin
42acf6009a Don't recycle bitmaps we don't own
WallpaperColors#fromBitmap should only recycle the bitmaps
created by itself.

Test: runtest -x tests/Internal/src/android/app/WallpaperColorsTest.java
Fixes: 63758291
Change-Id: I1710bf7118b6ae871442f9606f95ac9c9dbb7d24
2017-07-17 16:35:29 +00:00
TreeHugger Robot
080838c0a4 Merge "Test if allocation supported; @removed clean up." 2017-07-16 05:18:36 +00:00
Jeff Sharkey
4233f032fd Test if allocation supported; @removed clean up.
SM.allocateBytes() doesn't offer a clear way to detect if a failed
request could ever succeed.  (For example, we can never work with
pipes, or files on an unsupported storage device.)  So give
developers a first-class API to test if allocation is supported.

If the underlying filesystem doesn't support fallocate(), fall back
to ftruncate() instead of failing completely.

Clean up @removed APIs that were refactoring during API 26 review
process.

Remove support for storing downloads on the /cache partition, which
doesn't exist on many devices.

Bug: 63057877
Test: bit DownloadProviderTests:*
Test: bit DocumentsUITests:com.android.documentsui.services.CopyJobTest
Test: bit DocumentsUITests:com.android.documentsui.services.MoveJobTest
Change-Id: I85d42a1a7240034b4f2a6f359011ac182bdce36e
2017-07-15 21:08:56 -06:00
Andrii Kulian
b1cdb10e7c ActivityView be gone!
This hidden functionality is no longer support/needed since
we now have multi-window/display. A new view group class
will be added later that uses multi-window to support remaining
functionality of this class.

Test: go/wm-smoke
Change-Id: Ie2fa2de92841d33199da9988741905060dd1ddf4
2017-07-14 23:27:12 -07:00
TreeHugger Robot
213d919f85 Merge "Don't crash when external storage is unmounted" 2017-07-15 01:09:46 +00:00
Christopher Tate
11179b40c6 Don't crash when external storage is unmounted
In particular, don't NPE if an app calls getExternalFilesDir() while
external storage is unmounted.  We were making assumptions about the
length of the array returned by the "tell me about all the external
locations" method, but in unmounted cases that array can be zero-sized.

(And similar for getObbDir() and getExternalCacheDir().)

Bug: 63604311
Test: manual
Change-Id: I4dec828161245047182e6fd39a0df10dd1681ba2
2017-07-14 16:00:36 -07:00
Jason Monk
0218d3fe06 Merge "Fix crash in monodroid apps" into oc-dr1-dev am: 3d80a73350
am: a6ef052f59

Change-Id: I098cd1c8d3ecf9c264a9720db226e123b6b7170f
2017-07-14 19:45:04 +00:00
Jason Monk
a6ef052f59 Merge "Fix crash in monodroid apps" into oc-dr1-dev
am: 3d80a73350

Change-Id: If80299af64fac8138e4cf9b681ebed13e09b8ccf
2017-07-14 19:35:18 +00:00
TreeHugger Robot
d066fa9b96 Merge "Fix typos in onProfileProvisioningComplete javadoc" 2017-07-14 18:22:57 +00:00
Jason Monk
0b06d4e0ba Fix crash in monodroid apps
Don't getApplicationContext if we already have an application.

Test: launch a monodroid app
Change-Id: I0c1558463053de3db0f1cd4693088e7c639ce5fa
Fixes: 63666480
2017-07-14 13:23:58 -04:00
Julia Reynolds
1cd8e1e3bf Merge "Fix system crash" into oc-dr1-dev am: 5a0958ed0b
am: e58e833819

Change-Id: I601238f6ced41633f5674d68a741fbdaeb3bb4a0
2017-07-14 13:55:30 +00:00
Julia Reynolds
e58e833819 Merge "Fix system crash" into oc-dr1-dev
am: 5a0958ed0b

Change-Id: Icd087a48c50670bc5a59c34a13ecb3df5d5529e2
2017-07-14 13:49:13 +00:00
Christopher Ferris
f003ae0f25 Merge "Implement dumpheap -m." 2017-07-13 20:10:47 +00:00
Julia Reynolds
0f17000fb3 Fix system crash
Change-Id: I47d6d79682bfe907544f9282c26e350576618ce2
Fixes: 63474899
Test: runtest systemui-notification
2017-07-13 11:35:46 -04:00
Kenny Guy
ac6e767bda Fix typos in onProfileProvisioningComplete javadoc
Test: make docs
Bug: 62697695
Change-Id: Ibdb9eae16639f9ff840241f83eb56d9c34bb0e45
2017-07-13 11:35:56 +01:00
Robert Berry
c2ecd9c336 Merge "Improve logging when restore fails to load Package Manager." 2017-07-13 08:43:02 +00:00
Yang Ren
363c238b5e Merge "Change Media Route Button animation images" 2017-07-13 00:03:51 +00:00
Christopher Ferris
8d652f8f7e Implement dumpheap -m.
Adds an option to dumpheap that calls mallocInfo and write the xml produced
to a file.

Bug: 36871013

Test: Run am dumpheap -m <FILE>, am dumpheap -n <FILE>, am dumpheap <FILE>
Test: and verified that they produce the correct data.
Change-Id: Ifb9e878ea621c7cacc3aa6e3a889c414681dee2d
2017-07-12 16:06:20 -07:00
Neil Fuller
baf1c3df80 Add TimeZoneRulesDataContract to system API
Add TimeZoneRulesDataContract to system API and remove
TODOs to add other classes that should not now be needed
in the system API (since they are used by a platform-only
app).

Bug: 31008728
Test: make droid
Change-Id: I600e7b08853b86b27463193411cf85207ae09ce8
2017-07-12 18:20:59 +01:00
Robert Berry
c4dd18c7fb Improve logging when restore fails to load Package Manager.
When the transport has no more packages to return, #nextRestorePackage()
returns RestoreDescription.NO_MORE_PACKAGES. Instead of logging that it had
been unable to get the package metadata, the code in BackupManagerService
was assuming that this was a valid package but one with an unexpected
package name, and hence logged a confusing error message.

Bug: 37695157
Change-Id: I75f2123d2bb062ad04003d7ef2a3a25d9661338c
Test: manual
2017-07-12 16:34:50 +00:00
yangren
d9125cf9df Change Media Route Button animation images
Bug: 34690983
Change-Id: Id68195fbba06102e8d860d89b8167400c8c8230f
2017-07-11 18:08:10 -07:00
TreeHugger Robot
0033e5f7b8 Merge "Protect FragmentManager from Menu calls while not CREATED." 2017-07-11 19:19:42 +00:00
George Mount
f558fa3bc2 Protect FragmentManager from Menu calls while not CREATED.
Bug 62673781

While the FragmentManager is not at least in the CREATED state,
it should not call any methods related to Menu to any of its
Fragments. This can happen after the FragmentManager has been
destroyed, but before the Activity has been replaced.

Test: I1357dcd5d6498a6d35552ee68a5fbda9de89b764
Support Lib Change: I6a34b5a95ad69190377eaa4afda041c6b9ef925b

Change-Id: I1a93812b7fa6be0d784d2160f8208939259698c8
2017-07-11 09:58:35 -07:00
Christine Franks
d019d4c315 Merge "Support demo mode and demo users" into oc-dr1-dev am: 2f87ca1637
am: b128d9cd77

Change-Id: I317aa17cefa918483aeec0cc58df89dd18f59472
2017-07-11 14:53:59 +00:00
Christine Franks
b128d9cd77 Merge "Support demo mode and demo users" into oc-dr1-dev
am: 2f87ca1637

Change-Id: I429ce9d2c273c9b093e2f9fe789d126a0b95f198
2017-07-11 14:47:35 +00:00
Dianne Hackborn
6de68dfa4e Merge "Fix issue #34471029: Don't allow audio use from background apps." 2017-07-11 10:03:24 +00:00
Christine Franks
361b825c0d Support demo mode and demo users
Bug: 62712426
Test: run cts -m CtsDevicePolicyManagerTestCases -t \
com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageEphemeralUser
and
run cts -m CtsDevicePolicyManagerTestCases -t \
com.android.cts.devicepolicy.DeviceOwnerTest# \
testCreateAndManageEphemeralUserFailsWithoutSplitSystemUser
and
runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest \
frameworks-services
Change-Id: I77a71a994fe0f4f1f8c5df7c4ccf493aafa8fefe
2017-07-10 17:49:42 -07:00