440 Commits

Author SHA1 Message Date
JianYang Liu
05649fcf17 Updated Fullscreen user switcher to not use fitsSystemWindows.
fitsSystemWindows="true" has default behavior of setting padding of the
view to ensure contents don't overlay system windows. In the case of the
fullscreen user switcher, we don't need this behavior.

Bug: 150302361
Test: Manual (set lockscreen, restart, click "Cancel")
Change-Id: Ifc597c2b96862abc3283d6af1a0c2765431c71af
2020-03-06 14:04:37 -08:00
Youngjun Kwak
91b4f26c5b Merge "DO NOT MERGE Create KeyguardViewController that extracts view-related logic in KeyguardViewMediator and re-wire Dagger accordingly." into rvc-dev 2020-03-06 20:55:29 +00:00
kwaky
198b5dc318 DO NOT MERGE Create KeyguardViewController that extracts view-related logic in KeyguardViewMediator and re-wire Dagger accordingly.
Prior to this change, KeyguardViewMediator used StatusBarKeyguardViewManager for making view-related changes.
This meant that KeyguardViewMediator could only be used with a specific Keyguard view that is mounted to the StatusBar.
This change makes KeyguardViewMediator compatible with any Keyguard view no matter where it is mounted, as long as it implements
the methods defined in the KeyguardViewController interface.

For AAOS, This refactorization allows us to implements our own Keyguard View and its Manager as the next step.

Bug: 150467593
Test: Build and Manual Test -- Android builds successfully on Hawk and Pixel 2 and interacting with Keyguard functionalities works.

Change-Id: Idda93514eac030f1d92523aebc9444a4d55b21d2
2020-03-05 16:03:51 -08:00
Abhijoy Saha
84590ea25a Use abstractions to allow FullscreenUserSwitcher take advantage of SystemUIOverlayWindow.
This change includes the following:
* Rename SystemUIPrimaryWindow to SystemUIOverlayWindow
* Create Mediator and View controller abstractions that allows
developers to easily take advantage of SystemUIOverlayWindow that is
managed by a single SystemUI Object: SystemUIOverlayWindowManager.
* Convert FullscreenUserSwitcher to take advantage of the newly added
abstractions.

Bug: 147826738
Test: Manual
Change-Id: I19825da81f8d1b1259a2ba115e0238a9ffa69e37
Merged-In: I19825da81f8d1b1259a2ba115e0238a9ffa69e37
2020-03-05 14:39:59 -08:00
kwaky
371e62126a Apply the selection state that reflects the current task stack upon restarting the Navigation Bar.
Previously, while restarting the Navigation Bar, we omitted the step where we
apply the selection state that reflects the current task stack.

This omission caused CarFacetButtons to lose their selection state on
certain events.

Bug: 148211695
Test: Unit Test
Change-Id: Icfa845b87ca7456d3765602b3daacd589a94f309
2020-03-04 15:18:41 -08:00
Dave Mankoff
a40c4b47ef Merge changes from topic "b150393918-lock-icon-controller" into rvc-dev
* changes:
  Move SB.StateListener from LockIcon to Controller.
  Remove the OnUserInfoChangedListener implementation from LockIcon.
  Pass LockscreenIconController around instead of LockIcon.
2020-03-04 15:54:37 +00:00
Dave Mankoff
c0d9a7d889 Pass LockscreenIconController around instead of LockIcon.
This also makes KeyguardIndicationController properly injectable, and
moves some of the LockIcon touch-handling that was happening inside
of it into the LockscreenIconController.

To make KeyguardIndicationController injectable, a new
WakeLock.Builder was added that can be injected and used to create
new WakeLocks as needed.

Bug: 150393918
Test: atest SystemUITests && manual
Change-Id: I3ad871164a822c0c63c0e32da777beb287144a35
2020-03-03 20:52:06 -05:00
Babak Bostan
a860012413 Add toast message when bluetooth connects to voice recognition.
Bug: 143531081
Test: Manual
Change-Id: I342a1e5eefc59d25a8bea1c0fe72b8669bfdbe84
(cherry picked from commit d0555bba57fc8b2510a458cf07757e0db07e3aa6)
2020-03-03 12:14:28 -08:00
Hayden Gomes
574bb77823 Merge "Adding system usages to car volume settings" into rvc-dev 2020-03-02 18:09:34 +00:00
Hayden Gomes
e1000392e7 Adding system usages to car volume settings
(Cherry-picked from 353ef627803f7b9e5417c7c07659edadf4e8846c)

