1532 Commits

Author SHA1 Message Date
TreeHugger Robot
317d0c9887 Merge "Send Snooze callback for Assistant" 2017-01-12 20:54:52 +00:00
Julia Reynolds
7967230de2 Send Snooze callback for Assistant
On selection of a snooze context SnoozeCriterion.

Test: runtest systemui-notification & make cts-verifier
Change-Id: Iaca567100c29295fbbf1d327195a114106909652
2017-01-12 10:40:11 -05:00
Jorim Jaggi
02886a82d8 Initial implementation of snapshots
All this functionality is hidden behind a flag. If this flag is
active, we disable the regular screenshots.

Instead, we take a screenshot when an app transition for which a
task is disappearing is starting. The screenshot gets stored
into a gralloc buffer. SystemUI uses a new method to retrieve
a snapshot gralloc buffer and then draws it using GraphicBuffer.
createHardwareBitmap().

When starting an existing activity in an existing tasks, or when
bringing an existing tasks to front from recents, we add a new
snapshot starting window. For that, we reuse the existing
starting window, but when creating the window, we use a fake
window that draws the contents of the starting window.

Test: runtest frameworks-services -c
com.android.server.wm.TaskSnapshotControllerTest
Bug: 31339431
Change-Id: If72df07b3e56f30413db5029d0887b8c9665aaf4
2017-01-12 16:28:01 +01:00
Pavel Grafov
dfbfca2015 Merge "Fix DevicePolicyManagerServiceMigrationTest." 2017-01-12 11:08:54 +00:00
Colin Cross
e399468b88 Remove libservicestestsjni
frameworks/base/services/tests/servicestests/jni no longer exists
after I993eeaa5dec001c39389023f355f506129b356e7, remove it.

Test: m -j FrameworksServicesTests
Change-Id: I8f307373aede9e749f1b992dde0f7252bf74b065
2017-01-11 15:57:24 -08:00
Phil Weaver
9fa89381bf Merge "Add flag and listener for a11y volume requests." 2017-01-11 21:57:09 +00:00
Pavel Grafov
feffb056e8 Fix DevicePolicyManagerServiceMigrationTest.
DISALLOW_ADD_MANAGED_PROFILE is enabled for device owners by default
and should be expected for device owner after migration.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
Change-Id: I8e1d8bcf84a242fa50985d4fed9c3c594e19451a
2017-01-11 20:51:49 +00:00
TreeHugger Robot
3c6f28aa59 Merge "Added TaskWindowContainerController" 2017-01-11 19:14:55 +00:00
Andrii Kulian
b6aa0cc60c Merge "Fix typo that caused excessive display config updates" 2017-01-11 18:47:00 +00:00
Wale Ogunwale
e1fe7fa288 Added TaskWindowContainerController
For linking TaskRecord in AMS to Task window container in WMS.

Bug: 30060889
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowContainerControllerTests
Test: bit FrameworksServicesTests:com.android.server.wm.TaskWindowContainerControllerTests
Test: Existing test pass and manual testing.
Change-Id: I16248f3e96e5087ba24198a48a3bd10a12ae76a6
2017-01-11 09:19:35 -08:00
Jorim Jaggi
d8f2268e3c Merge "Clean up starting window to prepare for saved surfaces" 2017-01-11 14:58:50 +00:00
Andrii Kulian
d68501e66d Fix typo that caused excessive display config updates
Applied incorrect configuration object while doing original
configuration refactoring.

Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Test: #testDisplayOverrideConfigUpdate
Change-Id: Ief5979feebb50f689b6cb532e1dba93e47dcbc40
2017-01-11 00:30:34 -08:00
TreeHugger Robot
917bb57021 Merge "Move getActiveScorerPackage() to the score service." 2017-01-11 00:11:28 +00:00
Makoto Onuki
460e9104d0 Merge "Allow adding target activity via requestPinShortcut()." 2017-01-10 23:37:19 +00:00
Makoto Onuki
255461f676 Allow adding target activity via requestPinShortcut().
Also now ShortcutManager tries to fill in the main activity as the target
activity if the caller has one.

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: Running: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases

Bug 34047091

