Commit Graph

246 Commits

Author SHA1 Message Date
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
Flavio Fiszman
04ffb5128b Update People Space widget on channel modification
Test: Buld and run, and unit test.
Change-Id: I209c3a7ac12fa48f744d8f784c598ad359bf2de6
2020-11-12 21:17:32 +00:00
Beverly
b7ef5de9e0 Add Plugin interface for Toasts
Allows Toasts that route through SystemUI to be implemented by a
ToastPlugin. This CL also adds the ability for plugins to create a
custom animation for when the toast shows and hides.

Also adds logging for Toasts that get routed through SystemUI. By
default, these logs aren't logged to logcat but can be enabled via adb (see
LogBuffer.kt).

To dump ToastLog:
adb shell dumpsys activity service com.android.systemui/.SystemUIService ToastLog

Bug: 169587378
Test: manually add CustomToastPlugin
Test: atest ToastUITest
Change-Id: I0a0b16fdc2a5ba1908054197f6dc6728f10a0d2e
2020-09-30 20:48:29 -04:00
Fabian Kozynski
59e7a21916 Wait for state refreshed in TileQueryHelper
When adding the stock tiles for TileAdapter, TileQueryHelper will set
them to listening for a brief period of time to refresh the state and
show the current state. It used to work because all the operations were
done in the background thread.

After switching the lifecycle logic to the main thread, there was a race
condition preventing the new state (between RESUMED and STARTED) to be
collected before it was copied.

This CL adds a class TileCollector that will wait until all tiles have
properly refreshed at least once before collecting their state.

Test: manual
Test: atest TileQueryHelperTest
Fixes: 168444501

Change-Id: I5f356ae4648e837cbe1bcdbaec9ba6d5b7c09891
2020-09-16 14:35:55 -04:00
Dave Mankoff
96c4746453 Pass interaction type to FalsingManager.isFalse
This ensures that the falsing manager always is testing against the
correct interaction type when it is asked. Prior to this change, we
could end up in states where a user was swiping down (opening the
quick settings) but the falsing manager believed the user was trying
to unlock the phone.

Fixes: 160967364
Test: atest SystemUITests && manual
Change-Id: I176f54a768622dec3e758a7f01ed8aec26223648
2020-08-24 14:52:49 -04:00
Beverly
3d8fc64290 Add visual stability manager to data-layer
Create OnUserInteractionCallback (to repace OnDimissCallback) which will
handle user interactions with notifications (ExpandableNotificationRow)
and send this information to the relevant notification pipeline.

While we still have both notification pipelines in SystemUI, the new
pipeline will use a VisualStabilityManagerStub (used by
HeadsUpManagerPhone and MediaCarouselController) since the view layer no
longer needs visual stability since this will be taken care of by the
VisualStabilityCoordinator in the data-layer. Once we migrate to the new
pipeline, the legacy VisualStabilityManager + Stub should deleted.

Notes:
- Currently only one coordinator can attach a visual stability manager
or an IllegalStateException will be thrown.
- The suppressed group and section changes are logged in the
suppressedAttachState on the ListAttachState object on each entry.
- Currently we do not suppress the ordering of children as part of the
new VisualStabilityCoordinator; however the old pipeline does
suppress ordering.

Test: atest VisualStabilityCoordinatorTest
Test: SystemUITests
Change-Id: Ia26844ba885ac9ed3b8526af82e772f19e5dcd19
2020-08-17 10:15:24 -04:00
Julia Reynolds
3a72daad2b Remove app ops indicators from notifications
Test: atest
Bug: 163076432
Change-Id: I5b7514f765811ffd3b0aca63d0108591755974ab
2020-08-13 11:33:43 -04:00
Automerger Merge Worker
49d6ea0b3a Merge "Merge "Making the media carousel dismissable" into rvc-dev am: 82359e319e am: 2001debcdf am: d041e8ff7a" into rvc-qpr-dev-plus-aosp am: 459a5eee58
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11885872

Change-Id: I9564503b627b1c255ee222b00dc6acc1eab097f8
2020-06-22 19:21:25 +00:00
Selim Cinek
afae4e715f Making the media carousel dismissable
The carousel can now be dismissed when swiping on the last card
Dismissing the carousel will make all active players inactive
and resumable.

Bug: 159159195
Test: add media notifications, swipe them away!
Change-Id: Ia42886fa2b50ac0b06824480cf615237d663367f
2020-06-19 18:15:03 -07:00
Alex Mang
8c0ef2dccf Adding notification guts to feedback icon
Feedback icon is now tappable and opens up notification guts

