Commit Graph

13831 Commits

Author SHA1 Message Date
Winson Chung
4f5c38b357 Merge changes I28f7ac47,If075675e into oc-dev
* changes:
  Fixing regression in Recents preloading.
  Adding cached value for current user for per-SysUI process components.
2017-05-19 19:18:54 +00:00
Jorim Jaggi
6c0aba7d4f Merge "Optimize latency when closing panel with animation" into oc-dev 2017-05-19 00:24:17 +00:00
Winson Chung
99a885b5d6 Merge "Workaround issue with pip overlay not hiding cleanly." into oc-dev 2017-05-18 23:15:35 +00:00
Winson Chung
39d9ae20a6 Merge "Fixing issue with double tapping PiP." into oc-dev 2017-05-18 23:15:01 +00:00
Winson Chung
ebe1ba1980 Fixing regression in Recents preloading.
- Changes in the CommandQueue callbacks resulted in the default
  implementation of preloadRecentApps() to be called instead of the
  actual implementation in the Recents component.
- Removing extraneous methods in the interface called from other parts of
  SystemUI.

Bug: 38390446
Test: Launch Recents, ensure that preloading is hit first on touch down on
      the button

Change-Id: I28f7ac47eafa76a53343505f3352760e6510c213
2017-05-18 16:03:11 -07:00
Winson Chung
ee69756d54 Adding cached value for current user for per-SysUI process components.
- Also ensuring that we don't do additional work for non-current users when
  the task stack changes.

Bug: 38390446
Test: Launch Recents in multiple users, ensure that it works and does not
      make a binder call to get the current user id

Change-Id: If075675edc3874d809bad30d0aa564a8e59771d3
2017-05-18 15:59:01 -07:00
Jorim Jaggi
e85f8eb0ca Merge "Fix ordering of notifying dismiss callback" into oc-dev 2017-05-18 22:25:51 +00:00
Jorim Jaggi
45e2d8faed Optimize latency when closing panel with animation
The interpolator we chose had a very slow easy out where it
generated out frame with mExpandedHeight=0.3 pixels. We add a
check there and stop the animation immediately if this happens.

Furthermore, we just use a simple post when closing the panel
to not add to much latency. The frame will be shown in any case
since we are already in animation/input callback, such that a post
will be executed after the frame has been sent to RT.

Test: Capture trace, unlock phone, make sure no delays
Change-Id: I9fc45f4b081bd6143da1ba99e9bc652a9f64e4a7
Fixes: 38294347
2017-05-19 00:04:59 +02:00
Winson Chung
13bd634262 Merge "Fix issue with deferred start of the background loader." into oc-dev 2017-05-18 17:18:58 +00:00
Winson Chung
bb23376439 Fixing issue with double tapping PiP.
- If a user taps the PiP quickly multiple times, you can hit a case where
  you expand the PIP, which triggers the re-registration of the
  InputConsumer, but doesn't disable touches until the pinned stack
  animation starts.  If the user taps in between that time, it can trigger
  a resizing of the stack what aborts the expand animation
- Also adding additional debugging logs

Bug: 37657050
Test: Quickly tap the PiP

Change-Id: Ib0088a3aa8e917aca3214c289a0787bdf7e66199
2017-05-18 10:01:17 -07:00
TreeHugger Robot
b114e4ff82 Merge "Optimize latency when unlocking phone" into oc-dev 2017-05-18 01:55:45 +00:00
Jorim Jaggi
5277deaa59 Fix ordering of notifying dismiss callback
Otherwise all unlocks will result in onDismissCancelled.

Also fixes a race condition bug where we call
reportKeyguardShowingChanged but we don't wait until the state is
updated. Then, we called onDismissSucceeded such that
KeyguardManager.isDeviceLocked would still return true. Fix this
by waiting for the message to be processed.

Note that delays shouldn't be a problem here as we are soon
calling reportKeyguardShowingChanged from the UiOffloadThread.

Test: KeyguardLockedTests
Change-Id: I0b312a5f02be3a3d1028d8bf0cd1b8e6a33476ce
Fixes: 38219395
2017-05-18 02:05:29 +02:00
Jorim Jaggi
e549a8d621 Optimize latency when unlocking phone
Latency when unlocking the phone regressed a bit for two reasons:
- For lockscreen -> app we now have to create a full starting
window containing the snapshot, while previously this was just
showing a surface.
- For lockscreen -> home, we can't use the saved surface anymore
because currently we don't support snapshotting translucent
activities. However, in the long term, we want home screen to be
more involved into transitions anyways, so we'll have to wait for
the first frame draw anyways.