Bug: 144872669
Test: Build, manually play around with volume settings
Change-Id: Ia5589689e5c37be3898ac1edb2df00b84280cb7d
Merged-In: Ia5589689e5c37be3898ac1edb2df00b84280cb7d
2020-02-28 12:37:33 -08:00
Heemin Seog
dfb1fe98af Merge "Generalize AutoHideController to be shared" into rvc-dev 2020-02-28 16:55:28 +00:00
Heemin Seog
e67cefea27 Generalize AutoHideController to be shared
Bug: 147427386
Test: atest SystemUITests for sdk_gphone_x86 and atest
CarNavigationBarControllerTest HvacControllerTest for hawk-userdebug

Change-Id: I9d0ee8135c1a53abaeb64f4b7b2aebd9208c0160
2020-02-26 16:54:14 -08:00
Dave Mankoff
3c6aaab6c4 Make PhoneStatusBarPolicy injectable.
Add DateFormatUtil that makes DateFormat methods non-static,
(is24HourFormat specifically).

PhoneStatusBarPolicy no longer needs a context.

Bug: 147505562
Test: atest SystemUITests
Change-Id: I7b272441971f5a74f2736cd545498b8b4077fca6
2020-02-25 15:46:28 -05:00
Abhijoy Saha
ec95199f43 Have volume UI dismiss on home button press.
Register a receiver that listens for Intent.ACTION_CLOSE_SYSTEM_DIALOGS
and dismisses the volume UI when such an intent is received.

Bug: 149228466
Test: Manual
Change-Id: Iabb706b1d4cc54cb84f228aad95bfdb7e6f75851
2020-02-19 13:48:58 -08:00
TreeHugger Robot
65ac963706 Merge "Move SBTouchableRegion out of HeadsUpManagerPhone" 2020-02-18 22:16:39 +00:00
Beverly
95a0802acb Move SBTouchableRegion out of HeadsUpManagerPhone
Move the StatusBarTouchableRegionManager to StatusBar where it will be
recreated whenever new views are created (instead of within
HeadsUpManager)

Test: atest SystemUITests
Change-Id: I802ec8ea122a2cede234ec7536f1177f7b261fd0
2020-02-18 14:49:33 -05:00
TreeHugger Robot
f5737faff9 Merge "Remove final call to Dep.get(FalsingManager.class)" 2020-02-18 16:38:44 +00:00
Dave Mankoff
c43a9482b5 Merge "Provide PipManager through injection." 2020-02-18 16:14:53 +00:00
Sergey Nikolaienkov
5cb6e52e81 Introduce BubbleModule and KeyguardModule
This CL is the 4th in the series of CLs which intend to "unbind" StatusBar on TV.
In order to make StatusBar really optional and thus to allow us to unbind it, we also need to make some of the classes that depends on it optional as well. For all these cases we need to move from @Inject-annotated contructors to @Provides annotated methods. For this we are introducing BubbleModule and KeyguardModule.

Change-Id: I57009153e2279078ac88c42a53d3963a96eb8452
Test: make SystemUI; atest SystemUITests
Bug: 146188087
2020-02-14 07:16:34 +01:00
Sergey Nikolaienkov
3d84cb4a45 Introduce StatusBarModule
This CL is the 3rd in the series of CLs which intend to "unbind" StatusBar on TV.
In order to make StatusBar really optional and thus to allow us to unbind it, we also need to make some of the classes that depends on it optional as well. For all these cases we need to move from @Inject-annotated contructors to @Provides annotated methods. For this we are introducing StatusBarModule, as well as StatusBarPhoneDependenciesModule and StatusBarDependenciesModule - these two provide dependecies needed to build StatusBar, but not the StatusBar itself

Change-Id: Ie3551bda7056465159f2c7fde4989e009f277304
Test: make SystemUI; atest SystemUITests
Bug: 146188087
2020-02-14 07:16:34 +01:00
Sergey Nikolaienkov
6f157bd670 Introduce StatusBarPhoneModule
This CL is the 2nd in the series of CLs which intend to "unbind" StatusBar on TV.
In order to make StatusBar really optional and thus to allow us to unbind it, we also need to make some of the classes that depends on it optional as well. For all these cases we need to move from @Inject-annotated contructors to @Provides annotated methods. For this we are introducing StatusBarNotificationModule.

