Commit Graph

54 Commits

Author SHA1 Message Date
Wesley.CW Wang
5db44f0ece Enable custom clock feature
- Enable ClockOptionsProvider and the flag let SystemUI(keyguard) have
the ability to apply custom clock
- Remove Analog and Bubble clock from SystemUI

Bug: 146530441
Test: `adb shell content query --uri content://com.android.keyguard.clock/list_options` will list available provider, `adb shell settings put secure lock_screen_custom_clock_face "com.android.keyguard.clock.BubbleClockController"` will not switch to Bubble clock.
Change-Id: Iecfb5e2ea0cc72ca6eb1e16ca0dc0213a3257b6e
2020-02-19 15:04:28 +08:00
shawnlin
f45e024338 Rename the api from refresh() to refreshTime() to make it more clear
Test: make api-stubs-docs-update-current-api, make
Bug: 140102239
Change-Id: Ieb7403748b8b8a7f7c967b7228733a19caf4a306
2020-01-08 14:11:21 +08:00
Hyunyoung Song
8f9d34cb5f [DO NOT MERGE] qt-qpr1-sysui-dev @ build 5814791
Test: presubmit setup on source branch

Bug: 130289146 Create a Gradle build for SystemUI
Bug: 136279712 Daggerize FalsingManager
Bug: 137324767 "Unable to instantiate service com.android.systemui.doze.DozeService" exception breaks launcher tests
Bug: 137563419 Remove Bouncer reveal delay from bypass flow
Bug: 138787339 Allow Services and Activities to be injected into directly.
Bug: 139128921 [AS 3.5 RC2, SDK API 29 rev 2] Overload resolution ambiguity: while removing element from HashMap
Bug: 64712476 Import translations for dev branches


Change-Id: Ib7fd4706c070907fd556c3532957f3b1b046de6d
2019-09-01 00:31:47 -07:00
Robert Snoeberger
dc8fee7ea1 Don't animate clock when turning screen off.
This change stops the animation because there isn't a
transition from the no-header state to the music header
state when turning the screen off (to AOD). Since there
isn't a transition, there isn't an animation.

This assumes that there isn't a transition from unlocked to
lock screen. If there is, then there would be an animation
of the music going away while arriving at the lock screen.

Fixes: 137383007
Test: Checked repro steps in bug, clock doesn't animate.
Test: Also checked repro steps when audio is paused, clock doesn't
animate.
Test: atest KeyguardSliceProviderTest.java

Change-Id: If39777340b72bc623d6690bc4f784c7f5c26ea8d
2019-07-22 16:36:03 -04:00
Robert Snoeberger
8fa9dd8173 Merge "Disable custom clock faces in SystemUI" into qt-dev
am: 6613ea8da3

Change-Id: I4418cad82e478cc835da76dc5524bcbe23bdf592
2019-06-27 13:50:37 -07:00
Robert Snoeberger
61f04734b8 Disable custom clock faces in SystemUI
This will prevent custom clocks from persisting on dogfooders devices.

Bug: 136090066
Test: `adb shell settings put secure lock_screen_custom_clock_face
"com.android.keyguard.clock.BubbleClockController"` doesn't switch to
Bubble clock.

Change-Id: If9fc43295380d0bc37ca3df4c7187bd4faaf4bde
2019-06-27 10:35:32 -04:00
TreeHugger Robot
5fccfe7491 Merge "Remove the custom clock from LS during transition from AOD" into qt-r1-dev 2019-06-20 20:38:02 +00:00
Robert Snoeberger
146ab3cc33 Remove the custom clock from LS during transition from AOD
Fixes: 132273216
Test: visual -- transition to AOD with notifications
Test: visual -- transition to AOD without notifications
Test: visual -- remove last notification on LS
Test: visual -- add notification on LS
Change-Id: I1c003a8930cc557e388e2263e4a4fa41b912998a
2019-06-20 15:16:42 -04:00
Robert Snoeberger
f65513aff5 Check for header when restoring default clock.
This change tracks the state of the header in the smart space while a
custom clock is showing so that the correct digital clock size can be
restored when switching back to the default clock face.

Fixes: 135534500
Test: visual - take phone of dock and check size of default clock
Change-Id: Id4d1d46c94d8480f9675a3cf682a20a9706ba707
2019-06-20 10:40:13 -04:00
Robert Snoeberger
33259ad52e Hold wake lock while animations to bold clock.
In the bug, it appears that the phone dozed during the transition.
Holding the wake lock will keep the phone awake until the transition
ends. This is a speculative change because I wasn't able to reproduce
the issue.

