Commit Graph

46 Commits

Author SHA1 Message Date
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
Jason Monk
ea54e8a756 Sysui: Add support for view injection
Test: Existing tests pass
Change-Id: Ic6931ebec38ca9514e9368239dd9502ae2dee33c
2018-12-20 10:22:47 -05:00
Jason Monk
9424af7315 Add support for dagger injection with fragments
Convert NavigationBarFragment as a proof of concept and remove all
references to Dependency from NavigationBarFragment.

Test: atest SystemUITests
Change-Id: I0cdb5bc6ac455fce91e67b9e449cb7b78b1da9a4
2018-12-19 16:07:46 -05:00
Jason Monk
27d01a624d Start using some dagger 2
Early days as we start migration, so lots of duplication between
Dependency and dagger2, but can be removed when migration is done.

Test: existing tests.
Change-Id: I00c3da6ebbd46a26e512d8a7aa1e2b828e08f33f
2018-12-19 09:47:37 -05:00
Dan Sandler
aee10af5ea Fix link in plugin docs
Change-Id: I4f7ce3afaca111203126681b76f3f493b0a44faf
2018-10-04 14:27:11 -04:00
Jason Monk
ae7ced2f95 First kotlin
Convert one class to kotlin and provide a slight amount of guidance.

Test: existing tests
Change-Id: Ie8659765b674ac7b2d82ed3d343f387195c07d83
2018-08-23 12:49:08 -04:00
Kunhung Li
1b35253f58 Add clock plugin interface
More flexible to test any clock plugin in the future

Bug: 111971817
Test: manual test
Change-Id: I45fa2d1ca99446abdb315cc28b58956d8e409283
2018-08-08 18:23:35 +08:00
Jason Monk
ba055f8f9d Import some plugin documentation into the tree
In the spirit of writing things down

Test: none
Change-Id: I93371eab99721ace1fd32d07739b861d492e4be6
2018-02-23 14:52:37 -05:00
Evan Laird
706d9684af Status bar size tweaks
++1dp for Data saver and Hotspot
--1dp for Total silence
>>1dp for Battery lightning bolt

Also implemented keyword "powersave" for `dispatchDemoCommand()` in
BatteryControllerImpl

Test: visual
Bug: 37013523
Change-Id: I027fd18aadeef5c49826c37db9f681c14175a3aa
2017-06-05 10:58:36 -04:00
John Spurlock
cf053c13b8 SysUI Demo Mode: Ensure we have plenty of sims.
And update some docs.

Bug: 21157785
Change-Id: I8e44e160377e66f15c6348a87326998c98cea787
2015-05-18 09:38:07 -04:00
Andrew Flynn
a47a6609d6 Demo Mode instructions for Carrier Network Change icon
Bug: 11392659
Change-Id: I8ca15a51d8079e83dc87bfe90d274a17cbe04c25
2015-04-23 09:16:18 -07:00
Andrew Flynn
56aa4cfcc2 Add SystemUI demo mode README to tree.
Change-Id: I3c22a8b53d7f71881633c456b1fce5758eec9678
2015-04-21 18:11:12 -07:00