Commit Graph

56 Commits

Author SHA1 Message Date
Tony Mantler
d9af0b839d Move SimStatus and ImeiInfo Pref Controllers to SettingsLib
Bug: 67410808
Test: RunSettingsRoboTests
Change-Id: Ib55d2365814b5882f7fcae6bb7f1b62cc3d6ad4e
2017-10-23 15:42:43 -07:00
jackqdyulei
214372be19 Use new time format in BatteryInfo
1. Using "h" and "m" instead of "hrs" and "min"
2. Refactor the string to CharSequence so it won't have
TTS issue(i.e read "m" as "meter")
3. Update tests related to this part.

Bug: 37201139
Test: RunSettingsRoboTests
Change-Id: I9cadb511572b2d522d26ab337c171fa69da87475
2017-06-02 15:15:16 -07:00
Salvador Martinez
9cfa7720f4 Make BatterySettings Asynchronous and use enhanced estimate
this CL changes BatteryInfo methods to all use the async style
callback approach it had for one of the methods. Non-async methods
are now annotated to only be used in worker threads. BatteryInfo
can now be obtained via callback by calling one of the async
methods. Alternatively if there is a worker thread available
the synchronous methods similar to the old ones can be used.

The callback methods have all been changed so that they cascade to a
async method that takes all the required info as paremeters. This
will minimize the amount of churn in files that currently use
BatteryInfo.

A new loader was created that can be used to get BatteryInfo in
places that wish to get it. This loader is used in
PowerUsageSummary to get the BatteryInfo.

Test: Robotests
Bug: 38399275
Bug: 38398949
Bug: 38399654
Change-Id: Ic5a82d8ca4c85fad1b883226327ec083badf861d
2017-06-01 18:03:53 -07:00
Salvador Martinez
0e8c88376c Move BatteryInfo to settings from settingslib
This CL simply moves BatteryInfo from settingslib to settings and
makes sure the tests still pass. No other changes are made other than
imports or minor changes needed to make sure existing code does not
break.

Test: Robotests still pass
Bug: 38399275
Bug: 38398949
Bug: 38399654
Change-Id: I59803348e2780b7676ccc6c43234a586c184d71f
2017-06-01 11:34:08 -07:00
jackqdyulei
f8e6f43425 Revamp battery Ui in low battery mode
This cl refine battery icon ui in low battery mode:
1. Should show indicator(fixed in ag/2035178)
2. Show bolt icon when charging
3. When battery is low, set battery background as red and indicator
as white.

This cl also includes the field updates for battery.

Bug: 36862496
Test: RunSettingsRoboTests
Change-Id: Ifb2ed339742119bbff78712df09288b895756b1f
2017-04-12 12:47:52 -07:00
Jason Monk
27985e1f92 Move some battery stuff to SettingsLib
So that it can be used in the battery detail panel

Change-Id: I31eac974d29838726450940109b52d458f29c192
2016-01-08 14:13:05 -05:00
Jason Monk
3069581512 Summary support for Settings Home
Also add summaries to a few of the major items.

Change-Id: I17924f14941fe095d819e142cdd21cf4b4e9ffd1
2015-11-17 13:51:45 -05:00
Philip P. Moltmann
99b78b3eeb Deal with daylight savings time in battery chart.
Without daylight saving time the middle between two beginnings of days
can only be another beginning of a day or noon. Due to daylight savings
time this can be shifted by up to one hour in either direction.

This change corrects the middle value.

Testing Done: Tried the calculation of the three values with Lisbon time
and

mStartWallTime = 1414254027000L;
mEndWallTime = 1414473627000L;

which spans over 10/26/2014, the day daylight saving ended in Lisbon.

Change-Id: I2d2ba6e1fd2e409ca3f6b0f7674ec250da7ffad5
2015-10-27 12:19:46 -07:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Ruben Brunk
2627190bac Add UI for camera + flashlight battery reporting.
Bug: 11694505
Change-Id: Idca51a2e8cc7c2fb3e9d10f84f94e66600dee6fa
2015-06-05 16:05:18 -07:00
Narayan Kamath
0d9fece9e8 am eb7795ed: Merge "Use shortFormat instead of shortFormat4."
* commit 'eb7795ed31ee84c5569490b0949ea271865de7d8':
  Use shortFormat instead of shortFormat4.