Bug: 135458132
Test: checked that the transition still works, but I wasn't able to
verify the fix because I'm not able to reproduce the issue.

Change-Id: Ibfd4ae7522c30882051a41927c1714ace3f08b89
2019-06-19 14:58:56 -04:00
Lucas Dupin
89233c49aa Fix unreadable clock
- Always use white text with shadows on media
- Use lock screen colors for shade theme
- Remove legacy wallpaper visibility listener
- Remove shadow from black title

Test: set white wallpaper
Test: set dark wallpaper
Test: set dark wallpaper on home, light on ls
Test: set dark wallpaper on ls, light on home
Test: atest SysuiColorExtractorTests
Fixes: 134119878
Change-Id: I64ee2dee14322b2c02891c3ffe5fc0b25d1f100b
2019-06-12 04:22:24 +00:00
Lucas Dupin
a476c79c3a Fix unreadable clock
- Always use white text with shadows on media
- Use lock screen colors for shade theme
- Remove legacy wallpaper visibility listener
- Remove shadow from black title

Test: set white wallpaper
Test: set dark wallpaper
Test: set dark wallpaper on home, light on ls
Test: set dark wallpaper on ls, light on home
Test: atest SysuiColorExtractorTests
Fixes: 134119878
Change-Id: I64ee2dee14322b2c02891c3ffe5fc0b25d1f100b
Merged-In: I64ee2dee14322b2c02891c3ffe5fc0b25d1f100b
2019-06-12 02:10:43 +00:00
Robert Snoeberger
b66e982fa7 End transitions before starting new transition.
This ensures that the new transition starts from a good state so that
start-end state are computed corretly. Otherwise, it is possible that
the new animation starts from a transient state that doesn't compute
correct start and end states.

Some other cleanup:
 - TransitionListener that sets the regular digital clock to GONE is
   added before starting the transition to eliminate a race condition.
 - Setting the view to the beginning visibility is performed in
   AnimatorListener#onAnimationStart.

Bug: 132629519
Test: manual - flick to advance tracks while listening to YT music. It
is necessary to flick during the transition from lock to AOD to
reproduce the issue.

Change-Id: Id9d9732028a1693389f65dbb2f5c38ea60433bc6
2019-05-16 11:14:43 -04:00
Robert Snoeberger
78a79d299e Update size and vertical spacing of clock on keyguard.
Bug: 130223602
Test: visual
Change-Id: I09f6dff826d6ef297a4babdc9aa70b7f138dbeed
2019-05-09 13:30:11 -04:00
Robert Snoeberger
7cfa9ddc6c Prevent clipping clock during shrink, bold transition
Bug: 130223602
Test: visual - look at transition with music playing
Change-Id: I3bfd9f9c51bde3f827888e4eec43360db3f1d266
2019-05-07 10:11:54 -04:00
Lucas Dupin
f69aa77776 Log time ticks
AP is waking up but seems like clock is not being updated.
Added some logs to debug it.

Test: look at logs
Fixes: 130888082
Change-Id: I14e31a748573e26f161f837044ef61b57367bfe0
2019-04-26 11:05:23 -07:00
Robert Snoeberger
f9030c7c8d Transition to bold when shrinking clock
Bug: 130223602
Test: visual - AOD to lock screen while playing music
Change-Id: Id03f93854bdb98a83664dc651cf1f30618f09176
2019-04-23 15:52:22 -04:00
Robert Snoeberger
699568050d Add smart space to custom clock faces.
This changes adds a hook to the ClockPlugin to allow the
custom clock to control the position of the smart space.

Still todo:
 - move out of the way for the lock icon
 - don't slide smart space down on lock screen when no
   notifs are showing

