352862 Commits

Author SHA1 Message Date
Jorim Jaggi
b0fc817f28 Lock free app animations (7/n): Cleanup
- Make sure persister pausing is working
- Make sure Surface animation thread is being boosted
- Move all remaining fields from AppWindowAnimator and NUKE it,
also remove getAnimLayerAdjustment and do the z-boosting
directly on the AppWindowToken.

Bug: 64674361
Test: go/wm-smoke
Test: Inspect thread priorities before/during/after animations
Change-Id: Ie64c8231bcebd8536eab476ee9f2c51abf85480c
2017-12-27 15:49:55 +01:00
Jorim Jaggi
32fd84ace1 Lock free app animations (6/n): Move back-pressure to new animator
SurfaceFlinger was currently only back-pressuring the old
animation system. Move this to the new SurfaceAnimationRunner,
such that every animation frame is presented on screen.

Test: go/wm-smoke
Test: Insert 16ms sleep statement when applying transaction, make
sure animations are still smooth.
Bug:

Change-Id: I510d22c9c4359659e7a061a26b7adad9c265b734
2017-12-27 15:49:55 +01:00
Jorim Jaggi
2e3c31d092 Lock free app animations (5/n): Reimplement skip first frame
Test: go/wm-smoke
Test: Close app, inspect transition with WindowScope, make sure
first frame of animation is skipped
Bug:

Change-Id: I68c135621df47c50696e318c4394da36ce806922
2017-12-27 15:49:55 +01:00
Jorim Jaggi
988f66885c Lock free app animations (4/n): Implement thubmnail
Bug: 64674361
Test: go/wm-smoke
Change-Id: I8f25dae04b69613c93ccb5416c2cda2df6373103
2017-12-27 15:49:55 +01:00
Jorim Jaggi
980c9de976 Lock free app animations (3/n): Implement transfering animations
Test: go/wm-smoke
Bug: 64674361
Change-Id: I2170c31c1a95cea049bcc66978bb7737337503b3
2017-12-27 15:49:55 +01:00
Jorim Jaggi
f5f9e12146 Lock free app animations (2/n): Use SurfaceAninimator
This is the main CL that switches over from using the legacy
animation system to using the new SurfaceAnimator for app
window animations. Also moves applyAnimationLocked to
AppWindowToken.

AppWindowAnimator still has a bunch of state that needs to be moved
into AppWindowToken in future CL's.

Test: go/wm-smoke
Bug: 64674361
Change-Id: Ifc83cbac281ce0654ecd8a1c2ca9c24a4d87c1d1
2017-12-27 15:49:20 +01:00
Narayan Kamath
cbe06778dd WorkSource: Fix getAttributionUid.
We define it as the UID that initiated the work, and not the UID
performing the work.

Test: WorkSourceTest.
Bug: 62390666

Change-Id: I1583e3f24b492e3f11a1281215c066fedf489b5f
2017-12-27 14:40:52 +00:00
Tony Mak
90f203c544 Fix "You're using your work profile" toast is shown when launcher is
...in foreground

What's the problem:
getRecentTasks no longer returns home task. Check
RecentTasks.isVisibleRecentTask

Solution:
Instead of "fixing" getRecentTasks, use getLastResumedActivityUserId,
which is already used for the work profile icon in status bar.
Note that Keyguard is not an activity, so it won't change the value of
"last resumed activity user id". It should be more lightweight than
getRecentTasks anyway.

Test: Open any personal app -> screen off and on -> no toast
Test: Open any work app -> screen off and on -> observe toast
Test: Open any work app -> tap home -> scren off and on -> no toast

Change-Id: I1cc880bfa23017c9d2c5ad99d57e67b430aa4ac8
Fix: 70377375
2017-12-27 14:20:23 +00:00
Jorim Jaggi
94c38c5671 Lock free app animations (1/n): Get rid of mAllAppWindowAnimators
Test: go/wm-smoke
Bug: 64674361
Change-Id: If3d888184c99f9c43dd0dcb5455158e1dbca81c2
2017-12-27 15:05:57 +01:00
Robert Carr
44643c1a50 Pull back app transform and screen rotation transform.
App transform is removed in this CL for clarity but being
re-added in Ifc83cbac281ce0654ecd8a1c2ca9c24a4d87c1d1.