2014-11-24 16:07:21 +00:00
Narayan Kamath
ad53f0b936 Use shortFormat instead of shortFormat4.
Won't make a difference since shortFormat4 is simply shortFormat
with the 'y' characters doubled.

bug: 18388178
Change-Id: I6177807430b295035092367553da5de3b942e2d6
2014-11-18 15:17:44 +00:00
Elliott Hughes
ba5863929a am 3dd51556: Merge "Remove vestigial "Choose date format" option."
* commit '3dd51556bcbf7addcc17d29dd360165ee7ede1ee':
  Remove vestigial "Choose date format" option.
2014-11-17 17:37:35 +00:00
Elliott Hughes
30cc30864b Remove vestigial "Choose date format" option.
Almost all of our date formatting goes via icu these days, so this is
a no-op almost everywhere. (And should be a no-op everywhere soon.)
There's no obvious way to fix it, so remove it. UI guidelines say we
should use spelled out month names anyway.

Bug: 18322220
Change-Id: Ic9e903eceab3c096426f313bf4ef3a38644774e1
2014-11-14 11:16:16 -08:00
John Spurlock
a0d2822535 am ef390443: am a312f7f8: Fix battery-history-chart large-mode labels in RTL layouts.
* commit 'ef390443eb7a6a4ac52c62aea65e7ba94f1f897a':
  Fix battery-history-chart large-mode labels in RTL layouts.
2014-10-13 22:13:01 +00:00
John Spurlock
a312f7f804 Fix battery-history-chart large-mode labels in RTL layouts.
Bug: 17425651
Change-Id: Iae53e111fa3c6bc822821a6a30bd34edb058c1a5
2014-10-13 15:48:50 -04:00
Elliott Hughes
83f013cfd4 Fix percentage formatting throughout Settings.
Bug: 15476051
Change-Id: Ic64e7c36d0e2732d3e0e79fec2b79de42decf77d
2014-10-03 15:52:20 -07:00
Dianne Hackborn
94aae9afd1 Little more on issue #17495264: tweak when we ignore initial times.
Change-Id: I7053eb64d7d2281984baef9606334c2df4783cc5
2014-09-15 14:00:37 -07:00
Dianne Hackborn
2b54a9fa57 Fix issue #17495264: Battery history graph is bad
Deal better with wall clock time changes in the battery history.

Change-Id: I9d63edafc37bbf663e328a08ba09300be2142594
2014-09-14 19:17:17 -07:00
Dianne Hackborn
c891ce6565 Fix some things in settings: manage apps, battery, procstats
Issue #17461567: java.lang.ArithmeticException: divide by zero when
looking at Settings > Battery

Yeah, let's not do that.

Issue #17365562: Running services RAM totals are wrong

Okay so like a few months ago, I had this vacation coming up, and
it was around the feature complete (hahah) deadline, and I had to
rush to get this in before I left.  So I rushed.  And, well, I forgot
a few things.  Here they are.  We now show the right numbers and
even update things correctly when you change what processes are
being shown.  Wow.

Finally, fixed a few issues in the dev tools procstats UI.

Change-Id: I8348a9c2ec3226a455c5c8465729e4487f324c8b
2014-09-11 18:09:29 -07:00
Elliott Hughes
7253df35a0 Start cleaning up percentage formatting in Settings.
This fixes some of the percentage formatting issues, but there are
still about ten strings with hard-coded %%s in them.

Bug: 15476051
Change-Id: I668b6b16e598425f6006f6de0005c980f613f5b2
2014-09-03 17:04:01 -07:00
Dianne Hackborn
1cf2077c37 Fix issues in Settings: 16660423, 13172381, 16868094
Issue #16660423: Stability: ArrayIndexOutOfBoundsException in settings:
at com.android.settings.fuelgauge.BatteryHistoryChart$ChartData.draw(
BatteryHistoryChart.java:109)

Issue #13172381: No content description in Battery charging section

Issue #16868094: Settings crash on switching to landscape mode with
"Google Text-to-speech" settings icon selected

Change-Id: I94d0e83f72d571eb90aad6742acabce56c0298ec
2014-08-10 16:32:08 -07:00
Dianne Hackborn
c19eb361a4 Battery chart fixes.
When there is no data to show, don't make a crazy collapsed chart.

Also avoid re-creating the chart when scrolling.

And fix various other things.

Change-Id: Ia1895bc7c46e6d830e66f66e66f17726e1e23e3f
2014-07-17 12:09:54 -07:00
Dianne Hackborn
6fd48e224f Issue #15986092: Add power tracking of flashlight.
Also improve drawing of date markers to allow a middle
marker for really looong durations.