Bug: 129348218
Test: Manually checked custom clock faces.
Change-Id: I2472f6b2bb54f94e2e673f01c78170c0e7f87627
2019-04-17 09:44:54 -04:00
Robert Snoeberger
372e13ff25 Handle additional users settings custom clock faces.
Fixes: 128607948
Test: Switched user and checked clock face.
Change-Id: I2dc895f2b82cfa39f64588215a535ade4c90054e
2019-04-09 16:06:45 -04:00
Robert Snoeberger
3358cfbe5c Add onDestroyView to allow clock plugins to clean up resources.
Fixes: 129859743
Test: New test point added to KeyguardClockSwitchTest
Change-Id: Ia0eb7cb329820a64a4783937f65135fda742a2d1
2019-04-03 17:29:16 +00:00
TreeHugger Robot
4def911641 Merge "Migrate KeyguardClockSwitch to dagger." 2019-03-22 22:09:31 +00:00
Robert Snoeberger
be35b76a9a Migrate KeyguardClockSwitch to dagger.
Bug: 122448325
Test: atest KeyguardClockSwitchTest
Change-Id: I1e68e3ba0cc92cd4fda9597d2c9c296b80298dc7
2019-03-22 14:33:24 -04:00
TreeHugger Robot
94eb144f77 Merge "Call ClockPlugin#onTimeTick on lock screen" 2019-03-22 16:09:30 +00:00
Robert Snoeberger
ae926733b6 Call ClockPlugin#onTimeTick on lock screen
Fixes: 129056419
Test: atest frameworks/base/packages/SystemUI/tests/src/com/android/keyguard/
Change-Id: If4cabc696a0ac5a02514634aa7670ef1f9db4b72
2019-03-21 11:40:16 -04:00
Robert Snoeberger
98312398ea Prevent, again, custom clock view from being visible on Home screen.
Bug: 124133570
Test: manual testing, and created b/128691778 to add regression tests.
Change-Id: I00dcb8b2a8acf6adfbcc77a1e6987824027d300c
2019-03-18 16:33:19 -04:00
TreeHugger Robot
47bfb774af Merge "Fix issue where clock scale would be wrong" 2019-03-05 04:31:23 +00:00
Lucas Dupin
4349952a3c Fix issue where clock scale would be wrong
Fixes: 127345346
Test: manual
Test: adb shell dumpsys activity service com.android.systemui
Change-Id: Icfd7b659e8ee1b088fbca5bd9c4a7d99c1e2b6d9
2019-03-04 16:50:41 -08:00
Robert Snoeberger
d747025c74 Fixes IllegalStateException caused by child already having parent
Detaches custom clock during onDetachFromWindow. This removes the
custom clock view from the keyguard during configuration changes.

The root cause for this issue is that the clock plugins remain in
memory after ag/6576777. There needs to be a way to communicate
to the clock plugin that it is done being used (something like
an onDestroyViews method). I'm leaving this work for a follow up
change.

Fixes: 127289716
Test: IllegalStateException not seen in logcat when performing repro
steps.

Change-Id: I184c52b25cb61325a920067dfc415b163f6a6b6d
2019-03-04 16:05:36 -05:00
Robert Snoeberger
9ad03f4ed0 Show installed clock plugins in picker app.
Added methods to ClockPlugin to provide information to picker app.
Due to this change, I bumped the api number of the ClockPlugin
interface.

Bug: 125370285
Test: atest ClockManagerTest
Test: checked clock from plugin apk appears in picker app
Change-Id: I0dc3d5a450f7d352900b077b28c670ebadb874e7
2019-02-28 15:12:00 -05:00
Lucas Dupin
e570af67de Restore keyguard status area header
Fixes: 123340905
Fixes: 123958307
Test: atest KeyguardSliceViewTest
Test: manual, playing media
This reverts commit ed00262486.

Change-Id: I1cc60346f9176b913ee0404b2b31981f736664ce
2019-02-12 15:21:24 -08:00
Robert Snoeberger
a1df7fb8f3 Prevent, again, custom clock view from being visible on Home screen.
Bug: 124133570
Test: Added to KeyguardClockSwitchTest.
Change-Id: Id697fc8d25de2842c06d777047ce627a8b7793eb
2019-02-11 14:11:30 -05:00
Lucas Dupin
de86b3754b Merge "Apply colors extracted from wallpaper to clock faces." 2019-02-10 18:12:46 +00:00
Robert Snoeberger
0397c843a3 Apply colors extracted from wallpaper to clock faces.
Bug: 122301289
Test: Looked at clock faces with various wallpapers.
Change-Id: I5c0bda2fa1f3da783315a10e1c2f8047d63e1e6d
2019-02-07 15:12:00 -05:00
Beverly
8fdb533e08 Make StatusBarStateController available to plugins
Test: atest SystemUITests
Bug: 115322193
Change-Id: I46e4b23c9839720a3eb10e381d7aaf79a74c6b33
2019-02-07 14:44:54 -05:00
Robert Snoeberger
15b4af1943 Move plugin and settings logic out of KeyguardClockSwitch.
This is in preparation for adding more logic related to docked state.

