Commit Graph

61 Commits

Author SHA1 Message Date
Fabian Kozynski
7f8742dbf6 Deprecate unused methods in QSTileImpl
* Deprecate getMetricsCategory, as UiEvents just use a string for each
tile.
* Remove all a11y announcements methods. These were not used, as we've
been using stateDescription

Test: atest SystemUITests
Bug: no bug

Change-Id: Id7a53abe59bc2b265f3049e844d9e8d9c4ef1f83
2021-12-29 10:40:12 -05:00
TreeHugger Robot
a9b80a68f3 Merge "Fix heading level" 2021-12-01 20:53:36 +00:00
Fabian Kozynski
115f93de3a Fix heading level
Test: no test
Fixes: 208285302
Change-Id: I2eb0888a502ecf7a76261ac1d80cb3385f1665a0
2021-12-01 13:32:24 -05:00
TreeHugger Robot
e2d8050c0c Merge "Add dialogs docs" 2021-11-30 19:42:03 +00:00
Fabian Kozynski
5cfb8832f1 Add dialogs docs
Test: no test
Fixes: 208285302
Change-Id: I3e346d551b2e9ffde856ee8fc240652fe00bf73c
2021-11-30 10:49:50 -05:00
Matt Pietal
bbc2b98333 Bouncer update #2
Part 2 of ???. One-handed mode and user-switcher mode will be
mututally exclusive. Encapsulate one-handed logic into a separate
static class. Add logic to decide between implementations. More
support for user-switcher will be coming next.

Bug: 206825213
Test: atest KeyguardSecurityContainerTest
KeyguardSecurityContainerControllerTest

Change-Id: Iba89b62890d6e7e3252505ae38831930484ded3b
2021-11-29 17:51:45 +00:00
Matt Pietal
5f2121d729 Bouncer updates
Part one of many, to add a multi-user switcher to the bouncer for
supported displays.

This CL:

1. Removes a config that was not-needed, in favor of the
can_use_one_handed_bouncer resource.
2. Adds a new boolean resource to determine when to use the new
bouncer layout with user switcher

Test: atest KeyguardHostViewControllerTest
KeyguardSecurityContainerControllerTest
Bug: 206825213

Change-Id: I18e5e8ef68a57c5c633664062bb2f4fd5d7b778f
2021-11-29 08:37:38 -05:00
Dave Mankoff
08682b29f9 Merge "Add support for flag change listeners library." into sc-v2-dev am: c61d506a90 am: 6a9f7f79f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16182385

Change-Id: Ic4e7ec1b6b80e6690d06c50e66751ee4162d48ae
2021-11-04 20:13:05 +00:00
Dave Mankoff
72a5002956 Add support for flag change listeners library.
Bug: 203548827
Test: manual
Change-Id: I6f989e89a98c7c6643af762eb0263f81ce584dfa
2021-11-03 11:20:11 -04:00
Matt Pietal
439ad1d3cd Merge "More keyguard docs" into sc-v2-dev am: 3dcea69858 am: 8cb32bb31d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16033060

Change-Id: I38f3e7e4f5c612b36f89c92250644f5dbd9412d9
2021-10-11 18:52:01 +00:00
Matt Pietal
1c9e5a9952 More keyguard docs
Starting to set the template for docs, with much more coming.

Test: read the docs
Bug: 195430376
Change-Id: Ie0403bba608520d2be6a5b5d4555c6e8a3deb1ed
2021-10-11 12:46:06 -04:00
TreeHugger Robot
8834c1ac98 Merge "Start keyguard docs" into sc-v2-dev am: af41f0dccc am: cd255da7d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15949908

Change-Id: I90f7a585338b3d7779a3b04561d75ef5d664ee48
2021-10-07 14:59:39 +00:00
Matt Pietal
74b7f3c123 Start keyguard docs
1. Move responsibility for the bouncer container to the
NotificationShadeWindowViewController
2. Start very basic keyguard documentation (much more to come)

Bug: 195430376
Test: atest KeyguardBouncerTest StatusBarTest StatusBarKeyguardViewManagerTest
      NotificationPanelViewControllerTest
