Commit Graph

23 Commits

Author SHA1 Message Date
Wesley Wang
cf1190c7cb Update battery health state intent (2/3)
- Update the extra from overheated to longlife

Bug: 278192441
Test: make SettingsRoboTests

Change-Id: I5a906e64effbd9aaf84446c0670249afefdf7da8
2023-05-11 11:27:16 +08:00
ykhung
a43f9ead39 Add incompatible charging battery tip detector
Fix: 263193978
Bug: 246960554
Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.fuelgauge.batterytip"
Change-Id: Ifbfd28e81b03aa8e1bb4cc70199b3262e21931cc
2023-02-06 08:48:49 +00:00
ykhung
b41b50c3dc Add RECEIVER_EXPORTED for internal intent based on the PSA
Test: presubmit
Change-Id: I699f1e93cf8c44b046f131014d6200346798336e
2022-12-19 00:07:27 +08:00
Zhenwei Chen
8d11d9ceea Add dock defender battery tips
1. Remove the dock defender v1 code
2. Add dock defender battery tips and update
   corresponding list item string

Bug:256523472
Test: Unit test passed and manual test on device
Change-Id: Ib6c09df056744142f42f5e2a13252b58e54c7534
Signed-off-by: Zhenwei Chen <zhenwec@google.com>
2022-11-28 17:45:51 +08:00
Yi-Ling Chuang
e3fcf1f082 Remove BatteryFixSlice as it's not used
The BatteryFixSlice hasn't been used for a while, and it's introducing
memory leaks due to a design change at the framework's end. Hence,
remove it.

Bug: 245385410
Test: robotests
Change-Id: I517cab71a32613d5cb5fcd3beb991a24926a2902
2022-11-04 12:22:56 +08:00
Wesley Wang
695644db27 Refactor compact battery status method (1/2)
- Move compact battery status logic into libs

Bug: 219650786
Test: make SettingsRoboTests
Change-Id: Icc53c8d88235bffedfb51a3526668277fcbf4f40
2022-02-16 16:04:18 +08:00
Dmitri Plotnikov
313dbc0355 Remove references to BatteryStatsHelper from PowerUsageBase
Bug: 180630447
Bug: 173745486

Test: make RunSettingsRoboTests
Test: male RunSettingsGoogleRoboTests
Change-Id: Ifed69c4fdd741f75b0b962f9d3200f0ed533358f
2021-03-18 06:07:29 +00:00
Wesley.CW Wang
9a6aae5006 Add Battery Defender feature to Settings
- Reupload CL from ag/13108999 to fix the merge conflict
 - Adding new tips of Battery Defender, will be presented once battery is overheated
 - Launch Help Center article of battery overheat when clicking Battery Defender tip
 Screenshots: https://screenshot.googleplex.com/7jUibTJANgR6UQ6.png
 	      https://screenshot.googleplex.com/tUj2LLi87SfndBN.png

Bug: 172794045
Bug: 173497281
Bug: 173496188
Test: make RunSettingsRoboTests -j40
Change-Id: Ibb106a5d42cdf6232abf9ddf4b3225bdcebccf4a
2020-12-01 16:00:49 +08:00
Mill Chen
ad99e2ef38 Update related UI if battery is not present
This change is to update the related UI in the battery page if the
battery is not present. This includes the following updates:
1. Update the summary of battery tile in the Settings homepage
2. Replace the battery level with "Unknown"
3. Replace the summary with help message in the battery page
4. Remove the battery meter icon

Bug: 171368508
Test: verify on an issue device
Change-Id: I892e0d137143160a0bce0c11ce9265120ebb8fd4
2020-10-23 23:35:15 +08:00
Raff Tsai
791ad4d568 Sync lastest SettingsLib interface
Test: rebuild
Change-Id: I3131f701deb47acae9f19436cbe66e077ea004ee
2019-12-26 11:58:38 +08:00
James Lemieux
f1dade40d2 Use binary resource support in robolectric
The resources available to tests are now exactly the merged resources
located in the APK under test.

