1457 Commits

Author SHA1 Message Date
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
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
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
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
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
TreeHugger Robot
f51b4ff7b1 Merge "Make sure cleanup is always done when task is removed" 2017-01-06 21:00:19 +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
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
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
Nicolas Prevot
2ea46fe658 Make disallow add/remove managed profile restriction not global.
Otherwise: if the DO sets remove managed profile user restriction:
the profile owner of a managed profile cannot remove this managed
profile.

BUG:33854430
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I90b2028ea627a2073298bf9ef3c07b4fdf8d13a1
2017-01-05 11:58:21 +00:00
Narayan Kamath
8af18a6fa3 Merge "PackageParser: Add serialization mechanism for parse results." 2017-01-05 09:55:40 +00:00
Jeremy Joslin
0872235d4c Merge "Fix NetworkScoreServiceTest.testSystemRunning." am: 5b4aec1dc6 am: 01828eb244
am: b68823cab8

Change-Id: I19f5c7179a489e992356f141314582abc803ad2e
2017-01-04 23:02:45 +00:00
Jeremy Joslin
b68823cab8 Merge "Fix NetworkScoreServiceTest.testSystemRunning." am: 5b4aec1dc6
am: 01828eb244

Change-Id: I094906527e9baf20f6bcb844f261d0fdcb8f6aa6
2017-01-04 22:58:52 +00:00
Jeremy Joslin
01828eb244 Merge "Fix NetworkScoreServiceTest.testSystemRunning."
am: 5b4aec1dc6

Change-Id: Ic80d796221d94a092ed210dde3d1e3886d950265
2017-01-04 22:53:12 +00:00
Jeremy Joslin
b17a5edb65 Fix NetworkScoreServiceTest.testSystemRunning.
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33905890
Change-Id: Icc1db79cde26f1445ca925780ff760b7aa0515b1
Merged-In: Idc92fe3669b0efdb20d3899ce4ce7bae70033aff
2017-01-04 13:25:58 -08:00
TreeHugger Robot
a9d0cfbcc9 Merge "Always place stacks below pinned stack" 2017-01-04 19:48:32 +00:00
Eugene Susla
74c6cbaa63 Unit test to keep a11y cache critical events up to date
Unit test AccessibilityCache.CACHE_CRITICAL_EVENTS_MASK, introduced in Icbdb91803b646fa06aaf11996d350f6f65c1e809

Bug: b/32642665
Test: Ensure the introduced unit test passes
Change-Id: I60741c42334c61af8cd695e20c3a1f6be706824d
2017-01-04 11:45:08 -08:00
Makoto Onuki
86d1eb9b4b Get account features before taking lock (cherry-pick from master)
am: fd24353d75

Change-Id: I4d89f492d4186f14516f93be800a6548127be921
2017-01-04 18:59:55 +00:00
Sunny Goyal
a532c3ff8c Merge "AppWidgetManager: direct add widget support." 2017-01-04 18:21:38 +00:00
Andrii Kulian
cd5dcb8b3d Always place stacks below pinned stack
When positioning or adding stacks we must make sure
that no stack is above pinned stack.

Bug: 34049027
Test: runtest frameworks-services -c com.android.server.wm.TaskStackContainersTests
Change-Id: Ic92a4e07e9cde42deed53912ac1419fde4ab2f08
2017-01-04 09:56:27 -08:00
Makoto Onuki
fd24353d75 Get account features before taking lock (cherry-pick from master)
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 CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.AccountCheckHostSideTest
* without having Id49f2bd5dfa80ecf35b3a23c789100ade38c2656 *

Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w com.android.frameworks.servicestests

Bug: 33481725
Change-Id: Ie2fe9aea87d1a7167581f4cd74ae063ef24a4567
Merged-in: I1e4dd9701a76ca366f86fdaf2fc6c282e9dbe5c1
2017-01-04 09:04:09 -08:00
Makoto Onuki
9bab1c4dd5 Merge "Get account features before taking lock" 2017-01-03 21:34:41 +00:00
Sunny Goyal
87a563e070 AppWidgetManager: direct add widget support.
Test: Manual test and all the unit tests:
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to test9
adb shell am instrument -e class com.android.server.appwidget.AppWidgetServiceImplTest -w com.android.frameworks.servicestests

Bug 32404406
Change-Id: Icd6d4cbd25d9cdf4508da725d95d6401cc3a46a7
2017-01-03 13:28:56 -08:00
Makoto Onuki
606da7778f Get account features before taking lock
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 CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.AccountCheckHostSideTest
* without having Id49f2bd5dfa80ecf35b3a23c789100ade38c2656 *

Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w com.android.frameworks.servicestests

Bug: 33481725
Change-Id: I1e4dd9701a76ca366f86fdaf2fc6c282e9dbe5c1
2017-01-03 10:58:23 -08:00
Narayan Kamath
fb2afbf7fa PackageParser: Add serialization mechanism for parse results.
Also adds unit tests that assert that the cached value is equivalent
to the parsed value.

bug: 30792387
Test: PackageParserTest
Change-Id: Ibf6dfd1225243b436e3d7473170c2ccc31cfbbd7
2017-01-03 15:55:09 +00:00
Jeremy Joslin
586d36e610 Fix NetworkScoreServiceTest.testSystemRunning.
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33905890
Change-Id: Idc92fe3669b0efdb20d3899ce4ce7bae70033aff
2016-12-29 15:00:23 -08:00
Andrii Kulian
77b165f0af Merge changes I2ac2cdba,I6ade7874
* changes:
  Fix crash when removing a display with activities
  Add positionChildAt method to WindowContainer
2016-12-28 20:41:34 +00:00