However, crystal ball trainee developer Jorim added some
artificial latency in this transition 3 years ago, because he knew
that it is going to be an issue at some point so we have some
headroom to improve! Genius! On a more serious note, it was because
he didn't understand how to read systraces with binders involved (to
be fair, there was also no binder tracing).

Now, we can completely fix the introduces latencies above by
removing this latency of 100ms, and we are 30-70ms better than
before! However, this requires a lot of discipline in SystemUI.
Currently, the callback to dismiss Keyguard takes around 30ms. By
moving all non-essential binder calls of the main thread or to the
next frame, we bring this down to 5ms, such that window animation
and Keyguard animation starts about at the same time.

Test: Take systrace, unlock phone...profit!

Fixes: 38294347
Change-Id: I481fe4ecf358ed09f7142dd9e7ecd290b53c500c
Merged-In: I3ea672bc2eca47221bc6c9f3d7c56b6899df207d
2017-05-17 23:47:15 +00:00
Winson Chung
2349481d62 Merge "Fix call to get the current user id from a secondary SystemUI process." into oc-dev 2017-05-17 19:10:42 +00:00
TreeHugger Robot
22f8290879 Merge "Optimize App -> Recents" into oc-dev 2017-05-17 18:15:41 +00:00
Winson Chung
d664269d58 Fix call to get the current user id from a secondary SystemUI process.
- The secondary SystemUI process's KeyguardUpdateMonitor is not updated
  so we can't rely on it to get the current user id.

Bug: 38372598
Test: Switch users, launch some tasks, and switch back. Ensure that original
      tasks still exist

Change-Id: I26a7c70b5f7032a106dc1342c8b366e4797e8fa0
2017-05-17 10:47:36 -07:00
Selim Cinek
63e8bfe1c5 Merge changes I858017b8,Ife32b600 into oc-dev
* changes:
  Improved the media color extraction algorithm
  Fixed broken coretests
2017-05-17 15:59:07 +00:00
Jorim Jaggi
ef496ea80d Optimize App -> Recents
- Use same strategy to draw thumbnail bitmap by moving
startActivity off from the main thread and start caching the future
when AM is busy executing startActivity.
- Move some binder calls off the main thread.
- Add some trace points for better analysis in the future.
- Make toggleRecentApps asynchronous so we don't have to wait on
the next app-vsync - it's totally not needed.

Test: com.android.apptransition.tests.LatencyTests

Fixes: 32668632
Change-Id: Id6483e26e9d6c1e319bceaa8268da976cedfbca3
Merged-In: I15db41f2e821779972ab3b430033c70aa1dfd907
2017-05-17 14:16:57 +02:00
Winson Chung
9f69b78eb3 Workaround issue with pip overlay not hiding cleanly.
- We were just finishing the activity which was causing issues with the
  wrong app transition being applied.  We actually can just hide the menu
  activity first before finishing it like we do elsewhere.

Bug: 38222481
Test: Open PiP, launch to show assistant

Change-Id: I348f8a17f76006bcef46fe01c87deae0b89f6586
2017-05-16 17:00:36 -07:00
Winson Chung
62674a2f40 Fix issue with deferred start of the background loader.
- Previously we were (incorrectly) assuming that the creation of the
  BackgroundTaskLoader would be followed synchronously by a call to start()
  the background loader itself.  However, now that we post the start of
  the loader, the run() call can be made before the start() call.

Bug: 38310660
Test: This is an intermittent bug, hard to repro.
Change-Id: I4dfd18b8c3c127429c790177e98ca41ec70f493d
2017-05-16 16:58:30 -07:00
Winson Chung
0553cbcf36 Merge "Updating Overview to work with PiP" into oc-dev 2017-05-16 23:41:17 +00:00
Jorim Jaggi
34795e3197 Optimize hot launching recents
Rearrange how we generate the transition specs, which involves
creating a thumbnail on the mainthread (about 10ms on large
devices): First, we put launching the activity onto a handler
thread (with default priority), to free up the main thread. Then,
we immediately start generating the thumbnail such that when the
future calls us we have the generated spec already handy.

For that we need to be able to supply a specs future into
ActivityOptions, to avoid race conditions. Furthermore we need to
make sure not to call into WM while creating specs, to avoid WM
lock contention.

Test: App -> Recents -> Same app, inspect app transition logs
Test: Double tap recents for quick switching

Bug: 32668632
Change-Id: I6001e29145f8e56deb9c4ead46c53c87c9191436
Merged-In: Ic6ec65c2560f67cade3b5ddde9f79ee13e9ba32c
2017-05-16 17:28:40 +02:00
Selim Cinek
8aa5c556ab Improved the media color extraction algorithm
The color extraction algorithm is tuned further:
We're now regarding more colors as white when
it comes to the background selection.