Test: manually on device
Change-Id: I7c19d612fa90980a274e8c48561333fc1131c688
2020-06-14 00:34:24 -07:00
Automerger Merge Worker
b2160819c2 Merge "Merge changes I3b8babc2,I56ea3eee into rvc-dev am: 3a8b73a881 am: b9ed45c308 am: 50db05188b" into rvc-qpr-dev-plus-aosp am: f04d153efc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11694355

Change-Id: Ia81dcbcdba2217770ded79d265807a2c644732dc
2020-06-13 02:45:41 +00:00
Selim Cinek
2a1cab1192 Changed the landscape experience of quick settings
When introducing Media into quick settings, the landscape
experience never really worked well. The music player
would be cut off on the bottom and users could never
reach their playback controls.
Instead of the vertical layout, we're now rendering
quick settings side by side with the player.

Using some densities, this could still be too large,
so we're also introducing a scrollview for the
expanded quick settings.
This also makes sure all the paddings and spacings
are up to spec.

This also fixes behavior where a user could still collapse
the panel while the user switcher was showing.

Bug: 154332040
Test: atest SystemUITests
Change-Id: I3b8babc2cc6a91e19824b67f043aa5044dc370b9
2020-06-12 16:26:53 -07:00
TreeHugger Robot
66c88e2589 Merge "Remove QS details prototype code" into rvc-dev am: 16715e7f85 am: 7835253585 am: 67b321708c am: 93bd0128e0
Change-Id: I6c6ae2906c56520c8cb58c204b9a8920ae84d137
2020-05-15 21:39:10 +00:00
Fabian Kozynski
36ddca1cf3 Remove QS details prototype code
Also remove some other leftover prototype code

Test: manual
Fixes: 156645457
Change-Id: I21f442b2501f00c78c51826a805e7be91a214c7d
2020-05-14 15:57:40 -04:00
Dave Mankoff
50883d72aa Prevent double animation of lockicon when waking.
If the phone went from pulsing -> awake, it could cause the lock icon
to briefly disappear then reappear. Specifically, this caused it to
appear to animate twice.

This all resulted from the internals of the Doze system briefly being
told that it was neither dozing nor pusling, meaning that it thought
it should hide the lock icon. The rest of the system then caught up,
and it shows the lock icon again, animating it into place.

Fixes: 155411884
Test: manual
Change-Id: I79e1bbde2c5cb5fe588a29111294fab68c546c7c
Merged-In: I79e1bbde2c5cb5fe588a29111294fab68c546c7c
2020-05-04 13:51:48 -04:00
Dave Mankoff
b430015128 Prevent double animation of lockicon when waking.
If the phone went from pulsing -> awake, it could cause the lock icon
to briefly disappear then reappear. Specifically, this caused it to
appear to animate twice.

This all resulted from the internals of the Doze system briefly being
told that it was neither dozing nor pusling, meaning that it thought
it should hide the lock icon. The rest of the system then caught up,
and it shows the lock icon again, animating it into place.

Fixes: 155411884
Test: manual
Change-Id: I79e1bbde2c5cb5fe588a29111294fab68c546c7c
2020-05-04 13:45:13 -04:00
Fabian Kozynski
2ff6df973b Add new QS Ui EVents
This CL adds events for:
* QS interactions
* StatusBarState changes
* User Switcher interaction
* DND panel interaction

The new QS events that refer to particular tiles attach the following:
* spec (if framework tile) or package (if CustomTile)
* instanceId associated with the QSTile object on creation

Test: atest SystemUITests (including new tests)
Test: manual using statsd_testdrive
Fixes: 147508235
Change-Id: I43d8fe1fdb2aec1f16032da61a599ebc29809afc
2020-04-30 12:52:20 -04:00
Julia Reynolds
138111fca3 Show snoozed conversations in conversation header
- And allow them to be unsnoozed with a tap.
- Also use the conversation's shortcut icon and name if available.
- And ignore the setting to turn off the strips since it now requires
explicit user action to make the strip visible

Note 1: unsnoozing a notification causes it to make sound again - we
probably want to change that for manually unsnoozed things
Note 2: the entries in the header don't yet persist across a reboot

Test: atest, manual
Bug: 149486431
Change-Id: Id661c25a49bc982e39deab977eb912f51eaf6757
2020-02-28 02:48:07 +00:00
Fabian Kozynski
1e88cfefac Merge "Add QSLogs using new loggers" 2020-02-12 15:10:27 +00:00
Dave Mankoff
9d81f0ab04 Merge "Unregister prox sensor when QS or Bouncer are expanded." 2020-02-12 01:36:37 +00:00
Dave Mankoff
1b2144d69d Unregister prox sensor when QS or Bouncer are expanded.
The FalsingManager doesn't need the prox sensor when its not being
used.