Change-Id: Id56f970d21323f49e859715b6874f5cd773aa62a
Test: make SystemUI; atest SystemUITests
Bug: 146188087
2020-02-14 07:16:34 +01:00
Sergey Nikolaienkov
f6ad63293a Expand NotificationsModule
This CL is the 1st in the series of CLs which intend to "unbind" StatusBar on TV.
In order to make StatusBar really optional and thus to allow us to unbind it, we also need to make some of the classes that depends on it optional as well. For all these cases we need to move from @Inject-annotated contructors to @Provides annotated methods. For this we are expanding NotificationsModule.

Change-Id: Icccafd2170f2fdffb8412370056aab7042ffd580
Test: make SystemUI; make CarSystemUI; atest SystemUITests
Bug: 146188087
2020-02-14 07:16:34 +01:00
Dave Mankoff
30a66e364f Remove final call to Dep.get(FalsingManager.class)
CarStatusBar had one last reference in its dump method.
FalsingManager, however, directly registers itself with the
DumpController, so this call is redundant.

Bug: 136279712
Test: atest SystemUITests
Change-Id: I3731e7ecac2f147e5d3967d4219f22d17e810843
2020-02-12 13:59:12 -05:00
Dave Mankoff
f50191441a Provide PipManager through injection.
Adds a controller for PipControlsView so that depdencies can be provided
via injection.

Adds a TvPipComponent to allow injection of PIP related views into related
classes.

Bug: 146660939
Test: atest SystemUITests
Change-Id: Ic1a8f8f0f8e5506f354bb1f07b179db1d7e89577
2020-02-12 11:12:02 -05:00
Ned Burns
46597ba6c0 Remove subclasses of NotificationEntryManager
First, moves most of the notification initialization logic out of
StatusBar and into NotificationController.

There is only one subclass of NotificationEntryManager in this project:

- CarNotificationEntryManager: stub implementation that disables most
functionality.

Removes CarNotificationEntryManager. Adds a config boolean to disable
notification rendering instead. Skips most notif initialization logic if
this flag is false.

Change-Id: I23ed86efa209f43314c162dcf32fe97112de7bc7
Test: atest, manual
2020-02-03 01:06:55 -05:00
Heemin Seog
a2968105b2 Merge "Move test mapping to cover whole Car Sysui" 2020-01-27 22:54:15 +00:00
Heemin Seog
5b5b028e7d Move test mapping to cover whole Car Sysui
Bug: 148395487
Test: none
Change-Id: I9e0dd732c478ed301e20afc1c453ab839b100bb3
2020-01-27 11:58:37 -08:00
Bernardo Rufino
6408cbc906 Add ToastUI to CarSystemUIBinder
This was lacking from ag/10097974.

Bug: 148388531
Test: HomeHelperTest is included in TEST_MAPPING
Change-Id: I73e9d9bbf6499e4d0c3dc7654118e52f6b3a2950
2020-01-27 18:48:03 +00:00
Bernardo Rufino
ab338ac42c Move text toast creation to system UI
In order to do that, NotificationManager now calls
StatusBar.showToast(), which is in SystemUI. StatusBar then calls a new
component, ToastUI, which is responsible for rendering the toast. The
code for rendering the toast was extracted from the Toast class, so it
should behave identically.

Also refactored the code a bit on NotificationManagerService, creating
two children of ToastRecord (one for custom, other for text toasts).

The change is gated in Toast class in this CL, but it's also gated on
the system server, so apps can't circumvent the background block.

Bug: 128611929
Bug: 144754526
Test: atest android.widget.cts.ToastTest
Merged-In: Id0021cdc6f72f41b55ff1c5a4f09ae7687586460
Change-Id: Id0021cdc6f72f41b55ff1c5a4f09ae7687586460
2020-01-27 11:13:27 +00:00
Jian-Yang Liu
acf1345d01 Merge "Fixed CarStatusBar to use Car's implementation of navigation bar." 2020-01-23 20:16:21 +00:00
Tiger Huang
527244459c Window Manager Flag Migration (12/n)
- Unhide new APIs
- MaxInsets -> InsetsIgnoringVisibility
- Deprecate SystemUI flags
- Deprecate some other stuff

