Commit Graph

83 Commits

Author SHA1 Message Date
Alejandro Nijamkin
1f6d4e0e1b Updates developer docs for quick affordances.
Fix: 257547914
Test: N/A
Change-Id: Ica0c3f7503d2c528eccd50cf8aa94239e9a43889
2022-11-22 14:50:55 +00:00
Alejandro Nijamkin
7237112d22 Moves quick affordances to data layer.
Because we need to implement a data layer repository that will access
quick affordance configs, we need the latter to be moved to the data
layer as well (since currently they are in the domain layer and code in
the data layer is not allowed to depend on code in the domain layer).

This CL has no changes, only moves and renames.

Bug: 254858696
Test: All tests still pass. Bottom area affordances still work.
Change-Id: Ibe1f0387886950ef7e9ef11a8716603aa547493e
2022-10-25 13:23:58 -07:00
Beverly
c6231ed7b3 Update doze + auth documentation
Reformat tables

Test: n/a
Fixes: 251832110
Change-Id: I1dad7dfcc07e95c960ea812e33c8f2259eea5c35
2022-10-10 17:36:55 +00:00
Alejandro Nijamkin
6b4f8b1adf Moves quick affordances into domain layer.
After much discussion, it became clear that it would be better to move
quic affordance config definitions out of the data layer and into the
domain layer.

This CL does the following:
1. Moves config definitions to the domain layer
2. Moves the "configs" class to the domain layer and renames it to
   "registry"
3. Eliminates the quick affordance repository from the data layer,
   merging its logic into the observe quick affordance use-case
4. Updates the documentation

Fix: 241681067
Test: Unit tests updated. Manually verified the bottom area quick
affordances still work properly when locked, unlocked, and dozing.
Played with the settings under Display > Lock screen to turn the on and
off.

Change-Id: I4b293eeef02e5546fc834008b096e4a7935657fe
2022-08-11 13:37:23 -07:00
Alejandro Nijamkin
619cd2a8a4 Developer-facing document for quick affordances
This is a guide for developers for how to add new quick affordance
buttons to the lockscreen.

Bug: 235403546
Test: N/A
Change-Id: Id8417c48732e25331027f11442c16d0220e690c4
2022-08-02 14:31:03 -07:00
Aaron Liu
42449b783c [User Switcher] Improve documentation
Improve documentation for UserFileManager.

Bug: None
Test: None
Change-Id: I2b46a0f073afc4ba4784fab4e24078fc3cc15afc
2022-07-19 16:27:07 +00:00
Aaron Liu
1ff91194a8 Merge "[MultiUser] Add file access wrapper." into tm-qpr-dev 2022-07-14 16:18:46 +00:00
Aaron Liu
42af219be9 [MultiUser] Add file access wrapper.
Adds a class that handles files access for multiple users. Will work on
integration in follow-up CL.

Test: Add unit tests.
Change-Id: Ia0af0d18970a8376edcccbe0f59e3d21e55c4f42
2022-07-12 11:39:43 -07:00
Alejandro Nijamkin
93c38283d5 Updates camera.md
Following ag/19119857, this existing piece of documentation is updated.
Note that most of the class names and links in the document were
incorrect, probably due to drift between refactors that renamed stuff
(like `StatusBar.java`) and this document.

Where it was possible and sensical, I updated the document. Where it
wasn't, I removed specifics related to class/method names or line
numbers. The general gist of how the double-click on the power button
ends up launching the camera is still correct.

Bug: b/235403546
Test: N/A
Change-Id: I017c2f83ce70545b9044e11ade7e5c15e8ca8a53
2022-07-07 16:22:31 +00:00
Chandru
ea6e54502f Suspend and resume DozeTriggers when entering and exiting car mode.
This change introduces a new DozeMachine state DOZE_SUSPEND_TRIGGERS
that is equivalent of DOZE but also suspends any triggers that awaken
the device. Entering car mode transitions the state machine to
DOZE_SUSPEND_TRIGGERS and leaving the car mode transitions to either
DOZE or DOZE_AOD depending on whether Always on Display is enabled.

Current behavior when entering car mode:
  - DozeService is finished.
  - Always on display is turned off
  - Tap on screen doesn’t wake up the device
  - Lifting device doesn’t wake up the device
  - Sending a notification doesn’t wake up the device.

