Commit Graph

270 Commits

Author SHA1 Message Date
Jordan Demeulenaere
4179c7ce58 Animate the Wallet activity launch on lockscreen (1/2)
This CL animates the launch of the Wallet activity from the wallet tile
or button on the lockscreen.

Note that doing so is still a bit flickery given that the wallpaper
disappears as soon as the animation starts. This will be fixed in a
follow-up CL.

See before/after videos in b/191438572#comment18.

Bug: 191438572
Test: Click Wallet tile or button on lockscreen (with card setup)
Change-Id: Ie2eaddf9e1ad7e620e1cf2260b8f25c6a8534109
2021-08-19 12:04:09 +02:00
Dave Mankoff
07ba23a580 Add flag listeners.
Allows code to subscribe to changes in specific flag values.

Bug: 194781951
Test: atest SystemUITests
Change-Id: Icae5c80cb32f0dd425e53297aa28e555f34a07a5
2021-08-05 15:00:22 -04:00
Dave Mankoff
06037712dd Add new Flag class. New FlagReaderPlugin.
This CL is a stepping stone towards a more complete flag system.

This cl allows for the definition of flags within systemui, each of
which have a unique id and a default value. Methods for retrieving
the value of a flag are defined.

By default, reading a flag always returns its default value.

A FlagReaderPlugin is also defined that, when loaded, allows for
returning alternate values for a given flag. The details of how an
alternate value are determined are left for the plugin to decide.

The plugin interface should be considered incomplete with this cl.
Methods for reading flags are defined, but hooks for knowing when
flags change (and hooks for knowing when a flag plugin has been
loaded), are not defined. Moreover, the flag plugin is not loaded
early in the process with this cl, so anyone who reads flags
before the plugin is may misss out on the values they care about.

More changes to come.

Bug: 194781951
Test: atest SystemUITests
Change-Id: I888d5eba82359a37878a3a4d4747990b79a77804
2021-08-04 13:46:45 -04:00
Selim Cinek
d879f8802c Fix drag down animation when bypassing
The drag down animation didn't do the transition
to the full shade visually, so things would look
out of place.

Fixes: 191282610
Test: drag down while bypassing
Change-Id: Icdd62155f3762621c1046ed5271476ec0b4e2635
2021-07-22 21:48:50 +00:00
Winson Chung
7cbbc225b1 Workaround for back arrow being stuck on screen
- Whenever we defer the cleanup of the back gesture, schedule a failsafe
  to clean up the window if it's not handled properly.  We'll enable
  this failsafe for sc-dev and disable it for further investigations
  post sc-dev
- Dump additional info for the nav bar window so we can narrow down
  the issue post sc-dev

Bug: 190778197
Test: Can't repro the initial issue, so artificially trigger it to verify failsafe
Test: adb shell dumpsys activity service SystemUIService
Change-Id: I0a8f25babe750e6e5ba4c933ab5271a82ef63646
2021-07-18 20:52:35 +00:00
Peter Kalauskas
875b9b7a19 Fix visibility issue in QS detail panels
Fixes visibility issue where keyguard could enter a bad state where QS
remains visible even though it should be hidden.

Previously, keyguard could enter a bad state if QS was closed while it
had a detail panel open that had animations disabled.

To fix issue, run animations when closing detail panels, even if they
requested not to be animated on close.