Change-Id: I0c12ec9b6de102360d9171627787462dfa58b7ef
2014-07-08 17:16:29 -07:00
Dianne Hackborn
96debb5c96 Update to follow battery stats change.
Improve how we decide that WIFI is on.

Change-Id: If209d85dd88b6bdd56913684a890f732b8234a8c
2014-06-20 16:02:12 -07:00
Dianne Hackborn
68f005fbd4 Modify proc stats to show new memory use computation.
Switch the proc status UI's memory use bar to be based on the
new total memory use computation, instead of showing that weird
"time spent in memory states" thing.

Also now have it link to a detail page that shows details of time
spent in memory states and RAM used by various things.

Change-Id: I6817a499db518adb8e72466a5e9cfe18a81be5d5
2014-06-19 21:35:27 -07:00
Dianne Hackborn
b11c973799 Fix issue #15597136: n7 not showing estimated discharge time
Use battery plugged state to decide whether to show the estimated
discharge time remaining vs. charge time remaining.

Change-Id: I2e0d12871201e7d4927aaa9a94d15bff949a881c
2014-06-12 16:40:56 -07:00
Dianne Hackborn
3bd46a70c1 I am a Material girl, living in a Material world.
Change-Id: I3206041666a3236fdeb5f5897e6d8767137c2b85
2014-06-11 16:27:22 -07:00
Fabrice Di Meglio
a7a62c5b66 Fix bug #15545573 Battery use chart is incorrect for date labels and time axis labels
- use DateFormat.getBestDateTimePattern(...) to get the best Date and Time format
depending on the Locale
- format the label according to the best format
- remove non needed formatting strings

Change-Id: I78b62b9a7c9401e47e62c7161214636bb43324fc
2014-06-10 20:26:42 -07:00
Dianne Hackborn
7158e62992 Tweak battery usage to match red lines.
Most of this is done, the main thing missing is the color
of the bars which seems like a framework issue.

Note that this introduces a change to the global theme
making colorControlActivated the specified blue color,
which impacts all of the settings UI.  (Except apparently
progress bars, and thus the bug.)

Change-Id: I4a5ca8c3b94dc23b8f065f60fe697ee0e76ff47d
2014-06-02 17:21:13 -07:00
Dianne Hackborn
a32d81797f Fix issue #15185822: Stability: ArithmeticException: divide by zero
Also small visual improvements.

Change-Id: I55dc30539a4ef67e9261f338c8c5a729a6958d9b
2014-05-23 16:47:37 -07:00
Dianne Hackborn
5a9ace3a7a Update battery use chart to better match new mocks.
Change-Id: I714cb30ccd9b8144785aee16a23ae2b723df4347
2014-05-21 14:19:11 -07:00
Dianne Hackborn
525f2bdfd2 Update battery charge/drain label.
Match UX spec.

Change-Id: If1408458d488ac2ae3a63449e44ff18fc56e08d5
2014-04-29 11:24:06 -07:00
Dianne Hackborn
0be7598cb8 Show time remaining / to charge.
Rework the battery graph to include the time remaining or
time to charge.

Change-Id: Ib26b761cb10e01f5f3aa4189db10d44b8ce62f89
2014-04-24 12:05:51 -07:00
Dianne Hackborn
55985d2cec Switch to new "cpu running" state for showing wake time in chart.
Change-Id: I69b27c506e057353d9ee32f5d80e3077c7eba207
2014-03-21 14:14:39 -07:00
Dianne Hackborn
18083b1eb7 Battery: report calculated power, tweak signal strength colors.
BatteryHistoryHelper now computes the total power to be the total
including the unaccounted, so we don't go > 100%.  However for the
unaccounted/over-counted details, we want to report the actual
computed amount.  Use a new API to do this.

Also tweak the signal strength colors so that the "no signal" state
is stronger, by being reddish instead of bright yellow.

Change-Id: I6af9fbcce8c3324883db0184f7ac215cb41b6230
2014-01-22 14:18:39 -08:00
Dianne Hackborn
fb03058dc9 Update to follow BatteryStats.
Change data use to be based on packets instead of bytes.

Change-Id: I536dd2c2fc3fbeb12689e793f79e5fac984fe3af
2013-12-19 13:10:25 -08:00
Dianne Hackborn
49759af6b0 Various proc stats UI improvements.
- Option to include system processes.
- Option to use uss instead of pss sizes.
- Option to select type of stats: background processes, foreground (top)
  processes, cached processes.
