Commit Graph

80 Commits

Author SHA1 Message Date
shawnlin
f603ea0121 Fixed battery percentage not animating when showing/hiding
Add layout transition animation

Fixed: 123362236
Test: manual - turn on/off show battery percentage in settings and go to
AOD

Change-Id: Ie98434e565d23461d82729d582f8ff4e63d8ac88
2019-03-12 15:44:37 +08:00
Evan Laird
85ee4a3cdf Always show time remaining estimate string in QS
QS will always show the time remaining estimate string, unless charging
or the estimate is unavailable

Test: visual
Fixes: 127519046
Change-Id: Iaa268ce631d3196967748b7f562d26e19ddeb465
2019-03-06 20:41:37 -05:00
Evan Laird
2259da403c Create a battery icon that loads paths
Create a new battery drawable that will load enough resources from
frameworks/base/core/res/res/ to allow for theming overlays. The current
things are overlayable:

- Perimeter path: the outer shape of the battery (including the
terminal)
- Fill mask: path defining the shape of the fill
- Bolt path: charging bolt path. draws with appropriate protection for
visibilty
- Powersave path: path of the plus sign that draws when in powersave
mode. also draws with protection

Test: visual; sysui demo mode
Bug: 123705805
Change-Id: I2bb15fd10e3fec63cb115a8f216794933b717404
2019-02-26 13:42:03 -05:00
TreeHugger Robot
5955be84ae Merge "Move battery % down in QS, fix a lot of things" 2019-01-12 02:00:25 +00:00
Evan Laird
a5a73c5a9e Move battery % down in QS, fix a lot of things
- Move the battery percentage next to the system icons in quick settings
- Always show the percentage, and optionally show the estimate text
based on battery settings
- Move the estimate text into the BatteryMeterView
- Move the fetching of the estimate off of the main thread

Test: visual
Change-Id: Ie37952079b2394c67464f69eb8a2f0089b08875d
Fixes: 119799219 - padding
Fixes: 120996084 - moving estimate fetch off main thread
Bug: 116481529
2019-01-11 15:20:37 -05:00
Chris Wren
1acdb5e6bb remove status bar icon logs
partial revert of Ife5ce988