New behavior when entering car mode:
  - DozeService is not finished.
  - Remaining behavior is the same as DozeTrigger stops listening to all
    triggers (sensors, intents, notifications)

Current behavior when exiting car mode:
  - DozeService is not running, normal triggers don't wake up the device

New behavior when exiting car mode:
  - DozeService is running, normal triggers wake up the device as
    expected.
  - DozeSuppressor transitions from DOZE_SUSPEND_TRIGGERS to DOZE/DOZE_AOD

Bug: 230968777
Fixes: 230968777
Test: manual
Test: atest com.android.systemui.doze
Change-Id: I5f49bb5700d7ed38763dccc8c5b6438d934c6476
2022-05-31 17:12:05 +00:00
Jason Chang
0c5df6883b Merge "Migrate USB audio device permission warning dialog for both Direct USB Access and AoC Offload feature" into tm-dev 2022-04-15 09:14:31 +00:00
Jason Chang
b30cec4800 Migrate USB audio device permission warning dialog
for both Direct USB Access and AoC Offload feature

According to USB audio warning dialog message conditions matrix, add
a UsbAudioWarningDialogMessage to handle the conditions.

Test: manually install NeutronPlayer to test usb audio device
permission warning dialog sentence.
Test: manually modify each audio api condition to test each sentence
correntness.
Test: atest SystemUITests

Change-Id: Ic9731590cb3bad259add1b93b43341af9518e107
2022-04-15 00:12:04 +08:00
Beverly
239e898e2e Update device-entry docs + add glossary
Note: images were resized to be height 300px

Test: manual
Bug: 218838846
Change-Id: I6a9b077286a09a42f3aa69a57c837e803bbb2f15
2022-04-05 14:53:22 +00:00
Matt Casey
2c0cd3c641 Merge "Update BroadcastDispatcher docs to say not to call goAsync()" into tm-dev 2022-03-24 19:01:56 +00:00
Matt Casey
f2606d0f1d Update BroadcastDispatcher docs to say not to call goAsync()
Shouldn't be needed within sysui as we're not worried about the process
being killed.

Change-Id: I14977770123c9b41fec1ac556a539cb8f09b9f2b
2022-03-24 13:40:51 +00:00
Beth Thibodeau
f65563f813 Remove old layout and flag
Since the new layout is complete and can handle notification action buttons,
we can remove the old one now.

- Deleted layout files (xml and PlayerViewHolder), and moved
PlayerSessionViewHolder into MediaViewHolder
- Removed the flag MEDIA_SESSION_LAYOUT
- Refactored MediaControlPanel to be more readable

Bug: 218875984
Test: atest com.android.systemui.media
Test: atest QSPanelControllerTest QuickQSPanelControllerTest
Change-Id: I37681542dec5cf10ec7346aa9f888f8f890d2c11
2022-03-18 17:57:22 -04:00
Dave Mankoff
e677aafd35 Merge "Add docs for CoreStartable." into tm-dev 2022-03-02 21:23:32 +00:00
Beverly
e6da737679 Update doze docs
* Rename aod.md => doze.md
* Add burn-in section
* Add doze suppressor section

Test: manual
Bug: 218509239
Change-Id: I4eb52989464f742b075d41f12f7fe4a759f94ebf
2022-02-28 20:40:08 +00:00
Dave Mankoff
ca4c0c2d32 Add docs for CoreStartable.
Bug: 205725937
Test: n/a
Change-Id: I651b240f2bc92ee8d6331263deb2d4c9058bea85
2022-02-25 09:25:45 -05:00
TreeHugger Robot
598ee84653 Merge "Update AOD/Doze documentation" 2022-02-10 17:09:29 +00:00
Beverly
19011cee7e Update AOD/Doze documentation
Test: manual
Bug: 218509239
Bug: 195430376
Change-Id: I831caab89d4501cb2248c4a1f9176ff2ac7a1e0a
2022-02-10 13:39:49 +00:00
Matt Pietal
d04be1df3c Fullscreen user switcher
Supports fullscreen user switcher launched from QS, and enabled by
config_enableFullscreenUserSwitcher. Allows adding guests, with
support for adding new users coming shortly. First round of work on
this feature.

Bug: 217365397
Test: atest UserSwitcherControllerTest
Change-Id: Ib81f44c9b950830a7d89b95cbaef53b7228ed5a4
2022-02-08 15:14:07 -05:00
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