Change-Id: I2bf2b20e94a2384cfa6e6b7d40d56cfe96a94fd9
2017-01-10 14:05:28 -08:00
Jeremy Joslin
6c1ca280b3 Move getActiveScorerPackage() to the score service.
Implemented getActiveScorerPackage() in the NetworkScoreService to
make it more efficient (no need to query PM).

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 33781558
Change-Id: I2144351c2c09cad30f80399069364f3572e38445
2017-01-10 13:08:32 -08:00
Jeremy Joslin
134c9d3311 Moved isCallerActiveScorer() to the score service.
Implemented isCallerActiveScorer() in the NetworkScoreService to make
it more efficient (no need to query PM). Exposed the call as a new
internal API on NetworkScoreManager and deprecated the call on
NetworkScorerAppManager.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 33781558
Change-Id: I0e2142af95b068d322343f7c9362ac53d46b545e
2017-01-10 10:52:56 -08:00
TreeHugger Robot
558097a03b Merge "Cleanup test method names." 2017-01-10 18:35:44 +00:00
Jorim Jaggi
ba41f4b9e3 Clean up starting window to prepare for saved surfaces
- Move all starting window logic to AppWindowContainerController
- Use startingView to hold any kind of contents for startingWindow
- Remove some conflicting code which looks very old and doesn't
apply anymore.

Test: Make sure starting window still works.

Bug: 31339431
Change-Id: I018dd013ab7e64a44932b6d54ae9bb4a47f315d3
2017-01-10 18:38:32 +01:00
TreeHugger Robot
7d63b2a9dd Merge "Additional unit tests for isProvisioningAllowed" 2017-01-10 17:32:57 +00:00
Jeremy Joslin
06d1fd7077 Cleanup test method names.
Renamed some test methods to reflect the proper permission.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 1764042
Change-Id: I5551ddcb411432c6aeb14c03d9a284aa68f1bd1b
2017-01-10 09:07:09 -08:00
Geoffrey Pitsch
9f7fd6c734 Merge "API improvements for creating NotificationChannels" 2017-01-10 16:20:13 +00:00
Nicolas Prevot
c3bd7b78d8 Additional unit tests for isProvisioningAllowed
Test it with disallow add / remove managed profile user restrictions.

BUG:32629873
Test: adb shell am instrument -e class
com.android.server.devicepolicy.DevicePolicyManagerTest -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ic6b01c2b0ed9081204801a6c5719b0fd25eafbba
2017-01-10 16:08:47 +00:00
Jeff Sharkey
8dedad31f7 Wire up storage stats API to installd.
Now that installd has the implementation details we need, we can wire
up the public APIs to use them.

Shuffle APIs around a bit so that StorageStats can be reused for both
UID and UserHandle results, and rename StorageSummary to
ExternalStorageStats.  Provide getTotalBytes() and getFreeBytes() as
first-class methods so we can answer those questions quickly without
paying the cost of measuring external storage details.

Current costs on a typical device with a test account after flushing
dentry caches:

queryStatsForUid() manual: 6922ms
queryStatsForUid() quota: 525ms

queryStatsForUser() manual: 1686ms
queryStatsForUser() quota: 113ms

queryExternalStatsForUser() manual: 42ms
queryExternalStatsForUser() quota: 2ms

For verification purposes, a new "fw.verify_storage" system property
can be set to compute both manual and quota statistics, and log any
discrepancies.

Test: builds, boots
Bug: 27948817, 32206268
Change-Id: I4ea3df3372a7379aa8cf4c20c44120c8f0702c15
2017-01-09 22:30:58 -07:00
Jeff Sharkey
bd439dcef0 Merge "Methods to calculate user and external disk usage." am: 6a9ad14172 am: 7beb2b75a9 am: 669affdb8e
am: 91b91b7f86

Change-Id: I7859db9f53560ad602bb26f37854bdfc02f15d09
2017-01-10 04:52:50 +00:00
Jeff Sharkey
91b91b7f86 Merge "Methods to calculate user and external disk usage." am: 6a9ad14172 am: 7beb2b75a9
am: 669affdb8e