Bug: 149307116
Test: atest SystemUITests
Change-Id: Ib68c0a269c9f94b1a1bb0ba137a2bb5fde340bba
2020-02-11 14:49:18 -05:00
Fabian Kozynski
ca30f57095 Add QSLogs using new loggers
Test: manual using DumpController
Test: atest

Change-Id: Id665ff047d60ddfa5f8f2fe907b7e20f84bd0013
2020-02-11 10:31:52 -05:00
yingleiw
5e0f9f4b02 Revert "Partially revert "modify quick settings to adopt the accessibility state api""
This reverts commit 7a64815b74.

And added the info.setText() part in onInitializeAccessibilityNodeInfo()
in QSTileBaseView.java so that related tests are not broken.

Test: tested with quicksettings and
android.platform.test.scenario.sysui.quicksettings.ToggleWifiOn#testToggle (pass)
and android.platform.test.scenario.sysui.statusbar.NotificationIconOverflow#testNotificationOverFlow
(fails without and with my cl).

Change-Id: I611177fcbd32d35532cfcafbb2b7a73961d1ddc2
2020-02-10 09:57:50 -08:00
Fabian Kozynski
e87ef4d98d Remove prototype for color QS tiles.
This removes the prototype added in ag/9363655

Test: build
Test: toggle settings and observe
Change-Id: I48785ea90b039793591d048fcbd330ab1caf6cd7
2020-02-04 10:44:41 -05:00
Zhen Zhang
42faa9914c Merge "Partially revert "modify quick settings to adopt the accessibility state api"" 2020-01-30 21:40:13 +00:00
yingleiw
7a64815b74 Partially revert "modify quick settings to adopt the accessibility state api"
This reverts commit 4a72a74b2a except for
the api part.

Fix: b/148501707

Test: not needed
Change-Id: I3cf75589ca0abd2aa58a4291a0261b5ce42d066a
2020-01-30 21:38:38 +00:00
Matt Pietal
f07bac46ee Remove all control experiments
And plugins, and flags, and any associated code

Bug: 148207527
Test: atest SystemUiTests
Change-Id: Id1b800d6ec96b5297e6ed4792ca003d45b61e53e
2020-01-30 08:49:20 -05:00
yingleiw
4a72a74b2a modify quick settings to adopt the accessibility state api
Seperated out the state part from contentDescription. Also changed the
tile on/off states from mocking switch to unavailable/on/off state
description based on State.state. During testing, I removed event
merging (including source node merging) for state and content change
events. Use event text for state description changed part will be in a
seperate CL.

Test: tested on the quick settings tiles for focusing and state change
evnets. With the event merging removed, the state change is announced
when the focus keeps on the tile. Before my change, content change is
not announced when the focus keeps on the tile due to source node change
in event merging.

Fix: 148473520

Change-Id: I5b6aee6f0982cf4e0a3962fbe15239314f3a2de4
2020-01-28 13:31:13 -08:00
Julia Reynolds
12ba4cf7a8 Add conversation-centric inline controls
Round one - needs polish, and actions may be added or removed
in the future, and demote isn't working yet.

Bug: 137397357
Test: atest
Change-Id: Ia52598bec58fc54b8bde29168cd419a24d1e4dab
2020-01-15 10:20:29 -05:00
Dave Mankoff
9febfeb097 Disable falsing when resting on a Dock.
Fix typo: Classifer -> Classifier.

Use Executor instead of Handler in falsing related code.

Show a dump of BrightLingFalsing related information.

Bug: 139785197
Test: atest SystemUITests && manual.
Change-Id: I3be68cb9f27ccfb5a686947cc85aae74f21f099c
2020-01-03 15:21:04 -05:00
Heemin Seog
e9f4e96c0a Move dozing related methods out of ShadeController
isDozing is already provided by StatusBarStateController.
wakeUpIfDozing doesn't need to be in ShadeController and can stay in
StatusBar for now (potentially move into a dozing related controller in
the future?)

Bug: 144702768
Test: manual, atest SystemUITests
Change-Id: I8f7d6a452388308de5fdd1adfbcd200fd3076a2f
2019-12-09 12:32:28 -08:00
Andy Wickham
202970155d Adds NavigationEdgeBackPlugin to iterate on different Back implementations.
NavigationBarEdgePanel now implements the new plugin. As part of that,
some of the UI-specific logic from EdgeBackGestureHandler has been
moved to NavigationBarEdgePanel (e.g. Dark region detector and logic
around the arrow position).

Test: Built and manually tested existing back behavior.
Fixes: 143907351
Change-Id: I0e01581d6b69e6a8a03a4338be83ed5ff8b2da65
2019-11-15 13:19:15 -08:00
Beverly
8cf4996fdf Set a good example - don't export ExamplePlugin
Plugins should never be exported because this would allow other
packages installed on the device to attempt to launch it via
Context#startService which can crash SystemUI.