Test: go/wm-smoke
Bug: 64674361
Change-Id: Idb7d7409a25cff518540077c9e189eba6d92dc43
2017-12-27 15:05:57 +01:00
Robert Berry
bd086f1963 Add storage for snapshots in KeySyncTask
Test: adb shell am instrument -w -e package com.android.server.locksettings.recoverablekeystore com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I25a9d6999bec5639cc91532da1b42a8d1f911b79
2017-12-27 13:32:49 +00:00
Robert Berry
3ae5bea999 Fix broken generateAndStoreKey tests
Sorry, this was my fault. I thought I'd run them but obviously not.

Test: adb shell am instrument -w -e package com.android.server.locksettings.recoverablekeystore com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: Ic45d59774e0aced17ef205559b2791ba7f26eabe
2017-12-27 10:58:03 +00:00
Narayan Kamath
bbab9c4e28 Merge "Support WorkChains for WakeLock start / stop / change events." 2017-12-27 08:43:37 +00:00
Eliot Courtney
6c313d3224 Initialise Notification*Manager dependencies directly.
Currently, adding a new dependency to any of these classes means
updating the constructors of any subclasses, and the construction in the
corresponding SystemUIFactory classes and subclasses. In particular,
updating these in separate vendor/ projects is annoying. So, initialise
the dependencies using field initialisers. The downside is that it's
harder to notice circular Dependencys.

Bug: 63874929
Bug: 62602530
Test: runtest systemui
Test: Compile and run
Change-Id: I21d58d0cc0edeb6d53fb7b387c9baeec7bd80589
2017-12-26 17:22:15 +09:00
Eliot Courtney
4a96b36fd9 Remove NotificationPresenter#getEntryManager.
Instead, pass it along with calls to setUpWithPresenter.

Bug: 63874929
Bug: 62602530
Test: runtest systemui
Test: Compile and run
Change-Id: Icd60cf671b12b33d4565cc608c6141cd580c790e
2017-12-26 17:09:25 +09:00
Eliot Courtney
8f56b0e345 Change all mocks that are Dependencys to be properly injected.
If a class being unit tested is changed to Dependency.get() a dependency
rather than receiving it as an argument, the tests could break in subtle
ways. Make sure all mocked Dependencys are properly injected as test
dependencies.

Bug: 63874929
Bug: 62602530
Test: runtest systemui
Change-Id: I2b23a2ea0ac9067952624a5c302ca419685307ae
2017-12-26 16:57:15 +09:00
Eliot Courtney
2b4c3a08fc Split NotificationViewHierarchyManager out of StatusBar.
NotificationViewHierarchyManager handles bundling and unbundling of
notifications. In doing so, which notifications are parents/children of
the other can change. NotificationViewHierarchyManager makes sure the
view hierarchy of the notifications matches their grouping.

Bug: 63874929
Bug: 62602530
Test: runtest systemui
Test: Compile and run
Change-Id: Ia1c8ed75d4eb8df52897c5d6aa0713f8335b2a19
2017-12-26 16:43:53 +09:00
Eliot Courtney
a6d8cf294d Split NotificationEntryManager out of StatusBar.
NotificationEntryManager is responsible for the adding, removing, and
updating of notifications among other things, such as their inflation
and their interaction with other Notification*Manager objects.

Bug: 63874929
Bug: 62602530
Test: runtest systemui
Test: Compile and run
Change-Id: I56f8c524875900112cdf9f6120407b61e201172f
2017-12-26 15:33:31 +09:00
TreeHugger Robot
9f5ceae640 Merge "Document which sys services can be accessed by instant apps" 2017-12-26 04:13:15 +00:00
TreeHugger Robot
b743b067e5 Merge "Don't record audio if UID is idle - core framework" 2017-12-26 03:39:42 +00:00
Jake Wharton
c26b093ce5 Merge "Expose removeAt(int) for parity with other sparse collections." 2017-12-24 05:32:13 +00:00
Chad Brubaker
b6108d6210 Relax Instant Apps Settings whitelist enforcement
The strict whitelist of settings for Instant Apps is leading to too much
unintended breakage, remove the enforcement until better infrastructure
can be added to make sure settings that should be whitelisted are.

Bug: 71009655
Test: Coming in a follow up
Change-Id: Ie089dc26cec87207515d15ba881e1a0aa49a9c51
2017-12-23 20:13:52 -08:00
Svet Ganov
8f90bcc50a Document which sys services can be accessed by instant apps
This change documents that some system services are not available
to instant apps due to the restricted security sandbox they run in.
Also ensure that if target SDK is P WallpaperManager is null if the
backing system service cannot be looked up to be consistent with
the way other system services behave.