Change-Id: Iba45a9252fd37c00b2023407eb44bd91c44a87ad
2021-10-07 13:53:23 +00:00
Fabian Kozynski
def01e7485 Add flags to BroadcastDispatcher
Starting soon, one of Context#RECEIVER_NOT_EXPORTED or
Context#RECEIVER_EXPORTED is required when registering broadcasts. This
CL adds an optional argument to BroadcastDispatcher#registerReceiver to
add flags. The default is RECEIVER_EXPORTED, as it's the backwards
compatible behavior.

Note that many actions listened from SystemUI are platform actions and
as such require RECEIVER_EXPORTED.

This CL does not address receivers registered directly with Context.

Test: logs and dumps
Test: atest SystemUITests
Fixes: 198424247
Change-Id: I80d0cee9347c22c4246bd3da8abc9b040d35490a
2021-09-09 09:21:27 -04:00
Fabian Kozynski
8ada758ea3 Statically map tile spec to array res id
That way, we don't need to use Resources#getIdentifier

Test: atest QSTileViewImpl TilesStatesTextTest
Test: microbenchmark jank test
Fixes: 191483200
Change-Id: I0d92c6e5b9861e5001df5e2ffb7f80734b2b9ff8
2021-06-21 10:40:00 -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
Fabian Kozynski
9c8de7bdf1 Refactor QSTileView hierarchy
This CL collapses the hierarchy QSTileBaseView - QSTileView -
QSTileViewHorizontal into QSTileViewImpl. This can be done because now
there's a single type of view for the tiles. The benefit of this is that
we do not have to hack our way to undo things that are done in parent
classes. As part of this remove a lot of unnecessary files.

As part of this, bring some colors/sizes up to spec and make sure that
the sizes are reloaded in config changes.

Test: manual
Test: atest com.android.systemui.qs
Fixes: 187061459
Bug: 186057842
Change-Id: I63dbe8fa2b44833c11a486e84195e33e170c6f58
2021-05-04 15:28:01 -04: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
Dave Mankoff
6d40ac31bb Merge "Incorporate Falsing Belief sooner." into sc-dev 2021-04-02 14:38:37 +00:00
Dave Mankoff
c5755b2970 Incorporate Falsing Belief sooner.
Process gestures in the FalsingManager as soon as they complete,
instead of waiting for the next gesture to begin.

This provides more accurate and useful feedback about falsing belief.
It means that a falsing "event" will be fired as soon as the indicated
threshold is crossed, instead of on the next, possibly intentional
gesture.

Bug: 184042853
Test: atest SystemUITests && manual
Change-Id: Idd9227de3a03c52dabe31f52dbb45ff890615ded
2021-04-01 17:05:30 -04:00
Daniel Sandler
4aa344a0a7 Merge "Allow explicitly setting the camera component launched by double-press power." into sc-dev 2021-03-30 22:24:05 +00:00
Dave Mankoff
fa7aca14e7 Add documentation for Falsing.
Bug: 172655679
Test: manual
Change-Id: Iab0bbd04c1eae3464c7199bd07ca2ea619cecb83
2021-03-29 17:37:08 -04:00
Dan Sandler
f22cf3df13 Allow explicitly setting the camera component launched by double-press power.
Using an implicit intent at the moment of picture-taking
usually goes unnoticed. But immediately after installing a
new camera, this behavior becomes incredibly frustrating to
users as they are presented with a puzzling resolver dialog
(or in the case of the secure camera, the authenticator).
And if, at this moment, the user chooses to make one of the
options a default, it's almost impossible to figure out how
to change this setting.

As a result, many OEMs simply hardcode the camera gesture to
launch a specific preinstalled camera, but this is poorly
supported by AOSP, leading to duplicate implementations and
bugs. This patch routes all camera intents in System UI
through a single utility class, creating a convenient spot
to insert a resource that contains the OEM's default
preinstalled camera app.

Note that this does not affect implicit intent resolution in
any way; any app may create a chooser for, e.g.,
MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA and allow the
user to pick from the available cameras.

Bugreport/dumpsys output to look for:
$ adb shell dumpsys activity service com.android.systemui | grep -C3 'Camera gesture' | tail -3
    Camera gesture intents:
       Insecure camera: Intent { act=android.media.action.STILL_IMAGE_CAMERA }
       Secure camera: Intent { act=android.media.action.STILL_IMAGE_CAMERA_SECURE flg=0x800000 }
       Override package: null