By default, if a service has an intent-filter, exported is set to true.
Therefore, we must explicitly set exported=false.

Test: n/a
Bug: 142012333
Change-Id: Iaf4191ee3006cc07eb0309f068854c103683e99d
2019-10-30 20:39:16 +00:00
Steve Elliott
bfc57f36d8 Finer-grain control of people sorting via plugin
This change allows for NotificationPersonExtractorPlugin implementors
to mark notifications as "people" (to be sorted into the People
bucket) separately from extracting data from them for PeopleHub.

Test: manual
Change-Id: Ieb8a9aeea06bbfe70976ebf46274567347e695d7
2019-10-24 15:35:32 -04:00
Steve Elliott
984cfec745 Plugin interface for PeopleHub
This allows for plugins to add additional "people notification"
detection logic, useful for prototyping against apps which do
not post MessagingStyle notifications.

Test: manual
Change-Id: I8b7b824beed50dfb86689f41ff151b3014737ffb
2019-10-23 11:23:59 -04:00
Jorim Jaggi
956ca413e3 Window Manager Flag Migration (4/n)
Wire up the appearance and the transient state of system bars between
WMS and System UI. The derived classes of CommandQueue.Callbacks no
longer listen to setSystemUiVisibility, but listen to showTransient,
abortTransient, and onSystemBarAppearanceChanged instead.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest
Test: build on specific target
Change-Id: Ie35f4b4468bce7ef8c76f091e306610c069fba85
2019-10-19 16:59:06 +08:00
Ioannis Ilkos
5a5678d244 Merge "Revert "Window Manager Flag Migration (4/n)"" 2019-10-17 09:49:58 +00:00
Ioannis Ilkos
8cca14103c Revert "Window Manager Flag Migration (4/n)"
This reverts commit cb1b848084.

Reason for revert: Droidcop-triggered revert due to b/142849532

Change-Id: If81eba4e979e21202e78839bb1afbc66691098d2
2019-10-17 09:38:00 +00:00
TreeHugger Robot
0be9fec5c1 Merge "Window Manager Flag Migration (4/n)" 2019-10-17 05:46:19 +00:00
Jorim Jaggi
cb1b848084 Window Manager Flag Migration (4/n)
Wire up the appearance and the transient state of system bars between
WMS and System UI. The derived classes of CommandQueue.Callbacks no
longer listen to setSystemUiVisibility, but listen to showTransient,
abortTransient, and onSystemBarAppearanceChanged instead.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest
Change-Id: I1dcaff47ae57ccee91146fdc042cde5e26fc0b3f
2019-10-17 01:41:34 +08:00
TreeHugger Robot
f3c1c427b2 Merge "Home Controls: Add a new Controls tile for prototyping" 2019-10-16 16:53:46 +00:00
Matt Pietal
b6da00e69a Home Controls: Add a new Controls tile for prototyping
Must edit the QS area to add the new Controls tile and have set:

adb shell settings put system qs_controls_tile_enabled 1

Test: visual
Change-Id: I7359d394d6d0a5eb408de7049bf0b3051c83e361
2019-10-16 11:18:49 -04:00
Fabian Kozynski
05843f07cc Add support for BooleanState in CustomTile
Added API for a TileService to declare that they are a boolean tile. In
that case, the tiles behave like frameworks tiles when using TB.

Test: atest CustomTileTest
Test: manual, added to DevelopmentTiles and observe behavior
Test: manual, Grayscale behavior doesn't change
Bug: 138579147
Change-Id: I2f2dae90a49897015138ab9615a4a556da623358
2019-09-23 20:34:15 +00:00
Dave Mankoff
63a1282b03 Make DozeSensors, DozeTriggers use ProximitySensor
This CL takes the features used in DozeSensors and applies
them to the publicly available util.sensors.ProximitySensor class.

It introduces a RateLimiter class for temprorarily suspending the
ProximitySensor as requested.

It introduces a ProximityCheck class for a quick, one time test
of the proximity sensor.

There is some reshuffling of Sensor related code to its own package
as well.

Bug: 141122220
Test: atest SystemUITests
Change-Id: If126be9a56c6966c1678ee70fa6f4623e51361a7
2019-09-18 11:25:43 -04:00
Matt Pietal
b3e8cbd2a6 QS - Prototype visual affordance for detail panels
Builds on ag/9335278 to show "..." below tiles that support direct to
detail view on touch.

Test: manual
Change-Id: I1c192656505bac228a3935f0aa498c37a468d973
2019-09-12 12:09:31 -04:00