Bug: 118118435
Test: Build, CTS coming soon
Change-Id: I0a0cbdb48258b3779d536668b59e8c88f3c96d18
Exempt-From-Owner-Approval: Trivial rename
2020-01-23 14:11:39 +01:00
JianYang Liu
a02c99ec54 Fixed CarStatusBar to use Car's implementation of navigation bar.
Resolves the issue where for Car we switched back to only showing
Phone's implementation of StatusBar rather than Car's.

Bug: 148078465
Test: Manual
Change-Id: Id1b342e3b7a0e9437422c1edd221f320d52927de
2020-01-22 21:40:44 +00:00
Jorim Jaggi
7fb715c425 Introduce Window.setContentOnApplyWindowInsetsListener
When root-level content containers fit insets, they used to just
apply and consume the entire system insets. However, with the new
Inset APIs, and with deprecating ADJUST_RESIZE IME flag, we want
to give apps an easy way to customize this behavior.

For that, we introduce Window.setOnContentApplyWindowInsetsListener
that returns what kind of margins/padding should be applied and
what should be dispatched to the content views. This is essentially
a replacement for SYSTEM_UI_FLAG_LAYOUT_* as well as
SOFT_INPUT_ADJUST_RESIZE: It allows apps to choose which insets
should be handled on the window level vs view level.

For that, we mark the window decor views as
FRAMEWORK_OPTIONAL_FIT_SYSTEM_WINDOWS, in order to distinguish the
case when support library calls makeOptionalFitSystemWindows(). This
is because of two reasons:
- We don't want the listener to be invoked twice.
- We can not do the compat ping-pong between onApplyWindowInsets
and fitSystemWindows. This is because during the ping-pong, the
result of the OnContentApplyWindowInsetsListener would be lost.
However, we still need to do the compat ping-pong for
ActionBarOverlayLayout in the support library (until that gets
migrated to use onApplyWindowInsets), so we have this separate
dispatching path that only gets used for framework optional
fitting views.

Test: WindowTest
Bug: 118118435
Change-Id: I4b514addd9e094163062d651972f85615b4a35db
2020-01-22 18:09:04 +01:00
Charles Chen
eb0ebddc1a Merge "Split status bar window (1/N)" 2020-01-20 17:23:36 +00:00
Calvin Huang
165bf8f44a Set overlayable for CarsystemUI NavBar
Bug: 142822006
Test: Nav icons should be hidden accordingly
Change-Id: I88d954c03076dfa9489564e0a9684be265f4c886
2020-01-17 13:33:48 -08:00
wilsonshih
e832194dd0 Split status bar window (1/N)
This is the first step to create another new window for status bar.

Small window => TYPE_STATUS_BAR: The bar on top of screen.
Large window => TYPE_NOTIFICATION_SHADE: Anything else.

Bug: 136993073
Test: build then flash
Test: atest WmTests SystemUITests
Test: atest RegisterStatusBarResultTest InsetsFlagsTest

Manual Test:
- Bouncer can show when leave showWhenLocked activity.
- StatusBar can show when comes HUN in fullscreen mode.
- StatusBar can play enter/leave animation in fullscreen mode.
- Able to drag notification panel when bubble/glow existing.
- Switch to market launcher, and run above tests.
- Drag notification panel from launcher several times and observe it
  works fine.

Change-Id: Id9f72cd0e21f01b50d57f02ea60f97c6460926b7
2020-01-17 15:33:56 +00:00
Heemin Seog
886d97633a Merge "User switcher in primary sysui window" 2020-01-14 18:57:02 +00:00
Ned Burns
c0cd28332f Rename NotifListBuilderImpl and NewNotifPipeline
Minor cleanup to better reflect their reponsibilities:

NotifListBuilderImpl -> ShadeListBuilder
NewNotifPipeline -> NotifPipelineInitializer