Bug: 171807357
Fixes: 154218868
Test: atest SystemUITests
Change-Id: I2c0033e52c8a3963768d29f2e76e555d405aaa7e
2021-03-29 20:25:01 +00:00
Beth Thibodeau
bd73376f0f Add documentation for media controls pipeline
Fixes: 180129875
Test: no test
Change-Id: I24f55f7e68eccbde3c2bf2507124c74cefec5cc1
2021-03-02 03:37:49 +00:00
Matthew Fritze
3e0683ab7c Add SysUI docs for the emergengy gesture
The docs are based off of camera.md.

Test: Just regular reading
Fixes: 169249551
Change-Id: I1c8d2b4aef50b11abba53277d8202444ddb05502
2021-02-03 13:04:22 -08:00
Fabian Kozynski
bcb81913fa Use null as default argument
This improves mocking it, as the Java code that results in creating the
overloads doesn't need to call context.getMainExecutor or
context.getUser.

As an example, with a mock mDispatcher, calls to
`mDispatcher(receiver, filter)` with some configurations of Mockito
would fail, as the actual Java method would create the default parameters
calling `context.getMainExecutor()` and `context.getUser()`, but `context`
is null in the mock.

Test: atest SystemUITests
Change-Id: Ia97b62134532c60525d1df33023cc2dd99c1f6a8
2020-10-19 17:34:48 +00:00
Beverly
0da32838b3 Update plugin_hooks.md
Fix ToastPlugin link

Bug: 169587378
Test: manual
Change-Id: I552fd19f9cd46298e891819cc0172392a7e8cdbb
2020-10-08 08:45:31 -04: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
Dan Sandler
fd390c6a56 Document how the camera-launch gesture works.
Test: none
Change-Id: I572212a908ea46e960f8422e92b276730d0da139
2020-09-03 21:12:06 -04:00
Dave Mankoff
a0d8ef8a26 Streamline Dagger Initization.
This simplifies the dagger initilization, removing constructs that
provided no value to the process, but did serve to make the code
more complex to analyze.

Update dagger.md while we're here.

Fixes: 161911916
Test: manual
Change-Id: I84ced47d7cd6ce90664b68339acb7d7db765d56f
2020-07-24 16:17:08 -04:00
Dave Mankoff
dffcc471d1 Update Dagger2 dependencies.
Fixes: 160781930
Test: manual
Change-Id: Ic3b43bb8247c6a7ebe4257651bcb5de51699c60a
2020-07-09 09:34:47 -04:00
Fabian Kozynski
34f899a849 Fix BroadcastDispatcher registering with CURRENT
When a BroadcastReceiver is registered with UserHandle.CURRENT, the
current user should be obtained. This has to be cached in order to not
call ActivityManager every time.

As it is done in the initializer the initial value caching will happen
before any other BroadcastReceiver is actually registered. The caching
and updating is all done in the background thread.

Also, remove unnecessary dependency.

Test: manual
Test: atest BroadcastDispatcher
Fixes: 158298581
Change-Id: Idfd2dc65f9079c57e971250aa7b0aef222da5af5
2020-06-11 16:27:46 +00:00
Fabian Kozynski
938137e7fc Add info about sticky in broadcasts.md
Also in the Javadoc of BroadcastDispatcher

Test: no test
Fixes: 151641451
Change-Id: Id19f5192c9c0c17b7405853960258b43053630d1
2020-04-28 16:09:27 -04:00
Fabian Kozynski
35e1d1fc4a Merge "Documentation for QSTiles" 2020-02-10 15:44:30 +00:00
Fabian Kozynski
01f07684d3 Documentation for QSTiles
Also added javadoc for QSTileImpl

Test: no test

Change-Id: I3c71954e04d58b1d694502baf01ceae13288031b
2020-02-08 21:06:46 +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
Fabian Kozynski
5e92c6fd9f BroadcastDispatcher can use Executors now
registerReceiver takes an optional Executor parameter. The old
registerReceiver that takes a Handler has been renamed and @Deprecated

