Commit Graph

326 Commits

Author SHA1 Message Date
Matt Pietal
51f8e62e54 Prevent bad intents from crashing sysui
Smartspace could potentially send Intents that don't resolve, which
will crash sysui. Log a warning. Also register an event notifier to
let the SmartspaceSession know of a user action.

Bug: 208350043
Test: atest LockscreenSmartspaceControllerTest + manual (use new
smartspace flashlight off content)

Change-Id: Ife517864c6933bc2d6ef01c28ec97363d9ebfbd7
2021-12-16 20:21:56 +00:00
Jamie Garside
eb7a55cc47 Fix bugs with QS customizer when split shade is active.
* When the QS customizer is active, closing the split shade does not
close the customizer.
* When three-button nav is enabled, pressing back when the QS customizer
is active on the split shade will close the shade, not close the
customizer.

This CL instead adds functions to QS.java so we can check whether the
customizer is active (and close it), so we can handle these cases
appropriately.

Test: Manually verified.
Bug: 201388768
Change-Id: I94208d1cd966975f39328529b9d866fbf27927ac
2021-11-15 11:09:17 +00:00
Dave Mankoff
93c9d9d665 Add a shared library for setting flags in SysUI.
This adds the FlagManager class which currently has 3 methods:
- #getFlagsFuture
- #setFlagValue
- #eraseFlag

The first makes an async call to SystemUI to retrieve the flags
it knows about. It returns a collection of Flag objects from which
one can get the id, type, and default values.

The other two are fairly self-explanatory, sending intents to
SystemUI telling to set or erase flags. Any app calling these
methods must have the FLAGS_PERMISSION defined in the FlagManager
library.

Only boolean flags are supported at the moment.

Bug: 203548827
Test: manual
Change-Id: Id15ff481edcb83c67ce4cdad6cdda27d28a40652
2021-11-02 11:27:55 -04:00
Jeff DeCew
53f489d7b0 Remove dismiss-rtl setters because dismiss is bidirectional
Fixes: 204127880
Test: dismiss notifs; change RTL; dismiss more
Merged-In: Ia3e0c80a1bfb81f039c6409718d5fbeced455939
Change-Id: Ia3e0c80a1bfb81f039c6409718d5fbeced455939
2021-10-29 16:10:50 -04:00
TreeHugger Robot
4d7afd976a Merge "Smartspace - Allow clicks to avoid intent launch" into sc-v2-dev 2021-10-27 18:58:22 +00:00
Matt Pietal
1e85995059 Smartspace - Allow clicks to avoid intent launch
When 'show_on_lockscreen' == true in the SmartspaceAction extras,
start the activity without requiring the device to be unlocked.

Fixes: 203775218
Test: manual
Change-Id: Iab5505fc7aec8d7e29364ff7d3d527f5d71ec5b3
2021-10-27 09:39:07 -04:00
Lucas Dupin
037c2cdc7e Make QS buttons squishy
Pass squishiness fraction from notifications to QS, and make it behave
accordingly.

Test: manual
Test: atest QSSquishinessControllerTest
Bug: 199047412
Change-Id: I9f5df7ae99e0bced4626dcb36053c9dba78ec672
2021-10-26 14:50:29 -07:00
Dave Mankoff
83b4d8b29b Convert existing flags to new system.
This is for the "easy" flags. Flags which are defined in one place
in our resources and and require no extra work to convert to the
new architecture.

Bug: 202860494
Test: manual && atest SystemUITests
Change-Id: Id03fe61b6697bf98fdd225ba252de58e07c42496
Merged-In: Id03fe61b6697bf98fdd225ba252de58e07c42496
2021-10-15 11:38:18 -04:00
Dave Mankoff
f6db05e59f Add ability to set/erase flags via intents.
A flag can be set with a command like the following:
adb shell am broadcast -a com.android.systemui.action.SET_FLAG \
--ei id 1 --ez value 1

A flag can be "erased" with the same command, but leaving the value
unset.

Bug: 202860494
Test: manual
Change-Id: If1097e230692df49a6de7cbbb71ed37b0499c663
2021-10-14 17:39:09 -04:00
Dave Mankoff
898026515a Add ability to read and write flags to sysprops.
Bug: 202860494
Test: manual
Change-Id: I660931492e8a2ffd1373162aab60e4abd4566db6
2021-10-14 12:24:45 -04:00
Jay Aliomer
5eac15cf85 Remove flag plugin with flag manager with DI
Test: FeatureFlagsTest
Bug: 196602427
Change-Id: I43961a091f0f10ebd1a168f40703f0067d9f8a18
Merged-In: I43961a091f0f10ebd1a168f40703f0067d9f8a18
2021-10-14 12:24:45 -04:00
TreeHugger Robot
59d7598b52 Merge "Animate QS alpha on split shade pull down" into sc-v2-dev 2021-10-12 01:06:09 +00:00
Lucas Dupin
1ec71012d1 Animate QS alpha on split shade pull down
When pulling down the shade in split mode, the quick settings alpha
should be directly connected to the drag down gesture and the same that
we have for the notification shade.