Change-Id: I698dd15a397f16dd2358729362860443f7e81a33
2017-01-10 04:47:47 +00:00
Jeff Sharkey
669affdb8e Merge "Methods to calculate user and external disk usage." am: 6a9ad14172
am: 7beb2b75a9

Change-Id: I236eb3357b597cac26f5234a72551a471919a411
2017-01-10 04:42:52 +00:00
Jeff Sharkey
7beb2b75a9 Merge "Methods to calculate user and external disk usage."
am: 6a9ad14172

Change-Id: Ie4ab045a5425b35ce1bdd245f7c6ab248c796df2
2017-01-10 04:38:15 +00:00
Jeff Sharkey
82ca90171f Methods to calculate user and external disk usage.
Add method to calculate user disk usage, which will be faster than
making a Binder call for every single appId under a user.  Add method
to calculate external disk usage, which uses file extensions to track
usage with "audio", "video", and "images" categories.

Start measuring internal and external storage space separately; new
GIDs are coming in a future CL.  Pass down all package names, inodes,
and code paths, since shared UIDs host more than one.

Test: builds, boots, stats are consistent
Bug: 27948817, 32206268
Change-Id: Icbb82a30fe711ef05e9a16bb1dc740dc943a9ddc
2017-01-09 17:00:38 -07:00
Eugene Susla
2ddcb077ac Merge "Unit test to keep a11y cache critical events up to date" 2017-01-09 22:59:39 +00:00
Jeremy Joslin
6cf53d0ab8 Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED." am: 4c456d7ddf am: 542aad4c75
am: f91d9debef

Change-Id: I7436278fa3eab064fe2b416c672bedaa300eb501
2017-01-09 21:17:17 +00:00
Jeremy Joslin
f91d9debef Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED." am: 4c456d7ddf
am: 542aad4c75

Change-Id: I3b35ec04e65f6b14f75f266dfcf15c10a12a4d74
2017-01-09 21:07:48 +00:00
Jeremy Joslin
542aad4c75 Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED."
am: 4c456d7ddf

Change-Id: I441cae5096b922419763832d5b38faa95818e337
2017-01-09 20:58:50 +00:00
Jeremy Joslin
186f3339ab Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED.
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33752149
Change-Id: I3dd352c98bbc34b128ab9c2a28f81e1261ae2669
Merged-In: I7d91fa9a4f6ef4f9170c6af98567ce443c805e74
2017-01-09 11:03:21 -08:00
Julia Reynolds
6eb2857ee2 Merge "Cannot have badge only channels" 2017-01-09 14:59:50 +00:00
Jeremy Joslin
5519d7cf71 Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED.
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33752149
Change-Id: I7d91fa9a4f6ef4f9170c6af98567ce443c805e74
2017-01-06 15:42:57 -08:00
Fyodor Kupolov
51d34bf06a Merge "Always use multi-dex for FrameworksServiceTests" 2017-01-06 21:45:11 +00:00
Fyodor Kupolov
c0c1123124 Always use multi-dex for FrameworksServiceTests
Otherwise it exceeds ids limit:
ERROR: Dex writing phase: classes.dex has too many IDs. Try using multi-dex

Test: manual - device builds, tests are running
Change-Id: I042cd1b8cb8d41c8db055ba8c6ceb56eb592c30f
2017-01-06 13:36:40 -08:00
Makoto Onuki
2e83edb4b0 Merge "Revert "ShortcutManager: Floating shortcuts shouldn't have target activities."" 2017-01-06 21:32:35 +00:00
Geoffrey Pitsch
0353371529 API improvements for creating NotificationChannels
Remove listener for aysnchronous operation.
Allow multiple channel creation from a single call.
Silently no-op for creating existing channels.

Test: runtest systemui-notification
Change-Id: Ibc1340d21efa0c12d126bee437adcbb99141e86a
2017-01-06 16:13:04 -05:00
TreeHugger Robot
f51b4ff7b1 Merge "Make sure cleanup is always done when task is removed" 2017-01-06 21:00:19 +00:00
Julia Reynolds
aebfc4e7a3 Cannot have badge only channels
Test: runtest systemui-notification & cts
Change-Id: I256e35a79400c1d25b3d2f1c7c5f8c513242a2aa
2017-01-06 15:56:44 -05:00
TreeHugger Robot
a8d123de10 Merge "Support for WindowContainer controllers and listeners" 2017-01-06 20:07:31 +00:00
Makoto Onuki
9fd9019cf1 Revert "ShortcutManager: Floating shortcuts shouldn't have target activities."
This reverts commit 106ff7a0a1bef974ff04e9e79a25eb5e84555893.