Bug: 122301289
Test: Used adb to switch between custom clock faces.
Change-Id: I0a13ef4e5894df1280a04c5a9df8bbed8054557b
2019-01-22 11:32:40 -05:00
TreeHugger Robot
be35c16844 Merge "Add custom typographic clock face." 2019-01-18 00:52:29 +00:00
Robert Snoeberger
ce8c204eac Add custom typographic clock face.
Bug: 122301289
Test: Used adb to enable clock face.
Change-Id: I052367c9671697f621cba4ecb7e6b21c0cec784c
2019-01-17 14:27:37 -05:00
Robert Snoeberger
7a529440c4 Simplify KeyguardClockSwitch 1/N.
End goal is to move clock switching logic out of this view class.
To do that, first need to make this class look less like a TextClock.

Bug: 122301289
Test: keyguard tests pass
Change-Id: Iccd7b0d02d1ec756d4e37f3d4ab47d0bcb55e566
2019-01-16 16:39:59 -05:00
TreeHugger Robot
b1c41456a5 Merge "Add custom stretch clock face." 2019-01-16 15:33:32 +00:00
Robert Snoeberger
496916b12f Add custom stretch clock face.
Bug: 122301289
Test: Used adb to set secure setting for this clock.
Change-Id: I6a55e991dca47be302de43e5da74671843925427
2019-01-16 09:09:56 -05:00
TreeHugger Robot
a9f50e954d Merge "Add custom bubble clock face." 2019-01-15 21:51:35 +00:00
Robert Snoeberger
046ee9ceca Add custom bubble clock face.
Bug: 122301289
Test: Using adb to set the settings value switches to bubble clock.
Change-Id: I9b5ab62796204cfdce7b9beb147f34f80b0db167
2019-01-15 13:03:26 -05:00
Lucas Dupin
7fc9dc16c2 AOD notification icons placement
Whenever there's a custom clock, notification icons should be on the top
left. The default clock will just show the dark shelf.

Test: atest NotificationStackScrollLayoutTest
Test: atest CollapsedStatusBarFragmentTest
Test: visual - with and w/o clock plugin
Test: visual - with and w/o RTL layout
Bug: 122301289
Bug: 111405682
Fixes: 120563185
Change-Id: I4c513d347f656262ee6f91bd208ab9f219e4419c
2019-01-12 04:57:20 +00:00
Robert Snoeberger
58f2315865 Initialize dark amount when a new plugin is connected.
Bug: 119756967
Test: Added test to KeyguardClockSwitchTest.
Change-Id: I716a92f72afcfb51bea80757eedc8797364b95c7
2019-01-10 15:51:32 -05:00
Robert Snoeberger
8bf1a3c125 Move to Extension for handling plugins plus default.
Bug: 118761043
Test: KeyguardClockSwitchTest adapted and passes.
Change-Id: I747274af894845a867b0d1ca38b2fd3338798e01
2019-01-10 13:44:00 -05:00
Robert Snoeberger
60854080d3 Fix custom clock face showing up outside of lock screen.
Bug: 122349591
Test: Added tests to KeyguardClockSwitchTest
Change-Id: Ie5f39ab598e993759ec628a071af81a52629a574
2019-01-04 13:19:53 -05:00
Robert Snoeberger
6a0140ab95 Add container for big clock behind NSSL and KeyguardStatusView.
Bug: 120497585
Test: Added tests to KeyguardClockSwitchTest, pass locally.
Change-Id: Icc1199a67b9a4728e4d0f0b50ea98f5221de904d
2018-12-20 13:20:39 -05:00
Robert Snoeberger
e3b3e783b1 Add option for plugins to hide KeyguardSliceView.
Option defaults to showing the slice view so that it doesn't break
existing plugins.

Test: SystemUIGoogleTests pass.
Test: SystemUITests pass.
Test: slice view is hidden when using example plugin.
Bug: 118496011
Change-Id: I574009170da4703e84fd392e327e1cb84ada6cd0
2018-12-18 10:38:23 -05:00
Robert Snoeberger
9c1074fbaa Send time zone changed event to clock plugin.
This prevents plugins from needing to register for time zone
changed broadcasts. The event can be relayed from
KeyguardUpdateMonitor.

Bug: 120666411
Test: example plugin updates when time zone is changed
Change-Id: I84732887527db8575504af27cc8ed537118696c6
2018-12-10 09:33:38 -05:00
Robert Snoeberger
e32efd76af Add setDarkAmount method to ClockPlugin interface.
setDarmAmount implementations provided by clock plugins
should use the dark amount to transition into and out
of the doze state on AOD. For example, the size of the
clock could shrink in the Y direction when leaving doze
to make room for the notification stack scroller.

Bug: 119035943
Test: KeyguardClockSwitchTest passes locally.
Change-Id: I9968dc2cc5ab8000ff525f3d1d06ffbf73359086
2018-11-12 09:29:59 -05:00