Bug: 74359828
Test: make -j56 RunSettingsRoboTests
Change-Id: I050db81a92decefea23314b5ec7a62f77ff4bb2b
2018-12-12 19:53:49 -08:00
Raff Tsai
b92e9d4239 Add BatteryFix Slice
Change-Id: I504df1e9caadced71cc37f8be9207ab9fd26f9ab
Fixes: 114807643
Test: manual
2018-11-21 12:25:06 +08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Lei Yu
d2b295ba36 Update the battery broadcast receiver.
Add a type for battery receiver, then in callback client know for
which reason it been invoked:
1. battery level change
2. battery saver state change
3. battery plug state change

So in this CL, we won't update battery tip for battery level change,
then battery tip won't be dismissed by itself.

Also note in onResume() we will manually update battery tip. So if
user stay in battery settings page and close the screen, once he opens
it we will still force update everything.

Fixes: 79171742
Test: RunSettingsRoboTests

Change-Id: I997844216fd8267e545d74e0d434de9e338f76a1
2018-05-11 16:02:07 -07:00
James Lemieux
22a39c2b93 Use external/robolectric-shadows/run_robotests.mk
This allows Settings to test against the latest framework changes.

Also replaced TestConfig with traditional robolectric.properties.

Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
2018-03-04 03:50:08 -08:00
jackqdyulei
5393991573 Add power save action to BatteryBroadcastReceiver
This cl makes BatteryBroadcastReceiver also listen to update about
battery saver.

Bug: 70530651
Test: RunSettingsRoboTests
Change-Id: I76b2f1b1047aa195ee9d8ff2a8a330cea31039d4
2017-12-12 16:56:22 -08:00
jeffreyhuang
cbfb099a40 Rename SDK_VERSION_O to SDK_VERSION
Test: make RunSettingsRoboTests -j40
Change-Id: I6715062d8addadda441e32809db1af55f15e3a90
2017-12-05 16:43:54 -08:00
jeffreyhuang
a79417487c Move fuelgauge test package to sdk 26
Test: make RunSettingsRoboTests -j40
Change-Id: I8122a41132821a42c4ec8c5995a1a11833b686cd
2017-11-29 10:57:54 -08:00
jackqdyulei
88b27fdeac Make anomaly item refresh in battery
Bug: 63908155
Test: RunSettingsRoboTest
Change-Id: I3e220001ca989020447403641360fade4d09e969
2017-07-21 10:37:14 -07:00
jackqdyulei
114cf2a1a7 Never store battery stats for cache
In PowerUsageBase, it will store battery stats if it has a configuration
change, which will make BatteryStatsLoaderHelper never get the correct
battery stats because it uses Bundle.EMPTY as the bundle message.

This cl:
1. Remove the store action even though it is configuration change.
2. Always use null to get battery stats
3. Always start a battery status check in register()

Bug: 63658232
Test: RunSettingsRoboTests
Change-Id: Ifbf970c63378ed66dddcdae4d952b7d1fd84216a
2017-07-14 15:36:40 -07:00
Andrew Sapperstein
9f1e911759 Refactor test runner to use static list of resource paths
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.

Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
2017-06-09 09:21:26 -07:00
jackqdyulei
6246fad7ff Make battery status refresh in SettingsActivity
Before this cl, the battery text in SettingsActivity is one time
update, won't refresh based on real battery status.

This cl elicits BatteryBroadcastReceiver from PowerUsageBase and
make it reusable in both SettingsActivity and battery page.

BatteryBroadcastReceiver will invoke callback if:
1. Battery level changed on integer level(100->99)
2. Battery status has changed(i.e. charging)

Bug: 29346753
Test: RunSettingsRoboTests

Change-Id: If522d15a700ccbc8bae24f5712e05ec27ea4cbfa
2017-04-14 15:08:57 -07:00