Test: Manual

Fixes: 70984822
Fixes: 69848394

Change-Id: I9aae884d5840c92136c7d713fac87e7732dc2642
2017-12-23 20:47:12 +00:00
Bo Zhu
584b923fb7 Write the integer given by setServerParameters() into SQLite DB
Change-Id: Icd8b40154560c600757d51ed4620d39fc07e494c
Test: adb shell am instrument -w -e package com.android.server.locksettings.recoverablekeystore com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
2017-12-23 00:18:00 -08:00
TreeHugger Robot
5a4d8a1d3c Merge "Add usagestats dump in case of test failure." 2017-12-23 04:09:33 +00:00
Svet Ganov
d223db316d Add infrastructure for running a11y tests in instant mode
This change adds a special flag when binding to a service to request
instant apps to be considered as well (assuming the caller has the
permission to see instant apps). This flag is scoped only for the
platform to use and is intended only for development and testing.
Specifically, we have a class of CTS tests that has tests plus service
in the same APK (accessibility, printing, autofill, any other plugin
based sub-system).

Instead of doing the tediuous work split all these into one APK with
tests and one with the services where the latter exposes a remote
interface to the former, we will be adding shell commands to the
dedicated sub-system to allow temporary binding to plugins provided
by instant apps. The goal is not validating the plugin behavious,
rather a working plugin is required to test app side funcionality.

This change adds a shell command to allow the a11y manager serivce
to bind to plugins provided by instant apps. This is required to
be able to run relevant CTS test cases in instant mode.

Test: cts-tradefed run cts-dev -m CtsAccessibilityTestCases
      cts-tradefed run cts-dev -m CtsAccessibilityServiceTestCases

Bug: 70978575

Change-Id: Ifced735a9a6e495747372dd8b00fdd64933a09c7
2017-12-23 02:36:46 +00:00
Jean-Michel Trivi
7be17d26e0 New intent for microphone mute change notification
AudioManager: define ACTION_MICROPHONE_MUTE_CHANGED.
AudioService:
 - broadcast intent when setMicrophoneMute() is called
   with FLAG_RECEIVER_REGISTERED_ONLY.
 - remove outdated (invalid) comments.

Bug: 70857126
Test: m -j ; make -j offline-sdk-docs ; make -j cts ; \
      cts-tradefed run cts-dev -m CtsMediaTestCases -t android.media.cts.AudioManagerTest#testMicrophoneMuteIntent

Change-Id: I7391522f0195d06592e4f853e9b672fdec66d37a
2017-12-22 18:32:05 -08:00
Sudheer Shanka
77c07fde10 Add usagestats dump in case of test failure.
And Increase the wait after turning on the screen so that
the state gets propagated through the system.

Test: atest services/tests/servicestests/src/com/android/server/net/ConnOnActivityStartTest.java
Change-Id: Ie2737cdc7959147f096e10739c1cf78fad669464
2017-12-22 18:20:22 -08:00
TreeHugger Robot
3cb35f3760 Merge "Moved logContextCommitted() logic to the handler..." 2017-12-23 01:22:35 +00:00
Malcolm Chen
0a1421d974 Merge "Add MetricsEvent ENUMS for "Mobile network" preferences." am: e4e5291743 am: 675839f0fa
am: e406983505  -s ours

Change-Id: I7908bfec8747c8298e37ba4139446c35d0be8794
2017-12-23 01:08:06 +00:00
Malcolm Chen
e406983505 Merge "Add MetricsEvent ENUMS for "Mobile network" preferences." am: e4e5291743
am: 675839f0fa

Change-Id: Ie4f70a3e95fe96d9b82488affa226d724a4e4278
2017-12-23 00:59:00 +00:00
Malcolm Chen
675839f0fa Merge "Add MetricsEvent ENUMS for "Mobile network" preferences."
am: e4e5291743

Change-Id: I504256eb76a94002678832ecb13a6ef12f7d3603
2017-12-23 00:50:25 +00:00
Malcolm Chen
ccc427426f Remove getIntWithSubId in TelephonyManager.
For multi-SIM case, getIntWithSubId would check if a Global.Settings
value doesn't exist for a specific SIM (for example mobile_data0),
it copies value from general one (mobile_data).