Test: atest
Change-Id: Ib4cd5f06567129e5720fdcd17ef9a9bc0dcf577b
2020-01-13 22:35:22 -05:00
Heemin Seog
193c7167d5 Merge "Create a new window to host car specific sysui" 2020-01-13 17:03:06 +00:00
Heemin Seog
17134e2953 User switcher in primary sysui window
Bug: 147495368
Test: manual (add security, reboot, add new user, reboot)
Change-Id: I638f57de2e9117a1cb5aa6660d5a03b58894d31f
2020-01-10 14:47:02 -08:00
Heemin Seog
d9af298b18 Create a new window to host car specific sysui
Currently we're using STATUS_BAR_SUB_PANEL windowing layer, but we'll
need to revisit this in the future.

Also the height is calculated by appending the height of the navigation
bar. We'll also need to discuss with the windowing team on how to get
the full height of the display using MATCH_PARENT.

Bug: 147455109
Test: manual (test that the window can hold content with a test screen)
Change-Id: I3b821ec0382515804a4ee80396f15d608467efdf
2020-01-10 14:45:53 -08:00
Dave Mankoff
02dcaf5347 Make NotificationRowBinder injectable.
Part of prepatory work for changes coming to
ActivatableNotificationView.

Bug: 147245740
Test: atest SystemUITests
Change-Id: Id85767ab3365e0da659941f267b5d925d6da9dd9
2020-01-10 13:39:04 -05:00
Dan Sandler
dc4c1003a8 Revert "Convert NotificationContentInflater to singleton"
This reverts commit 8b6968328d3d6776d2e55fcb29f70f80296c1aff.

Bug: 147407617
Change-Id: I6208344a26069239e47665710dd2fea93136ab95
2020-01-09 15:18:23 +00:00
Kevin Han
8b6968328d Convert NotificationContentInflater to singleton
Convert NotificationContentInflater into a singleton since it has
almost no state, making it easier to inject and re-use.

Move the only per-row state it has, cached remote views, to a separate
class NotifRemoteViewCacheImpl that manages the lifetime of the cached
remote views based off the notification's lifecycle. This has the added
benefit of being re-usable for content recycling later on.

Bug: 145749521
Test: atest SystemUITests
Test: atest NotificationContentInflaterTest w/o @Suppress locally
Test: smoke test
Change-Id: Iedda71d7e5edea9e30580e99eb5b6ec545bb708d
2020-01-08 14:21:21 -08:00
Dave Mankoff
af8163f77d Revert "Revert "Refactor PanelView and NotificationPanelView into Controllers.""
This reverts commit da13c3fd3da28ae39e359f9481eba30b12ec9531.

This includes a fix for the original issue - an NPE in
NotificationPanelView.

Bug: 147295216
Change-Id: Id1a71b0e30aada460a70d738c5451e21dd412a7a
Test: atest SystemUITests
2020-01-08 14:55:19 -05:00
Zhuoyao Zhang
b2c90b1e3c Merge "Revert "Refactor PanelView and NotificationPanelView into Controllers."" 2020-01-08 18:53:06 +00:00
Zhuoyao Zhang
da13c3fd3d Revert "Refactor PanelView and NotificationPanelView into Controllers."
Revert "NoticationPanelView now has a controller."

Revert submission 9930899-b141751146-npv-controller

Reason for revert: b/147295216
Reverted Changes:
I9a92cad63: Refactor PanelView and NotificationPanelView into ...
I454bc4790: NoticationPanelView now has a controller.

Change-Id: Iae9db40e9385e1b88bd2f5f162a5f6d53d91878d
2020-01-08 18:30:30 +00:00
Beverly Tai
182306a20f Merge "Use PreparationCoordinator to inflate notifs" 2020-01-08 14:16:25 +00:00
kwaky
34c6bdee7e Support Unseen Indicator Icon in all CarNavigationButtons
Bug: 146508662
Test: Manual + Unit Tests
Change-Id: I464f4f080f739923492daf2715753e3892ada7dd
2020-01-07 15:44:13 -08:00
Beverly
8b493dfbb3 Use PreparationCoordinator to inflate notifs
In the (old/current) notification pipeline, NotificationEntryManager
handles inflating views.  In the NewNotifPipeline, PreparationCoordinator
will trigger inflation via a NotifInflater and will keep track
of what is/isn't inflated.

If a notification isn't done inflating, then the PreparationCoordinator
will filter it from the NotifListBuilder.

Test: atest SystemUiTests
Change-Id: I7a5c01041312ff179e8c723f66207b3bd042c857
2020-01-07 16:21:38 -05:00