Test: SystemUITests
Change-Id: I43b97f720b2b153d1019ed3cf19e1533558e380f
2020-01-09 15:31:14 -05:00
Dave Mankoff
6891682256 Documentation on new Executors in SystemUI.
Also, remove the "removeAll" method. It was going
to cause more harm than good.

Bug: 145135056
Test: n/a
Change-Id: I39ef8c4aa656e6a9d7ef15e8dd528960e07a406a
2019-12-06 11:51:12 -05:00
Fabian Kozynski
5ca7a51c11 Finish migrating to BroadcastDispatcher
This CL migrates most of the remaining classes to use
BroadcastDispatcher. Some classes left are Views or created before the
BroadcastDispatcher can be injected.

Adds docs for instructions on using the BroadcastDispatcher.

Using the broadcast dispatcher, the time system_server spends
dispatching common intents to SystemUI like SCREEN_OFF and SCREEN_ON can
be seen to decrease from ~70-150ms (in a Q build) to ~2-4ms.

Additionally, once a broadcast is received by the dispatcher, time
until it is fully dispatched inside SystemUI is not impacted greatly.
Most broadcasts are fully dispatched after ~20ms with a few of them
taking ~100ms.

Test: atest SystemUITests no regressions
Test: build and boot
Test: tried some random broadcasts and they are properly dispatched
Test: BroadcastDispatch dump
Test: adb shell dumpsys activity broadcasts
Bug: 134566046

Change-Id: I26a592be66b053f25669b5481b58bf7f07bfd0da
2019-11-04 10:53:26 -05:00
Fabian Kozynski
3bf518dd98 Adding a Plugin to attach things under QQS
This plugin responds to expansion and changes in theme, ui, etc.

Test: manual

Change-Id: I5d866a4fff491aa6273edfb765e538864b270534
2019-09-05 12:26:13 -04:00
Mady Mellor
06b770cf14 qt-r1-bubbles-dev @ build 5835883
Test: presubmit setup on source branch

Bug: 126945401
Bug: 128932906
Bug: 129158983
Bug: 130237686
Bug: 130250809
Bug: 130442248
Bug: 131267438
Bug: 131609280
Bug: 131692350
Bug: 131849856
Bug: 133444037
Bug: 134064116
Bug: 134064858
Bug: 134070807
Bug: 134077101
Bug: 134090085
Bug: 134155107
Bug: 134423445
Bug: 134512898
Bug: 134514210
Bug: 134514227
Bug: 134734945
Bug: 134960381
Bug: 134989736
Bug: 135214687
Bug: 135280077
Bug: 135472021
Bug: 135475155
Bug: 135487618
Bug: 135488406
Bug: 135518045
Bug: 135633218
Bug: 136034310
Bug: 136150954
Bug: 136199542
Bug: 136538998
Bug: 137201711
Bug: 137213469
Bug: 137214359
Bug: 137214536
Bug: 137233453
Bug: 137876221
Bug: 138301618
Bug: 138445026
Bug: 138659213
Bug: 138749133
Bug: 138799651
Bug: 138801505
Bug: 138941969
Bug: 139002444
Bug: 139025304
Bug: 139816141
Change-Id: Ic271a6a0f0803941dd5a84124dabf4d8c5fcc755
2019-08-29 20:24:52 -07:00
Dave Mankoff
2ea5a83202 Allow Services to be created through Dagger.
This is a significant change that allows Services to have their
constructed injected into.

This change includes DozeService as an example, injecting the
FalsingManager into its constructor.

Bug: 136279712
Test: atest SystemUITests
Change-Id: Ib58f8763c996fbc2aea07ead56493d2d9e936f5b
2019-07-08 16:56:11 -04:00
Joshua Tsuji
debd831ca7 Adds followAnimatedTargetAlongPath, and modifies the expanded controller to use it.
This also moves the end action methods into the controller, which is a more logical place for it. That way, PhysicsAnimationLayout only has one public method (setActiveController). This sets us up better for future abstractions that don't rely on a custom view at all.

(also updates the docs for these changes and several recent ones)