Test: Telephony unittests
Bug: 34351475
Change-Id: I870e6f3c193cf3bdeae22fe1a750b0a0ec782f9b
Merged-In: I870e6f3c193cf3bdeae22fe1a750b0a0ec782f9b
2017-12-23 00:45:35 +00:00
Treehugger Robot
e4e5291743 Merge "Add MetricsEvent ENUMS for "Mobile network" preferences." 2017-12-23 00:41:49 +00:00
Malcolm Chen
917b51fda7 Add MetricsEvent ENUMS for "Mobile network" preferences.
Bug: 34775714
Test: Manual
Change-Id: I71645de4f07d10c6c3772a6fef119dbdec2db8ef
Merged-In: I71645de4f07d10c6c3772a6fef119dbdec2db8ef
2017-12-22 23:18:59 +00:00
TreeHugger Robot
a444dd4fb8 Merge "Updating Batterystats version to 29." 2017-12-22 23:17:53 +00:00
Bookatz
857aaa5208 Splits AnomalyTracker into two files
Splits out DurationAnomalyTracker-specific functions into their own
subclass.

Test: the unit tests and CTS tests
Change-Id: Id6eb74d232b4a9c3a932d805d1ba3f0ba43a88b1
2017-12-22 15:05:31 -08:00
TreeHugger Robot
8cb4171633 Merge "Add key encryption to KeySyncTask" 2017-12-22 22:38:10 +00:00
Lei Yu
36a6537289 Merge "Read paired device After LocalBtManager is created" 2017-12-22 22:17:28 +00:00
TreeHugger Robot
d1dc3524f6 Merge "Add feature flag for security settings v2." 2017-12-22 21:49:35 +00:00
Qingxi Li
5405836497 Add API to get eUICC's OTA status
The function will return current eUICC's OTA status and requests calling
app has WRITE_EMBEDDED_SUBSCRIPTIONS.

Test: E2E
Bug: 37279356
Change-Id: I823ed7aa9d86530c4bebd4c0b1a00f0c607105ed
2017-12-22 13:48:35 -08:00
Kweku Adams
a8943cbae9 Updating Batterystats version to 29.
Bug: 70808931
Bug: 63813658
Bug: 62549765
Test: build Android
Change-Id: Ifc3e41d5189e9c21aaad82b13cf7ce7fbf39ade8
2017-12-22 13:21:06 -08:00
TreeHugger Robot
b9b1b17298 Merge changes I2266bfec,Id2d6cb6d,Ib18e7783
* changes:
  Change ContextHubTransaction Callback to Listener
  Adds a createClient method with no Executor argument
  Replace Handler with Executor in new APIs
2017-12-22 21:12:49 +00:00
TreeHugger Robot
17f831f0c5 Merge "Implement the DB table to store the recovery service's public key" 2017-12-22 21:12:27 +00:00
Joel Fernandes
dc40b9082a Merge "JankBench: make it build and run in Android build" 2017-12-22 20:23:48 +00:00
Joel Fernandes
b5fbd41b23 JankBench: make it build and run in Android build
JankBench is a tool heavily used for scheduler and graphics testing.
JankBench has been an android studio project and traditionally its APK
has been built outside of the Android tree using studio. This patch
makes it possible to build it using Android source tree without needing
studio.

Some library imports needed renaming and an xml file had a typo, also
resource IDs need to be 16-bits so I fixed that up. List fragments can't
be anonymous instantiations anymore so changed it to be non-anonymous.

Bug: 31544438
Test: Run all Jankbench benchmarks manually in the app.
Change-Id: Ib5e4351fcc72acdec20424ae30598c205e7803f7
Signed-off-by: Joel Fernandes <joelaf@google.com>
2017-12-22 20:23:30 +00:00
Andrii Kulian
ab71a93624 Merge "Fix object pool for lifecycler" 2017-12-22 19:48:35 +00:00
jackqdyulei
9ee9b39eb4 Move debug log summary to WifiUtils
This cl is the first step to clean up the AccessPoint.

Bug: 70983952
Test: RunSettingsLibRoboTests
Change-Id: I23b5b4bee6f4533ea7e59ede3dc9c66af80bf0b6
2017-12-22 11:42:40 -08:00
Bo Zhu
5b81fa66e8 Implement the DB table to store the recovery service's public key
Change-Id: Ic80469dd0a199aa45d353ee07d712310047fd428
Test: adb shell am instrument -w -e package com.android.server.locksettings.recoverablekeystore com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
2017-12-22 19:35:19 +00:00
TreeHugger Robot
550e8ec8fa Merge "Fixed RTL alignment issue in suggested language list" 2017-12-22 19:22:08 +00:00