Test: manual
Bug: 200804740
Fixes: 196722669
Change-Id: I6532c8a78826a5b60609dc66557abc49a3f140c5
Merged-In: I6532c8a78826a5b60609dc66557abc49a3f140c5
2021-10-12 00:08:39 +00:00
Caitlin Cassidy
a9129a5f9d Merge "[Ongoing Call] Show semi-transparent background behind status bar in immersive mode." into sc-v2-dev 2021-10-08 15:54:13 +00:00
Michal Brzezinski
626b14e467 Fixing bottom part of QS not getting any touches in split shade
The main issue was that QS and notifications container had padding of the size of taskbar. It was because taskbar is included in window insets and container doesn't check where insets come from. If insets are coming from taskbar only they should be ignored because taskbar should disappear when shade is expanded. But if they're coming from taskabar and navigation buttons are visible, they shouldn't be ignored as then taskbar always stays on the screen - that's assessed with checking if gesture navigation is available (if not, it means button navigation). Also because buttons are on the right side only and taskbar might or might not be visible, QS is just taking full height and notifications (that are on the right) have bigger spacing from the bottom.

Because this change involved using a few extra objects not available in NotificationsQuickSettingsContainer and I wanted to avoid doing everything in NotificationPanelViewController (it's big enough) and just passing results to NotificationsQuickSettingsContainer, I introduced controller for it: NotificationsQSContainerController. Now this controller has all the logic for determining bottom spacing. There can be a few more things that can be moved from NPVC to NotificationsQSContainerController but it's a start. Also now QS views and its children views instead of talking directly to container, they talk to controller via QSContainerController interface, which is a nice side-effect improvement.

Fixes: 194989891
Fixes: 200291264
Test: Home screen (so taskbar is hidden) -> go to split shade -> use anything that is close to the bottom of QS side (music widget, rearranging QS tiles, etc)
I'll add unit tests if the change overall looks good

Change-Id: I91ab8ec26dd2ef60562ffb9fdbc0e5739745ca0b
2021-10-06 14:17:36 +01:00
Caitlin Cassidy
af84f95ca0 [Ongoing Call] Show semi-transparent background behind status bar in immersive mode.
Test: atest+manual
Bug: 195839150
Change-Id: I0d79d889ddc199e290f8976b9b3ccb55ee8f51ac
2021-10-06 12:56:43 +00:00
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
Matt Pietal
44ad78711f AOD Media
Add media back into smartspace content when the new plugin is
enabled. Only show media on AOD when no other content is displayed,
other than the default weather/date card.

Fixes: 185373132
Test: atest KeyguardMediaViewControllerTest

Change-Id: I9a1ff4eaeb4e13ed30c7796c1e9d2d5d46916737
2021-05-26 10:48:57 -04: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
Schneider Victor-tulias
a6d4e151d2 Update SmartspaceDataPlugin to allow sending SmartspaceTargetEvents.
Test: manual
bug: 187320188
Change-Id: Idda9b4fb96d863c9c49f6233e1ab4f3d89f2682a
2021-05-13 11:22:17 -07:00
Matt Pietal
241f1e71c2 Merge changes from topic "ss_next_alarm" into sc-dev
* changes:
  Smartspace - Next alarm
  Cleanup support for multiple PIN views
2021-05-10 13:44:20 +00:00
Matt Pietal
bf934d2201 Smartspace - Next alarm
Support next alarm appearing next to DnD. If weather is showing, show
inline, otherwise below the smartspace content. Next alarm will not
fade out but DnD will.

Fixes: 185678563
Test: atest KeyguardZenAlarmViewControllerTest

Change-Id: I21e95470d0013bfb6900c1c228dda69f5707c9e6
2021-05-07 14:35:34 -04:00
Fabian Kozynski
26159c8b66 Merge "Set the default background color to ACTIVE" into sc-dev 2021-05-07 14:11:32 +00:00
Matt Pietal
8ddca3c6cb Merge "Smartspace - Support Do Not Disturb" into sc-dev 2021-05-06 19:13:50 +00: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
a759abbe4b Merge "Mkae SysUIPlugins its own gradle target." into sc-dev 2021-05-04 18:44:10 +00:00
Matt Pietal
d5ea029ae6 Smartspace - Support Do Not Disturb
Add support for systemui to inform smartspace about do not disturb
settings. Address some minor spacing issues. Fix how smartspace loads
through dagger.

Fixes: 185970916
Test: atest KeyguardClockSwitchControllerTest
Change-Id: Id19244ceb45fb70a28d780fa5edefab35a5e42c4
2021-05-04 13:53:21 -04:00
Andy Wickham
4e408fe183 Fixes Studio warning from not being able to find this reference.
Test: Manual
Fixes: 186905222
Change-Id: Iab122016da87dc151d3928666bea9d235691fb67
2021-05-01 01:01:57 +00: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
477aab1fa3 Merge "A new shade pull down animation" into sc-dev 2021-04-25 01:03:18 +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