For muted color swatches we also factor in the popuplation.
Finally, we also factor in the mostdominant color to overtake the text
color in case it is very dominant.

Test: runtest systemui
Bug: 38168152
Change-Id: I858017b83559255ead48c3ab6c3bc16ed110e57c
2017-05-16 01:14:54 +00:00
Evan Rosky
775699dc05 Merge "Post setSwitchingUser to main thread" into oc-dev 2017-05-15 20:52:45 +00:00
TreeHugger Robot
4be9b2ca3e Merge "Keyguard shouldn't listen to FP if bouncer showing and keyguard dismissing" into oc-dev 2017-05-15 20:52:28 +00:00
Winson Chung
70a8e86918 Merge "Ensure that we check against the pending state while suspended." into oc-dev 2017-05-15 19:31:13 +00:00
Kevin Chyn
6db7d5fc84 Keyguard shouldn't listen to FP if bouncer showing and keyguard dismissing
There's a race condition if user unlocks from bouncer and an app underneath
uses FP does onResume()

If a user has an application that's authenticating via FP underneath
keyguard and the user dismisses keyguard via bouncer, the app underneath
will get kicked out since onKeyguardVisibilityChanged(false) calls
shouldListenForFingerprint() during this race.

Keyguard shouldn't listen to FP if bouncer is showing but keyguard is
dismissing

Fixes: 37967985
Test: 1) open FP settings
2) enter keyguard and go to bouncer
3) unlock keyguard via pin/pattern/password (NON FP method)
4) tap any finger on sensor (should vibrate)

Merged-In: Ie38d55e6a1ec9b49f9df0c7520d0bc451315c161
Change-Id: Ie38d55e6a1ec9b49f9df0c7520d0bc451315c161
2017-05-15 18:11:23 +00:00
Evan Rosky
4e44fcedad Post setSwitchingUser to main thread
touching view hierarchy should only occur on UI thread

Bug: 37167272
Test: keyguard still works, used Log to see that switching
      still gets called
Change-Id: I45ed9894a8f08c38da40de44f84e99cddb683014
2017-05-15 10:21:15 -07:00
TreeHugger Robot
1ab1da3f25 Merge "Fix number of channels in inline notification settings" into oc-dev 2017-05-15 14:18:22 +00:00
Jason Monk
d472349229 Merge "Fix the status icon colors in QS" into oc-dev 2017-05-13 13:10:58 +00:00
TreeHugger Robot
8902bbe4e3 Merge changes I7b5504d0,I10c263dc into oc-dev
* changes:
  Get rid of a lot of binder calls
  Fix recents entry delay
2017-05-13 12:57:23 +00:00
Jorim Jaggi
ddb449efd9 Get rid of a lot of binder calls
Lead to delays when entering recents.

Test: Open recents
Bug: 32668632
Change-Id: I7b5504d0c11208d9c4d55de2eace6407d186f25c
2017-05-13 12:34:25 +02:00
Jorim Jaggi
44f4bcb80d Fix recents entry delay
- Start loading things after we drew our first frame.
- Don't load high res task until low res tasks have been loaded:
In case the snapshot is already in cache in system_server the
low-res task loader will load the full res snapshot, leading to
GC pressure due to registerNativeAlloc. Now, if both task loader
load the same snapshot at the same time we are very likely
to trigger a blocking GC alloc.

Test: Open recents, look at systrace
Change-Id: I10c263dc8929742611ad9fbb32f65bc8ac3100bd
Fixes: 36851903
Bug: 32668632
2017-05-13 12:33:59 +02:00
Bryce Lee
b3d265caaa Merge "Introduce result ranges for activity start return results." into oc-dev 2017-05-13 01:41:36 +00:00
TreeHugger Robot
54a3d22cfb Merge "Updating expand icon asset." into oc-dev 2017-05-13 00:14:03 +00:00
Selim Cinek
0ac4b7d108 Merge "Fixed an issue where the media notification wouldn't have contrast" into oc-dev 2017-05-12 23:42:49 +00:00
TreeHugger Robot
310818ff82 Merge "strong fp lockout after 20 failed attempts" into oc-dev 2017-05-12 23:41:43 +00:00
Bryce Lee
7f9368637c Introduce result ranges for activity start return results.
The return result from starting activity actually represents two
pieces of information. First, it conveys whether the activity
started. Secondly, it conveys whether there was a fatal error if
the activity did not start. Many parts of the code assume that a
value greater than or equal to the defined success means that the
activity successfully started. This is not the case as there are a
number of results greater than success where the activity does not
start.