Test: atest SystemUITests
Bug: 134077101
Change-Id: I6fcc14587b07f14371fa75fbbe0cc31353aa5c0b
2019-06-26 13:39:41 -04:00
Robert Snoeberger
aa184854de Add doc for system health guidelines for AOD clock faces.
Bug: 129775476
Test: none
Change-Id: I3b5eb9524a076669cc15278f80d9fc8c81b5340a
2019-04-19 17:35:10 -04:00
Joshua Tsuji
c110843412 Adds PhysicsPropertyAnimator, which simplifies animation controllers.
See the updated docs for an explanation and example usages. The number of overloaded animateValueForChild methods, and end listener/property setting boilerplate in the controllers were getting annoying, and this is a familiar pattern similar to ViewPropertyAnimator.

Test: atest SystemUITests, also manually tested to ensure no regressions.
Change-Id: Ibca870efda447d79b795c846408f1f6864ce3aa9
2019-03-21 13:03:27 -04:00
Evan Laird
15b3599256 Touchup the dagger.md docs
I was going through the documentation saw that it could use some love

Test: visual
Change-Id: I837220364f63878fe5d751d000f414c01c9de419
2019-03-06 16:40:18 -05:00
Joshua Tsuji
1575e6bb31 Animate addition/removal of views in expanded mode.
This required adding the setChildVisibility method to controllers, to allow them to animate in/out views that pass the max rendered child threshold. This was not previously relevant since in the bubble stack, you can't really see the views when they're set to VISIBLE/GONE.

Also, renamed onChildToBeRemoved to onChildRemoved since that's more accurate given the move to transient views.

Test: atest SystemUITests
Change-Id: I291ff8f6257ba54e0688c1062bbd673e0c7bdb5c
2019-02-04 15:31:51 -05:00
Joshua Tsuji
b1a796b155 Adds DynamicAnimation-based movement to the bubbles.
See go/bubble-stack-design for a high level overview of these changes. This is a large CL, but required in order to allow continued development and team testing without breaking functionality over the course of multiple CL submissions.

To integrate the new animations, the following changes have been made to existing code:
* (BubbleStackView) The bubble container (and thus, the stack view) are MATCH_PARENT to allow the bubbles to independently translate anywhere on the screen.
* (BubbleStackView) Start position is set by the stack controller, not BubbleStackView.
* (BubbleStackView) Expand positon is set by the expansion controller, not BubbleStackView.
* (BubbleStackView/BubbleTouchHandler) Added the methods onDragStart/onDragged/onDragFinish, and onBubbleDragStart/onBubbleDragged/onBubbleDragFinish, for cleaner dispatch of touch events to the appropriate animation controller.
* (BubbleStackView/BubbleController) The stack view's getBoundsOnScreen returns the first bubble's bounds, if the stack is not expanded.
* (BubbleStackView) applyCurrentState no longer manages translation of bubbles, or the expanded view, these are controlled by animation.
* (BubbleMovementHelper) Deleted, no longer needed.
* (Everywhere) Changed uses of Point to PointF, since translation values are floats anyway.

Known issues to be fixed in subsequent, far smaller CLs:
* (b/123022862) Bubble dragging out/dismissing is not animated, and the bubbles can be deposited anywhere. Tap outside the stack to collapse them back to normal.
* (b/123023502) New bubbles added while the stack is expanded are not positioned properly.
* (b/123022982) Expanded view arrow is sometimes in the wrong position.
* (b/123023410) If the stack is expanded while animating, it collapses to its original position even if not along the edge of the screen.
* (b/123023904) The expanded view doesn't animate out, it disappears instantly.
* (b/123026584) Bounds in landscape are a bit wonky.

Bug: 111236845
Test: atest SystemUITests
Test: physics-animation-testing.md
Change-Id: Icaca09e5db89c635c9bb7ca82d7d2714362e344e
2019-01-24 19:23:17 -05:00
Jason Monk
55fd968ac8 Add link to dagger user guide
Test: gitiles
Change-Id: I9c2ab16bf049ee1398d5761e06aa9c6f556d9722
2018-12-27 07:46:57 -05:00
Jason Monk
196d639875 Clean up DependencyProvider a bit
Create DependencyBinder which is abstract and can tell dagger how
to convert directly between interfaces and implementations without
requiring code for it.

Test: compile (which runs dagger)
Change-Id: I7013ee12d37172441e2c70cf2fe36f707975c821
2018-12-21 09:02:13 -05:00