Test: Turn off all animations (i.e. adb shell 'settings put global
      animator_duration_scale 0.0 && settings put global
      transition_animation_scale 0.0 && settings put global
      window_animation_scale 0.0'), open QS, tap user icon, tap close,
      ensure you are taken back to the lock screen and that the UI looks
      normal
Test: Rapidly tap the user icon and bottom of keyguard in quick
      succession, ensure that keyguard UI never enters a bad state
Fixes: 193549640
Fixes: 193545214
Change-Id: Ie092f83031edaff0240194832b5499df3b4eab12
2021-07-14 08:34:30 -07:00
Fabian Kozynski
b2314f2d27 Fully expand QSPanel on scroll
If the user starts to scroll while the panel is not fully expanded,
expand it fully.

Test: manual: expand and collapse QS while trying to scroll it
Fixes: 189915859
Change-Id: I15d46e3ff4c67754aa8063ffa55e5c62cad7dc89
2021-06-30 14:23:49 -04:00
Selim Cinek
17754ea1ef Animating the qs / notification bounds now when dismissing media
Previously the bounds animation was on the background which doesn't
exist anymore.

Fixes: 192059748
Test: add media, dismiss, observe normal animation
Change-Id: I0f90b3ca5224b538c62adf30081ad30ed906b3b1
2021-06-28 20:16:34 +02:00
Jordan Demeulenaere
534aef4d05 Fix bouncer to launcher/app animation
This CL ensures that we don't show the keyguard early when unlocking the
phone from the bouncer after swiping up on the lockscreen.

Bug: 191031464
Test: Manual, swipe up on lockscreen with PIN
Change-Id: Id7269189c857e1108a8e33074bb5abfd40437deb
2021-06-16 12:10:28 +02:00
Jordan Demeulenaere
d5c5517416 Animate launches from lockscreen
Bug: 172048407
Test: Tap notification, media, QS, etc from lockscreen
Change-Id: I361aadc18b24375173f3bcea9dc1de0c13c803df
2021-06-14 12:00:01 +02:00
Dave Mankoff
d3cd5bb67b Merge "Don't destroy the FalsingManager in Wallet." into sc-dev 2021-06-03 13:58:12 +00:00
Dave Mankoff
b4935a25ca Don't destroy the FalsingManager in Wallet.
When FalsingManager#cleanupInternal is called, it no longer produces
valid results. With this change, we check that the FalsingManager
is not used after being destroyed, and also avoid destroying it in
WalletScreenController.

Fixes: 188174214
Test: manual
Change-Id: I0ce67de5a326b56dee11c1d63c1d592640c0713d
2021-06-02 09:50:16 -04:00
TreeHugger Robot
86cc28a4f4 Merge "Create state strings for every stock tile" into sc-dev 2021-06-01 20:25:47 +00:00
Fabian Kozynski
803e545259 Create state strings for every stock tile
For stock tiles state (filled in subtitle when there is not one set by
the tiles), we specify values for each of the tiles states. That way,
they can be translated with that specific tile name in mind for
grammatical matching.

Custom tiles will use the default.
New stock tiles must add a new array to pass tests.

Test: QSTileViewImplTest TilesStatesTextTest
Fixes: 188163204
Change-Id: Idd4da01994e37cb4778dcdd3080711179cb884c7
2021-05-19 14:29:46 -04:00
Jeff DeCew
f8894a8664 Remove dead snooze code
Bug: 187480963
Test: manual snooze testing
Change-Id: Icb5b664c677efe95fb3ce5e5c28122d1037d75a5
2021-05-19 14:19:34 -04:00
Selim Cinek
8304b95fad Implemented Lockscreen to shade transition
When dragging down on the lockscreen, we now pull down the quick
settings while dragging instead of wating for the release

Bug: 184946919
Test: atest SystemUITests
Change-Id: Ib233282dd7ce4ba63ceab3e1b788aa164e88c8c0
2021-05-14 17:20:19 +02:00
Fabian Kozynski
f0b4194fbc Set the default background color to ACTIVE
This corresponds to the default state of tiles.

Test: no test
Fixes: 187414055
Change-Id: I85fe80becd8305bb6600921d08d7121c33481f4a
2021-05-06 13:56:29 -04:00
Fabian Kozynski
9969241092 Merge changes Ib9407914,I63dbe8fa into sc-dev
* changes:
  Add chevron to tiles that expand instead of toggling.
  Refactor QSTileView hierarchy
2021-05-06 13:24:59 +00:00
Fabian Kozynski
cd7ecf7db2 Add chevron to tiles that expand instead of toggling.
Logic for side view:
* If the tile has a sideViewCustomDrawable, show that regardless of
State
* Else, if the tile is not Boolean or the state has forceExpandView, it
shows a chevron.
* Else, show nothing.

Test: atest com.android.systemui.qs
Test: manual
Fixes: 187057842
Change-Id: Ib9407914f4fbe5ac833b06008fc405435d0c45b0
2021-05-04 15:29:29 -04:00
Dave Mankoff
4e30df7dee Mkae SysUIPlugins its own gradle target.
Breaks the dependency of SystemUIPlugins on ThresholdSensor
by introducing an intermediate interface.

Fixes: 186781915
Test: manual
Change-Id: Ib2633f8f2acaa1d21f1e8968317b4a4e63d3af32
2021-04-30 14:04:12 -04:00
Fabian Kozynski
028497cd67 Add animation for tiles second line
Test: manual
Fixes: 186251234
Change-Id: I0fd6216453b5591469d99a4ba64ac3b1af6e615f
2021-04-27 11:41:29 -04:00
Fabian Kozynski
920c7aa24a Fix credit card animation
Test: manual
Bug: 186251234
Fixes: 186426700
Change-Id: Id81aa3c7fab7ef80faa42aca447501c476464bd2
2021-04-27 11:39:48 -04:00
Dave Mankoff
8d2cf97e71 Merge "Make FalsingManager send out an event when second tap is required." into sc-dev 2021-04-26 19:22:47 +00:00
Lucas Dupin
976de38e37 A new shade pull down animation
Test: manual
Test: atest ScrimViewTest
Test: atest ScrimControllerTest
Bug: 185683835
Fixes: 184891403
Change-Id: I1c51f3dc0d8afe97457aea8712c4322ebbda6ae4
2021-04-24 13:08:34 -07:00
Dave Mankoff
73b487f63c Make FalsingManager send out an event when second tap is required.
Bug: 185908806
Test: manual
Change-Id: I33b704b0f5b4fded59214ab33dbafc8de89675ad
2021-04-23 17:02:26 -04:00
Jordan Demeulenaere
2541d51347 Animate activities launched by QS click (1/2).
See b/185892236#comment3 for before/after videos.

Bug: 185892236
Test: atest QuickAccessWalletTileTest DeviceControlsTileTest AlarmTileTest
Change-Id: I539921777ab516bd35ba809f818fe02092325e78
2021-04-21 14:28:26 +02:00
Jordan Demeulenaere
091a6db76b Animate the QS gear button click.
See b/172050985#comment4 for videos.

Fixes: 172050985
Test: Click the QS gear button
Change-Id: I7a8607e41d4cb8d7734c66c1a601f942e5597796
2021-04-15 11:50:41 +02:00
Jordan Demeulenaere
cea62bb74a Move ActivityLaunchAnimator in its own lib. (1/n)
Bug: 184121838
Test: Manual
Change-Id: Ib979fed2f59d9dbf5f0696edb5fcb4956600e6e0
2021-04-08 22:32:21 +02:00
Dave Mankoff
4b2a3cc2a3 Merge changes from topic "b172655679-bayes-falsing" into sc-dev
* changes:
  Add Falsing to quick settings bottom buttons.
  Collapse QS when falsing happens.
  Separate out FalsingManager#isFalseTap
2021-04-07 21:14:12 +00:00
Dave Mankoff
58718c7f81 Separate out FalsingManager#isFalseTap
Method no longer takes `robustCheck` parameter. Instead,
FalsingManager#isSimpleTap is added for basic checking, and
FalsingManager#isTap does robust checking by default.

FalsingManager#isTap takes an enum value for penalty instead of
a double, making the value more understandable.

Bug: 172655679
Test: atest SystemUITests && manual
Change-Id: Ib4a99f87bcd6acee67a98420f460c98d44fa6360
2021-04-07 11:32:47 -04:00
Jordan Demeulenaere
49bcc0d1ee Animate QuickSettings long press (1/2).
See b/172063474#comment3 for before/after videos.

Bug: 172063474
Test: Long press any QS tile
Change-Id: I75e4784bd6db92a1aea6ffd0eabb648e82376a09
2021-04-07 14:25:22 +02:00
Jordan Demeulenaere
b796cfec0a Add generic support for corner radius in launch animations.
This CL adds a generic way in GhostViewLaunchAnimationController to
change the corner radius of the expanding background. It does so by
supporting Gradient- and LayerDrawable (and therefore RippleDrawable).

This will be first used to animate the launch of the settings after long
clicking a QS tile (see ag/13988954), but this implementation will
hopefully work with other views as well.

This CL also adds the wiring in ActivityStarter that will be needed by
the QuickSettings.

Bug: 184121838
Test: Manual
Change-Id: I40f7048edd682d5d68c32b4439368d19009a8df1
2021-04-07 14:25:17 +02:00
Jordan Demeulenaere
a867af2d87 Extract ActivityLaunchAnimator into a reusable class.
This CL removes all logic specific to notifications in
ActivityLaunchAnimator, so that it can be reused for other launch
animations.

I would suggest to look at ag/14057092 in parallel to make more sense of
the abstractions added in this CL.

For the sake of not making this CL even bigger than it already is, a few
things still need to be done in follow-up CLs:
 - Show the status bar icons at the right time, instead of at the end of
   the animation, when using the StatusBarLaunchAnimatorController.
 - Move the animation/ package outside of the SystemUIPluginLib library
   and instead have it in its own reusable library.
 - Replace the animation durations and interpolator to the latest
   designs.
 - Improve split screen by retrieving the final window bounds and
   prevent the clipping of the window during the animation.
 - Handle animations in the lock screen.

For review, I would recommend to review in order:
 1. ActivityLaunchAnimator.kt
 2. StatusBarLaunchAnimatorController.kt
 3. NotificationLaunchAnimatorController.kt
 4. GhostedViewLaunchAnimatorController.kt
 5. Everything else.

Bug: 184121838
Bug: 181654098
Test: Tap a notification when the shade is open and unlocked.
Change-Id: If4c3c64fcd153bb8e89111f56332013ca6dff156
2021-04-06 17:28:37 +02:00
Silin Huang
807cca09df Add card image to the QuickAccessWalletTile.
We fetch the wallet cards on handleUpdateState() of the Tile, if the
card image exists, it will be stored in the QS State and then pass to
the QSTileViewHorizontal so the card image will be presented on the
tile.
The car image won't show on the tile when the user is edittng the tiles.

Test: manually tested on device
locked - https://hsv.googleplex.com/5756150307880960
unlocked - https://hsv.googleplex.com/5767433589620736
Test: atest
Bug: b/182963608

Change-Id: I45bab06528a7154419ae73f9e576cf385bf0f7c1
2021-04-05 23:48:09 +00:00
Fabian Kozynski
fd5d0a2d7b Pass the context from QS into QSFactory#createTileView
This way, we guarantee that the theme is the same in all of QS

Test: manual
Bug: 183953523
Change-Id: Ia03171194d8c90358730fcacb9ea7dcf61d4dbed
2021-04-02 16:13:03 -04:00
Peter Kalauskas
eeedbc44f9 Allow QS detail panels to change text of "Done" button
User detail panel settings button will now say "Close" instead
of "Done"

Bug: 169783558
Test: atest SystemUITests
Change-Id: Ibafe212dce8a8b8654e877418200e1dc2c5dec8b
2021-03-24 10:36:16 -07:00
Peter Kalauskas
45df6837cd Allow QS detail panels to change text of settings button
User detail panel settings button will now say "User settings" instead
of "More settings"

Bug: 169783558
Test: atest SystemUITests
Change-Id: I1a7a6963f15dbbf6ed8086113fa47f4662d8373c
2021-03-23 13:15:44 -07:00
Dave Mankoff
39ed7729af Rely on a falsing-belief event to reset lockscreen
Individual components of the lock screen are now simply in charge of
asking the FalsingManager to recognize certain types of gestures. If
they don't ask, the FalsingManager will assume they were accidental.

Once a certain number of accidental touches occur, an event is fired
that signals that the lock screen should be reset.

More tuning and adjustment to come, but this is now functional.

This also fixes a bug in an earlier cl where the bouncer would no
longer retract if touches outside of its region were detected.

Bug: 172655679
Test: manual
Change-Id: Iffd1c7e58365235b1b7dbdac0c74439ead1df9d3
2021-03-15 17:51:21 -04:00
Fabian Kozynski
10813bf09b Merge changes from topics "FK_qs_sizes", "FK_qs_sizes2" into sc-dev
* changes:
  Bring back ripple in tiles
  Animate appearing tiles in QS
  Set tiles padding and margins
  Bring tiles sizes and animations up to spec
2021-03-12 16:55:11 +00:00
Dave Mankoff
8d0f3a0c3c Incorporate Bayes into Falsing.
This uses the HistoryTracker on pin-based input to determine if a
tap outside of an intended region is a false touch, retracting the
pin input if we believe pocket dialing is occuring.

To do this, the cl properly integrates the HistoryTracker into
falsing, at least for single taps.

Most importantly, HistoryTracker#falsingBelief now return 0.5 when
it is unsure if a tap is false or not, and tends towards 0 when it
believes it's valid and 1 when it believes it's false.
HistoryTracker#falsingConfidence remains unchanged.

Test: atest SystemUITests && manual
Bug: 172655679
Change-Id: Ie771b1bf8ac564af7ffb68e190772fff5c562e89
2021-03-10 16:42:23 -05:00
Fabian Kozynski
afd39fc578 Bring tiles sizes and animations up to spec
This CL updates the following:
* Tile height (QQS and QS)
* Tile margins (QQS, QS, and QSCustomizer)
* Animation between QQS and QS
* Single line for main label, secondary label
* Corner radius
* Label text size

Test: manual
Bug: 181673785
Change-Id: I8f2fb5929474b0493af33d8fa415353152a27c17
2021-03-10 09:59:35 -05:00
Fabian Kozynski
e377f441e0 Dismantle remove labels prototype
Test: manual
Bug: 171319433
Change-Id: I1ea97cec5c0d9b559213ca2adb9ddf7af60229a6
2021-02-26 13:50:43 -05:00
Peter Kalauskas
c93c1dec2e Add keyguard shortcut for opening QS user panel
- Introduce config_keyguard_user_switch_opens_qs_details. When set to
   true, the user icon that appears when config_keyguardUserSwitcher=true
   will open the "user" QS panel instead of taking over the keyguard

 - Add user icon positioning calculation to
   KeyguardClockPositionAlgorithm

 - Add option to QS DetailAdapter for turning off the circular reveal
   animation

 - Add callback to QS DetailAdapter for when "Done" button is pressed

 - Fix typo: showDetailDapater -> showDetailAdapter

Test: Manual
Bug: 169783558
Change-Id: I50133feaf02ca0990c40aa9d8a046abd95ea9d4e
2021-02-15 13:13:21 -08:00
Beverly
75a4033db8 Update Toast visuals + motion
Puts Toast style/animation changes behind a FeatureFlag

Toasts can be added via Toast APIs OR legacy apps can add the
window directly. Because toast windows can be added directly by legacy
apps, DisplayPolicy.java requires that toast windows are removed
after TOAST_WINDOW_TIMEOUT.  This also means Toast windows added via
the Toast APIs are subject to this timeout. Therefore, this CL also
increases the timeout by 600ms to account for SystemUI's in/out
toast animations.

Bug: 169587378
Test: atest ToastUITest
Test: manual, rotate device while toast is showing
Change-Id: Ib17655c253f4ec4f7018cc5f7939b88a50ea5014
Merged-In: Ib17655c253f4ec4f7018cc5f7939b88a50ea5014
2021-02-10 17:08:51 +00:00
Fabian Kozynski
3c704df4b7 Prototype remove labels in QS
Add flag to not show labels in QS. This also makes it show more rows.

Added a switch in customizer to toggle the setting.

Some visual issues when toggling (media player), fixed by collapsing and
reopening QS.

In user builds, can be toggled with:

`adb shell settings put secure sysui_remove_labels {0, 1}`

Test: manual
Change-Id: I750c53d918b2d9590ff86eed67d1932444390828
2020-12-14 18:48:47 -05:00
Dave Mankoff
3ae5052e7b Add HistoryTracker to FalsingManager
This institutes a HistoryTracker mechanism that will allow the
FalsingManager to take recent activity into account when classifying
gestures. The HistoryTracker returns a penalty that is pased to each
classifier for them to use when making decisions.

As of right now, no classifier actually uses the history penalty when
making a classification decision.

The HistoryTracker keeps records of the last 3 seconds of falsing
results, applying a decaying penalty to the results over time. It also
assigns a confidence to its results, based on how consistent they are.

Each individual classifier is also able to return a confidence score
now, such that, if they are not confident in their decision, they
don't throw off the score that gets stored in the HistoryTracker.
Confidences currently returned by the classifiers are somewhat
arbitrary and should be adjusted in future CLs.

Everything is currently open for adjustment:
- The length of history
- The decay function applied to history
- The method by which our confidence in the history is calculated
- The confidence returned by each individual classfier
- How the history penalty is taken into account by each classifier
- ... and probably more.

Bug: 172655679
Test: atest SystemUITests
Change-Id: Ief2a5144a0cda659c7d78ed6e489231d481b6872
2020-12-10 09:40:07 -05:00
Beverly
e1b6d7f819 Update AOD/LS clock
- Update clock sizes (large clock = 200dp, small clock = 100dp)
- Update clock weights (large = 100-400, small = 200-300)
- Update clocks on time zone and time format changes
	(Settings > System > Date & Time)

Test: manual, atest SystemUITests
Bug: 170228350
Change-Id: I446a2625fdd776c15e744f1601b3ea0e2a873cf1
2020-12-03 14:09:35 +00:00
Dave Mankoff
8012d7bd4f Refactor parts of FalsingManager into FalsingCollector
This CL separates out the two roles of the FalsingManager. It
introduces the FalsingCollector, used by SystemUI to report events
that may be interesting to Falsing, such as touch events, sensor
events, and general user actions.

The FalsingManager, meanwhile, continues to support the methods

This helps breakup the monolithic FalsingManger into more manageable
pieces, reducing the API surface area of FalsingManager significantly.

Bug: 172655679
Test: atest SystemUITests && manual
Change-Id: I92f8e3747f5c4a04eaa64e1a8b626c2a07c480aa
2020-11-20 09:24:26 -05:00
Dave Mankoff
0181890251 Remove old falsing implementation.
This code has not been used since Android P.

Bug: 172655679
Test: manual && atest SystemUITests
Change-Id: I2b96af477b063bcbb68c48951121258e56bbfff2
2020-11-16 09:59:02 -05:00
Dave Mankoff
040ffe7b34 Add Tap falsing to the FalsingManager.
This moves some of the functionality of DoubleTapHelper into the
FalsingManager. This also gives the FalsingManager an opportunity to
approve single-taps.

Currently, all single-taps are rejected, but future work may enable
single-tap falsing.

DoubleTapHelper is renamed to NotificationTapHelper to better reflect
its purpose.

The FalsingManager now maintains a record of past gestures for
analysis, wherease prior it only ever kept the most recent tap.

Bug: 172655697
Test: manual && atest SystemUITests
Change-Id: I58f3d25881b0a3ce14e47b72287dd6a1a9307852
2020-11-16 09:59:02 -05:00