This change addresses the issue by introducing three distinct
result ranges. The first represents results where the activity
could not start due to a fatal error. The second represents results
where the activity did not start due to a non-fatal error. The last
range represents successful activity starts. Two convenience methods
have been added to ActivityManager to return whether the result
represents a fatal error and whether the result was successful.

Change-Id: Ifaf844c353641a28b03b3c2d7b6be053fd9b8b44
Fixes: 38021882
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerTest#testLockTask_deviceOwnerUser
2017-05-12 16:02:23 -07:00
Winson Chung
0a65737c55 Ensure that we check against the pending state while suspended.
Bug: 38192462
Test: Launch PIP, try to make PIP fullscreen.

Change-Id: I575f57492506224b8ee9f247f3c5903c812a04d6
2017-05-12 15:39:44 -07:00
Winson Chung
9a352b6055 Updating expand icon asset.
Bug: 38237934
Test: Launch activity in PIP, tap to show expand icon
Change-Id: Icae85ff27accd1e2143836541587e3bedc17570b
2017-05-12 15:10:38 -07:00
TreeHugger Robot
c82737b98f Merge "Set notification TAG and style in TV PIP notification" into oc-dev 2017-05-12 20:26:57 +00:00
Jason Monk
9a376bcd45 Fix the status icon colors in QS
Requires lots of theming magic

Test: visual
Change-Id: I1cd28b570f30989b496065c0e06a5aca461deb41
Fixes: 37619734
2017-05-12 16:16:39 -04:00
Kevin Chyn
df9d33e903 strong fp lockout after 20 failed attempts
Fingerprint currently locks out for 30s after every 5 failed attempts.

This change makes it so that in addition to the above,
PIN/pattern/password will be required after 20 failed attempts.

Fixes: 35954316

Test: manual
Change-Id: I3aeb0e5b5b4d5011555f60fbe6cc2c1ce702a670
2017-05-12 13:01:01 -07:00
Selim Cinek
0b84204185 Merge "Fixing the colorization of legacy media notifications" into oc-dev 2017-05-12 18:35:23 +00:00
Selim Cinek
275e0582c3 Merge "Don't flash colors when hinting" into oc-dev 2017-05-12 18:32:55 +00:00
TreeHugger Robot
6f5328a2cd Merge "Don't set keyguard state to showing when service disabled" into oc-dev 2017-05-12 18:16:23 +00:00
Winson Chung
b502690e2d Updating Overview to work with PiP
- Ensure that an activity that is auto-entering PiP when hitting Overview
  does not show up in Overview. This is done by listening for the
  onActivityPinned() callback from the system, and remove the pinned task.
- Ensure that we show the PiP task in Overview after it is dismissed, while
  Overview is open. This is done by listening for the onActivityUnpinned()
  callback from the system and refreshing the task list similar to when
  the multi-window mode changes.
- When launching from a PiP activity, or launching back into Overview where
  the next task should be PiP, then ensure that we scroll the stack to the
  front so that the first task is fully visible.
- Fix two lingering Overview issues, when there are no handlers (ie. with
  dynamically registered handlers), ensure that we call pre/post dispatch
  callbacks (otherwise it could cause animated events not to work correctly).
  Also, ensure that we don't update the dummy stack view TaskStack without
  clearing the stack first, since we may be modifying the same stack
  that the activity consumed when starting.

Bug: 34185886
Bug: 38207296
Test: Launch PIP activity from hitting Overview in the various ways
      described above
Change-Id: I699e655106e6ed7206e163f9d3c15477bbfd52ef
2017-05-12 11:01:36 -07:00
Geoffrey Pitsch
d034d29acb Fix number of channels in inline notification settings
Fixes: 38236091
Test: runtest systemui
Change-Id: I813fc17a9d50b5ee563190dd956284554b4ff3dc
2017-05-12 13:29:22 -04:00
Selim Cinek
389edcd7c5 Fixed an issue where the media notification wouldn't have contrast
Because we were relying on the output to go in the right direction
already, this could be wrong. We're now only following the given
lightness direction if it is even possible to satisfy contrast.

Test: runtest -x core/tests/coretests/src/android/app/NotificationTest.java
Change-Id: I06d934a6b5c328ebbf0cf707030b0d707ccb5ab4
Fixes: 38182819
2017-05-12 10:06:41 -07:00
Jason Monk
b4cc7b136e More QS theme fixes for contrast
Test: visual
Merged-In: I4494e92ebf79bbc20c30a18f5ac13228801a3e54
Change-Id: Ifb03403042561ec23e67159eb51387a460d4f90b
Fixes: 37443237
2017-05-12 09:37:49 -04:00