Bug: 122451213
Test: runtest systemui
Change-Id: I026217ea8e95ba0805b05e62a5d527c8c3a1d9ce
2019-01-11 10:53:51 -05:00
Beverly
1be62f46ab Make DarkIconDispatcher visible to plugins
Test: manual
Bug: 115322193
Change-Id: I6204d771e476c504e9070ebc88dd8fd44b268635
2019-01-02 16:13:34 -05:00
Fabian Kozynski
648e555b9b Lockscreen changes font on Overlay change
Change-Id: I96ed7f3a0ce8bd9fb8ce8c05280a2950d0efac5f
Test: Manual (using HotDogOverlay)
Bug: 121124205
2018-12-19 15:50:11 -05:00
Jason Monk
8e4e4cb9a6 Bring lifecycle to sysui
- Add a method to observe callbacks based on lifecycle
 - Add 2 examples of this in real code (one for a view, one for a
   fragment

Test: runtest systemui
Change-Id: I9e1e4a617a63e702602472b2079a477e373ff1e9
2018-12-06 13:11:58 -05:00
Evan Laird
698839be62 Fix battery icon showing in QQS when it shouldn't
BatteryMeterView was listening to sysui tuner for its visibility, but in
QQS we want to control it via settings

Test: visual
Change-Id: I52f1e389b82e7a75c30e66c1d4547e5b4875a37e
2018-12-05 15:49:12 -05:00
Evan Laird
4bf21dffaa Add estimated time remaining text to QS
- Add an API to BatteryController to get an estimated time remaining
string.
- BatteryController will now check up to once per minute what the
estimated time will be and builds the string using PowerUtil.
- If the "show percentage" setting is on, the estimated time remaining
string (and battery icon) will show next to the system icons in QS
- Also make the battery percent in QS obey the setting

Test: visual
Bug: 116481529
Change-Id: Iaafa00127c8b8baae40956254a1237c8b7ac079b
2018-11-13 10:47:14 -05:00
Lucas Dupin
098188a938 Fix color resolution on status bar
Test: visual
Change-Id: I306d6ffe0cc0b861d17bc26784b6e2c1db2ee2c2
Fixes: 112823374
2018-08-23 16:19:46 -07:00
TreeHugger Robot
395fd37509 Merge "Fix battery percent multi-user" 2018-07-30 16:20:36 +00:00
Evan Laird
6ead1e37b1 Fix battery percent multi-user
Test: visual
Change-Id: I41b2c72c9910d8756b218a6d1a4ef7b84c6e2cee
Fixes: 110210915
2018-07-23 17:08:24 +00:00
Evan Laird
cf0aa64ba6 Merge "Add config to disallow the battery % option" into pi-dev am: a063da83f1
am: 2272f08724

Change-Id: I4de78fe137ed23012f13447d9460bfe19916df33
2018-06-21 15:29:10 -07:00
Evan Laird
54ff81b81e Add config to disallow the battery % option
This config will be respected and override the value found in Settings
if a user restores from a device which had SHOW_BATTERY_PERCENTAGE set
to true. It is also respceted on the keyguard where we would typically
show the battery percent if the device is charging.

Percentage is still shown above QS though.

Test: visual
Change-Id: I1f59b68097ffcbb7dda9d2ec99ea0ba9062c6dff
Bug: 80129194
2018-06-13 20:12:49 -04:00
Lucas Dupin
c510d41596 Dump keyguard status bar state
We didn't have KeyguardStatusBarView dumps in our dumpsys,
adding more info will make our lives easier in the future.

Test: adb shell dumpsys activity service com.android.systemui
Change-Id: I07af14922501889cc15005f01463674f0651dfde
Fixes: 109899206
2018-06-12 13:08:23 -07:00
Evan Laird
1db460dc88 Merge "Status bar icons 15 dp" into pi-dev am: 97abc762cc
am: 4811db16a5

Change-Id: I75f145a1cd7445674964e0e7b1127290df3bad87
2018-05-21 08:14:03 -07:00
Evan Laird
39ea810070 Status bar icons 15 dp
Shrink all status bar icons by 2dp. This means setting a scale factor on
anything that is a StatusBarIconView, and manually scaling down wifi and
mobile data groups.

Also fix the padding between the mobile data view and the battery

Also snuck in a fix for the battery saver icon clipping on QS

Change-Id: I5f5430d9e9c66f5c2794dcf4974cf18aa3bff061
Test: visual
Fixes: 74985733
Fixes: 79967193
Bug: 77822905
2018-05-18 19:52:23 -04:00
Jason Chang
b4e879d6e5 [SettingsLib] Update Utils APIs usage
Update Utils.getColorAttr and similar methods in Utils to return a ColorStateList instead of a color

Bug: 74872054
Test: Force to display different color items then manually test
Change-Id: I92697a597b532ba95f29a886baa114ed6d0ac632
2018-04-11 11:17:58 +08:00
Rohan Shah
cc3d1d8b96 [QS] Update landscape UI
Rolling forward the landscape UI changes (To not break taimen with a
notch this time!). OG CL: ag/3717677

Shorten status bar height in landscape and update colors to use
wallpaperTextColor when in landscape mode.

Additionally modified scrim opacity for the QS panel to provide more
contrast/focus on content.

Test: Visually
Bug: 73808887
Change-Id: I249579d2898b9915868bb584661864d10ed88de2
2018-04-04 09:36:49 -07:00
Rohan Shah
8a0d3fcf17 Revert "[QS] Update landscape UI"
This reverts commit bc204efbe5.

Reason for revert: Causes crash on rotation due to something with config.xml overriding. Reverting as it's blocking daily build
Bug: 77217078
Test: Ran build, checked rotation
Change-Id: I79e94fb1703f888ac167cdae20142e130a2e80b3
2018-03-29 11:33:24 -07:00
Rohan Shah
bc204efbe5 [QS] Update landscape UI
Shorten status bar height in landscape and update colors to use
wallpaperTextColor when in landscape mode.

Additionally modified scrim opacity for the QS panel to provide more
contrast/focus on content.

Test: Visually
Bug: 73808887
Change-Id: I74713587ca426020cb15960800a4d2b6ac5f6466
2018-03-26 15:10:28 -07:00
Evan Laird
ef160f239a Fix battery background color in QS
Battery was only getting a foreground color, not background. Fix by
using the SystemUI context so it finds the correct light colors for both
foregorund and background.

Test: visual with light wallpaper
Change-Id: I6e18ce9331a5e78241d8c24ba96a8b843c646813
Fixes: 72431673
2018-01-29 14:10:38 -05:00
Evan Laird
058c8aee39 Initial support for camera cutout in CollapsedStatusBar
- Display a space view exactly covering where the display cutout is

- Custom layout for system_icons because this view needs to now layout
right-to-left, and hide icons that don't fit. Similar to notification
icon container but in the other direction. Still needs dots and to limit
the # of icons

- When in landscape/seascape, the cutout space disappears and instead
the status bar insets itself by the same amount that the window is
letterboxed

- Moved battery percent back to the right of the battery because the
time is no longer on that side

Test: adb shell cmd overlay enable
com.android.internal.display.cutout.emulation && adb shell stop && adb
shell start # to start emulation
Bug: 63772836

Change-Id: I8071bfb4983a9d9306df1487cdac956494e80c28
2018-01-18 09:20:13 -05:00
Charles He
6a79b0dff1 StatusBar: add DISABLE2_SYSTEM_ICONS flag
Add a StatusBarManager flag to control the visibility of system icons
such as connectivity info, battery, etc. Note that the clock is
controlled separately through DISABLE_CLOCK.

Also note that this flag differs from DISABLE_SYSTEM_INFO, which
controls the system icons and the clock as a whole, but only works for
the collapsed status bar (CollapsedStatusBarFragment).

Bug: 65813398
Test: runtest systemui
Test: manual, by using a modified version of TestDPC and
      DevicePolicyManagerService

Change-Id: Icb61c7bb1a625edd818be7a66d7f15c3e812237b
2017-09-25 21:29:27 +01:00
Jason Monk
f8c2f7bd7b Add metrics for status bar
Test: runtest systemui
Fixes: 65289824
Change-Id: Ife5ce98862fc6a92740eaf80cdc0b74cb01dd04e
2017-09-06 15:03:41 -04:00
Jason Monk
a6f1db3a9e Fix multi user battery percentage
Test: Use battery percentage with multi user, like at all
Change-Id: Ie59d2409e79469138c04450528ed3e9f4e1c06aa
Fixes: 64442190
2017-08-30 19:18:00 -04:00
Evan Laird
75c98207b8 Merge "Fix battery percent text not updating on Font size change" into oc-dev am: 2ca91661f0
am: 2c34b5bf55

Change-Id: I95d4e069fa93ac025598a7a2954f7ed9f566fd25
2017-06-20 20:07:40 +00:00
Evan Laird
ecc93f28b9 Fix battery percent text not updating on Font size change
The view wasn't actually setting the new text size when there was a
display scale or font size change. But now it does.

Test: visual
Change-Id: I3a38c779fe75e4fe29e962bb7d46cdef4da9e829
Fixes: 37919352
2017-06-16 09:57:29 -04:00
Lucas Dupin
987f1937a0 Change keyguard theme when wallpaper colors change
Bug: 38163994
Bug: 37014702
Bug: 62053168
Test: visual
Change-Id: I5a2da4ef2ad6fc1dab71588f2d0f5bd207731900
2017-06-01 12:14:53 -07:00
Daniel Nishi
8af93cb240 batterymeter -> just meter.
This updates some of the names of the colors to make them more general
for non-battery usage.

Bug: 35245772
Test: Manual
Change-Id: I048f673037c4bd7279fd7c55f2d55be6b3618b41
2017-05-15 14:37:20 -07:00
Jason Monk
9a376bcd45 Fix the status icon colors in QS
Requires lots of theming magic

Test: visual
Change-Id: I1cd28b570f30989b496065c0e06a5aca461deb41
Fixes: 37619734
2017-05-12 16:16:39 -04:00
jackqdyulei
ff5bd948b0 Refine BatteryInfo and battery drawable
1. Remove "m" prefix for all public field
2. Change logic about field "discharging", now it only controlled
   by whether it is plugged in.
3. Change Paint in drawable to protected
Bug: 36862496
Test: RunSettingsLibTests
Change-Id: I2908ae6868dc877d3ce6a8a63ec17826a6dcca1d
2017-04-12 12:57:55 -07:00
Jason Monk
d866b8aa03 Fix battery icon dark initialization
Test: visual
Change-Id: I333436dd0ffb4a7791a98caa53054d01e9ff18ef
Fixes: 36443516
2017-03-29 15:30:44 -04:00
Evan Laird
09ebefda2e Move percentage to left of battery
Original mocks had the percentage on the left side of the battery... So
I made it so.

Test: visual
Bug: 32539932
Change-Id: I311255777b74c2ff74e36c78cbe1b4b9743ec337
2017-03-24 10:55:29 -04:00
Evan Laird
bcf631d48b Move battery percent constant to Settings
This switch is moving to system settings so it should also be declared
by Settings. Also changed the constant's name to make sense in the
System context.

Test: runtest systemui
Bug: 32539932
Change-Id: I7cce21b50702f31465328dd8faed3fbac47528ea
2017-03-13 13:42:11 -04:00
Dan Sandler
df14c20be4 Don't show the percentage twice when charging.
The old percentage textview is now gone from the layout.
When the device is charging (but the user doesn't have
percentage display turned on all the time) use the new
percentage built-in to BatteryMeterView.

Bug: 35521962
Test: visual
Change-Id: I91f3350f6203fd007f003ca260ac0ed78e29b771
2017-02-21 16:17:09 -05:00
Jason Monk
f13413e2f3 Various QS fixes and cleanup
Test: runtest systemui
Change-Id: If87f58f2af00b23c5e1a8e38a63a6a63d903002c
2017-02-15 17:48:27 -05:00
Dan Sandler
055bb61426 Percentage text now sits alongside the battery icon.
The old embedded percentage (introduced in change I6a3e7409) is hard
to read at status bar size, so we now draw it in a separate TextView to
the left (start) of the battery gauge. (The embedded code remains so
that it can be used by other places where the battery is drawn larger.)

The old system setting "status_bar_show_battery_percent" is still used
to control whether this percentage is shown, but note that it now
applies only to BatteryMeterView (i.e., the status bar) and not other
usages of BatteryMeterDrawable.

Bug: 32539932
Test: (manual) adb shell settings put system status_bar_show_battery_percent 1
Change-Id: Id298dba544f594b11269539284a2e8042fd4780b
2017-02-14 14:47:28 -05:00
Jason Monk
aa573e9e86 Work on separating out the status bar management
Lots of stuff:
 - Make StatusBarIconController be a permanent dependency
 - Break out dark stuff into DarkIconDispatcher
 - Create StatusBarFragment
   - This bit is a bit ugly for now, but will be better later
 - Other stuff probably

Test: runtest systemui
Change-Id: I4973bc9f944e66af92731bf1edd2b39657f1782f
2017-02-08 19:51:41 -05:00
Jason Monk
de850bbcaa Fix leaks in sysui
Add support for testing for PluginManager and TunerService leaks
and add tests for the known leaks and fix them. Also port PluginManager
and TunerService to Dependency to make them easier to handle in
tests.

Test: runtest systemui
Change-Id: I5642539ee24dd72f802905106decd0c87b41b4eb
Fixes: 34846972
2017-02-02 10:58:18 -05:00
Jason Monk
9c7844cb91 Work on sysui dependencies
One of the many problems with PhoneStatusBar is that it holds
dependencies for many other parts of SysUI. Fix this by creating
a static method of grabbing dependencies that are global to sysui
this cleans up a lot of chains of interdependence.

Also add easy way to inject mocks of these dependencies for the
purpose of testing.

Test: runtest systemui
Change-Id: Ia0e947faea62d15b665facada47ac9916c99f895
2017-01-23 12:55:53 -05:00
Jason Monk
3250885c9f Visual refresh for QS
Adds circles and things

Test: visual
Change-Id: I7d974fcfe6257357abfd1a7d0ee521f0e6cee588
2017-01-20 11:29:25 -05:00
Jason Monk
8852905b0b Unit testing for fragments.
Set up a base class for testing fragments that will generate the host
and run the fragment through some lifecycle checks to make sure it
does ok with standard lifecycle.

Fragment tests will also automatically check for any sort of leaks
related to bindings, receivers, or other callbacks in sysui. This
requires changing the statusbar.policy classes with callbacks to
have a common interface.

Lastly also fixes a few lifecycle bugs in QS found from the above
tests.

Bug: 32609190
Test: runtest systemui
Change-Id: I52007c696c2fd41914bba4ba9d8055f2b564a7d8
2016-11-11 11:20:10 -05:00
Geoffrey Pitsch
959ee2278c Add tests for BatteryMeterDrawable
Not meant to be an attempt at full coverage, just an example of
testing a Drawable.
To go farther with this, I would wrap the "logic" of the battery
appearance in a separate class for testing and this class would
reduce to the drawing operations, which are strongly coupled to
design and don't need much testing.

Test: runtest systemui
Change-Id: I5630e25face9a3ab5e30935fb3d7bab8f162d107
2016-10-03 09:37:06 -04:00
Adrian Roos
70dcf8392c A11y: Fix battery icon and clock descriptions
Now announces charging state on the battery icon
and AM/PM on the clock.

Change-Id: Ib8d249e60b555834e5e224287ea332178ce7c165
Fixes: 27552350
2016-04-20 15:51:59 -07:00
Winson
c0d7058b14 Referencing static interpolators.
Change-Id: I5d2292016e869ed533f5873e373a1eccce651fc5
2016-01-29 11:15:43 -08:00
Jason Monk
3e189877ab SysUI Tuner: Status bar work
Improve general status bar goodness, more exactness, less breakage.

Extra extra icons, disabled by default.

Control all the status bar things!

Probably other stuff (10000).

Change-Id: I5d6282a4dcbcefea9f0880042cdf6293cb693712
2016-01-19 18:58:05 -05:00
Jason Monk
c06fbb1298 Move battery saver notification to QS
Remove the battery saver notification and instead create a detail
panel within QS that allows it to be turned on and off.

Change-Id: I54654d26183586fa171fda04877a840701f8ef33
2016-01-11 14:29:23 -05:00