- Details now shows max mem usage.

Change-Id: Ic994564ce846bc1021bf35576feeb9ef095b0e48
2013-09-15 13:22:28 -07:00
Amith Yamasani
74809c2679 Fix RTL layout of text in Battery history screen
Change the anchor position and alignment direction for text.

Bug: 10447666
Change-Id: Ida4161c738cf9a32cc8ff98037f3755046e64e33
2013-08-28 15:14:16 -07:00
Todd Poynor
56247a63fc battery history details: update status bars on any change
Don't apply the "X axis (time) still within previous pixel" optimization
to the status bars below the battery level graph.  Keep the path cursor
position and previous state variables up-to-date in this case.

Bug: 8132455
Change-Id: I09390256e3e71d34813de655a1d01ec054ee778a
2013-03-18 12:30:44 -07:00
Robert Greenwalt
8af88fb838 Use the new isNetworkSupported api for wifi-only
Didn't have an API for this before so people used a hacked system property (ro.carrier)
to determine if the device supported mobile data.  Added new API and switching callsites.

bug:5087537
Change-Id: Ibd799559be102a9e2fd552d1a23d1afbcf8f4614
2011-08-31 16:45:39 -07:00
Dianne Hackborn
b28c0c95c2 A few tweaks to the battery history chart.
Change-Id: Id133267592acf7a979a625704d2d922a24f5ff41
2011-04-13 18:22:37 -07:00
Amith Yamasani
c06d4c48a9 Remove more entries not relevant to wifi-only devices.
Bug: 3488384
Bug: 3487976
Bug: 3488381

Removed Cell standby entry from Battery use screen.
Removed Mobile signal strength from BatteryHistory screen.
Added wifi IP address to About->Status
Remove auto-timezone checkbox in Settings->Date & time

Change-Id: I228721a3613b1aeb600026e42274337886552698
2011-03-01 12:03:24 -08:00
Dianne Hackborn
d2be882d8f Fix issue #3114356: Storage visualization in Manage Apps is confusing
Also fixes issue #3097388: If you launch Manage Applications when SD
card app info isn't available, incomplete information gets cached

Change-Id: If3377a965653590e5bc1df25e38764a83e96b820
2010-10-20 16:54:41 -07:00
Dianne Hackborn
916adce02d Fix issue #3108683: GRH18: Battery usage chart FCs
Make array more bigger, and bounds check the thing.

Change-Id: Iaffebefd27c16c6ecf57566803859be1a5049b8a
2010-10-19 16:23:53 -07:00
Dianne Hackborn
19df79af26 Some improvements to the manage apps code:
- Battery stats now aggregates bluetooth usage.
- Battery stats now uses new history iterator API.
- Battery stats chart is refectored to have the start of a
  common facility for building tick charts.
- Manage apps will now asynchronously wait for the apps list
  if it is taking >.25ms to build.

Change-Id: I568dd74beedf9a0a5a4c88ab567510cee9af8299
2010-09-20 17:06:17 -07:00
Dianne Hackborn
cb818619c6 Update power usage UI to follow WIFI data changes.
Now handles WIFI start times being distributed across applications,
and collapses all work done in WIFI uid procs (esp that supplicant
thing) into the apps and overall WIFI category.

Change-Id: I341e5d63c45eeb0fb4121beed62474d947f9de11
2010-09-17 11:28:08 -07:00
Dianne Hackborn
a712c3b7b5 A couple small settings fixes:
- Correctly position WIFI/GPS charts.
- Start out with running services hidden in case we need to show
  the progress bar.

Change-Id: I8852f334f68f4e9122b5d688d9fd57d0f94d94d8
2010-08-18 17:47:39 -07:00
Dianne Hackborn
be5994d201 Some improvements to the battery usage UI:
- Show wake lock usage in the battery history.
- Show WIFI usage in the battery history.
- Show the amount an app has held a wake lock in the app details.
- Also fix service run time computation in running services.

Change-Id: I5aa959857f83808fbc709f65204f59bbfb73935b
2010-08-13 14:22:34 -07:00
Dianne Hackborn
938079c9b3 Fix drawing of phone signal chart.
Change-Id: I15253624ab37d3a494a541d813ee1bf2187e145d
2010-07-25 12:41:05 -07:00