Test: All the unit tests (ShortcutManagerTest1*) CtsShortcutHostTestCases and CtsShortcutManagerTestCases

Change-Id: Iadce2b3785cbf728daa60c4e2ff103e516d85896
2017-01-06 11:17:08 -08:00
Andrii Kulian
45a61fe529 Make sure cleanup is always done when task is removed
When Stack#removeImmediately() was called it also recursively
called Task#removeImmediately(), which remove tasks from stack.
This lead to Task#mStack reference being nullified, but task
dim layer user was still registered in DimLayerController.
Therefore there was a crash when dim layer animation occured.

This CL moves most of the logic from Task#removeIfPossible() to
Task#removeImmediately() to make sure that cleanup is performed
every time when task is removed.

Change-Id: Id8d72dc8c66b9eeefbf5c918cf0a0df4ea027fde
Fixes: 34052466
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackTests
Test: #testStackRemoveImmediately
2017-01-06 11:06:19 -08:00
Phil Weaver
4acc16d1b6 Add flag and listener for a11y volume requests.
We're adding a dedicated volume level for accessibility. Services
can use the new flag to request that this volume be activated for
accessibility usages.

To let AudioManager know when the request state changes, adding a
hidden convenience method to check if any active service requests
the a11y volume stream. This method can be used to enable the
stream and to decide when to show the UI to change its volume.

AudioManager wanted a listener for changes to this flag, so rather
than add yet another special-purpose listener, I've added one that
gets called back whenever there are state changes in a11y services.
These changes happen infrequently enough that we shouldn't need
more targeted methods.

Bug: 30448020
Bug: 27899567

Test: Adding CTS in linked CL.
Change-Id: Ifc53314dc7d9a6ee3d50b04ebcc1a87280cafa5e
2017-01-06 09:38:53 -08:00
Wale Ogunwale
26c0dfed7a Support for WindowContainer controllers and listeners
- WindowContainerController class allows a component outside window manager
to create a window container and communicate directly with it to make
changes. For example, the ActivityRecord class in activity manager uses the
AppWindowContainerController class to create and communicate with
AppWindowToken window container class which is its counterpart on the window
manager side.
- WindowContainerListener interface allows a component outside WM to get
notified of changes to a window container. For example, the ActivityRecord
class in AM implements the AppWindowContainerListener interface to get
notified of changes to the AppWindowToken container.

Bug: 30060889
Test: Existing tests pass and manual testing.
Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerControllerTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests
Change-Id: I2896bfa46a80b227052528c7da8cf4e56beab4bc
2017-01-06 09:11:02 -08:00
Julia Reynolds
f35e3976e3 Allow apps to enable notification badging.
Test: runtest systemui-notification
Change-Id: Ia16d671d864d1eee902652e31f023e30dc6b7387
2017-01-06 10:57:51 -05:00
Narayan Kamath
5c50e86301 PackageManagerService: Implement packageParser cache in ParallelPackageParser.
We save about 2800ms of cold startup time over baseline on a marlin,
and ~1200 ms over the parallel parsing case.

                   warm     cold
		   ---------------
Baseline         : 1700ms   4300ms
Parallel         : 1400ms   2700ms
Cache            : 1000ms   1600ms
Cache & parallel : 900ms    1500ms

Note that further changes will improve the speed of cache processing.

This change also includes support for :
- a flag that been flipped in code (currently set to false).
- disabling the cache via a system property.
- wiping the cache on system upgrades.
- cache versioning.

Bug: 30792387

Test: FrameworksServicesTests
Test: manual timing

Change-Id: I281710c110af5307901dd62ce93b515287c91918
2017-01-05 19:15:31 +00:00
Nicolas Prévot
b4413f694f Merge "Make disallow add/remove managed profile restriction not global." 2017-01-05 14:54:45 +00:00