When the app contains anomaly, we should show anomaly icon(triangle
alert).
This cl also extracts a new method refreshAppListGroup from refreshUi.
New method is used to only refresh appListGroup. Reason for this action:
1. Improve performance(partial refresh)
2. We init AnomalyLoader in refreshUi, invoke refreshUi in
onLoadFinish will create infinite loop.
Bug: 36924669
Test: RunSettingsRoboTests
Change-Id: If54c89349e21763ca714123ac6ae884bd0f6a377
The logic for this pref lives in AnomalyPreferenceController.
Bug: 36924669
Test: RunSettingsRoboTest
Change-Id: Ib88d8e76e1af8a2270fcb671baf55e9f6564b96e
1. Add abnormal app page
2. Add strings for abnormal app page
3. Change AnomalyPreferenceController to open abnormal app page,
when there are more than one anomaly.
4. Add AnomalyPreference, who stores a reference of anomaly.
Also rename AnomalyPreferenceController to
AnomalySummaryPreferenceController because this controller is not
used to handle AnomalyPreference.
Following cls will add summary and icon for each abnormal app.
Bug: 37681665
Test: RunSettingsRoboTests
Change-Id: I4266f906476ff8daccd962572c8cfa99f948080a
This cl adds the following components for anomaly dection:
1. AnomalyLoader: run all the anomaly checks in the background
2. Anomaly: Data class to represent what anomaly it is
3. Detector: Different kinds of anomaly detector with common interface
4. Action: Suggestions when facing anomaly(Force stop, uninstall)
5. AnomalyDialogFragment: show the confirm dialog for action
6. AnomalyPreferenceController: handle update and click for
anomalyPreference, since it will be used in multiple fragments.
7. AnomalyUtils: utility class for anomaly
This cl also adds skeleton for the wakelock check and action. Following
cls will add real implementation about it.
Bug: 36924669
Test: RunSettingsRoboTests
Change-Id: I89fc4b6963757869b93791b4275ca53c04ab9604
It takes 3-4 seconds to load the battery settings page in Ryu. Main
reason is that it takes too long to init BatteryStatsHelper.
This cl moves loading code to AsyncLoader, and we will refresh ui once
the loading part is finished.
Following cl will add animation for the battery header to make it not
so janky
Bug: 37196170
Test: RunSettingsRoboTest
Change-Id: I40dfdde4a072e28a56c8fdf0ec6d671b5109fc6d
Talk back will read "Used for 3m" as "Used for 3 meters", but
it will read "Used for 3h 3m" correctly.
This cl add specific Ttsspan if the time only contains "minute"
Bug: 36379530
Test: Run SettingsRoboTests
Change-Id: I033575938cce24221980dddd9d66be4e18804541
Change preference keys of duplicate settings between
display and battery to avoid duplication in search.
Bug: 33701673
Test: make RunSettingsRoboTests
Change-Id: Iaad52f16ce33c478c64bcec656cc8edbe0c97283
Merged-In: I56c82e9e7f163d345065ca478849de9b14c173fe
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
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
This cl moves following methods to BatteryUtils:
1. shouldHideSipper
2. removeHiddenBatterySippers
3. calculateBatteryPercent
As a result, we could use these methods in battery page as well
as app info page.
This cl also move bunch of tests to new file and add test for
method calculateBatteryPercent
Bug: 36816681
Test: RunSettingsRoboTests
Change-Id: Ic32700fe9741fbb96363db4af2d4fccb3ee8e317
This cl add logs to get more data for app usage time.
Also refactor BatteryUtils to singleton pattern because we need
to extract package name from uid.
Bug: 36909166
Test: RunSettingsRoboTests
Change-Id: I6ede354035c46e46cb856b7cf57bd1b7ccbd6d4f
The removed types are:
1. DrainType.UNACCOUNTED
2. DrainType.OVERCOUNTED
This cl removes the above types in PowerUsageSummary and
PowerUsageAdvanced
Bug: 36874846
Test: RunSettingsRoboTests
Change-Id: I1807c44a2c0a9c2fa124cdef962a6411ae6830ca
1. Refine the battery header view
2. Move stats section to the place above power management
3. Add last full charge battery stat
4. Add the disclaimer as a footer
Also update the method name in test file, and this ui changes
also fix the header flash problem.
Bug: 36576021
Bug: 36494178
Test: RunSettingsRoboTests
Change-Id: I9784dbbbe16e61da7287f300183347dd4eee6a2b
(cherry picked from commit edfd09d590)
Also move the systemui to category system
Fix: 36644740
Fix: 36645264
Test: RunSettingsRoboTests
Change-Id: I6b64a7dca58091f3a1d8b7d99c8bae7ddf9169f9
(cherry picked from commit 1e95b74f77)
If the category only contains one app, show usage time, otherwise
show app with maximum usage.
Also add usage time for apps in battery settings page.
Bug: 35396770
Test: RunSettingsRoboTests
Change-Id: I43fe9c2289535be2c1b95ffded6b52b0ff099589
(cherry picked from commit 3bbaca9c7c)
This cl adds AdvancedPowerUsageDetail to show the usage details page.
The AdvancedPowerUsageDetail contains all the needed ui components:
1. App Header
2. Two buttons
3. Usage breakdown preference category
4. Power management preference category
This cl also adds preference controller for two buttons but the
detail implementation will be added in the following cl.
Following cl will also remove previous detail page.
Bug: 35810915
Test: RunSettingsRoboTests
Change-Id: I17f95d1288762094671c0f148fa73367e51f175e
- remove DashboardFeatureProvider.isEnabled() and all relating code
and tests.
Bug: 35764802
Test: make RunSettingsRoboTests
Change-Id: If7796677abc8904b7436525836d50cdef38e37a4
Media is a bundled process which contains the following packages:
com.android.providers.downloads
com.android.mtp
com.android.providers.media
com.android.providers.downloads.ui
This cl moves them to advanced battery page.
1. Bluetooth lives in category bluetooth
2. Media lives in category system
Bug: 35811926
Test: RunSettingsRoboTests
Change-Id: Ie229fa15e2e62b67d571988f7f4e7788a665bcdd
This cl adds isTypeSystem to PowerUsageFeatureProvider and
changes isTypeService. After this cl, the following items will
be moved to advanced battery page:
1. Calendar Storage(Move to System)
2. MediaServer(Move to System)
Create this check in FeatureProvider to make sure this check
is flexible in different cases. Also refactor the PowerUsageSummary
to use same test fragment
Bug: 35629871
Bug: 35628690
Bug: 35317876
Test: RunSettingsRoboTest
Change-Id: I8c083cb2557a7e900aea01e682c13a000bacb7a9
Battery header uses AsyncTask to update the label. So if user
press back button before the update completes, the "getContext()"
in AsyncTask callback will return null, which causes the crash.
It seems there is no good way to fix it expect adding a NPE check.
Bug: 35650224
Test: RunSettingsRoboTests
Change-Id: I7bd9fd87caa13614fe1896cf72557a09744691c1
When battery is full of charge, usageList in BatteryStatsHelper
will be empty. As a result, we cannot find BatterySipper with
type screen and cell, which creates the null pointer error.
In this cl, I add NPE check for sipper. When sipper is null, all
data will be set to default value. I also add check for totalPower
so we won't have divided by zero error.
Bug: 35757789
Test: RunSettingsRoboTests
Change-Id: I80f3c0c542e0a50868e7c314a8d9b3c17999d8c6
Add a preferenceGroup at the bottom of the page, which contains
Screen and Cell usage data.
Bug: 35305983
Test: RunSettingsRoboTests & Screenshot
Change-Id: Ida6e92ddbd7155ec974a2f04c6d6d02ab9dab210
In the previous cl we hide unrelated apps and distribute hidden
battery usage among other apps. Now we add a toggle in menu to
show old power accounting as well.
Bug: 35366708
Test: RunSettingsRoboTests
Change-Id: I6918b7095cf84d9756ad3972ff50a62aeae1de0e
1. When there exists estimate time, show it, otherwise
show battery status label.
2. Change the summary based on whether it is charging.
(Estimated time left vs Time to full charge)
Bug: 35328749
Test: RunSettingsRoboTests
Change-Id: I64ee8acd248062b4effcfc58ed908be7d89621a3
- Add a method in VisibilityLoggerMixin to log visible event using
LogMaker, which allows logging additional FIELD_CONTEXT field.
- In Utils.startFragment, add current page's metricsCategory as an extra
to next page.
- In next page's onResume(), extract the previous page's metricsCategory
and send it to VisibilityLoggerMixin.visible()
- Update all caller with additional paramters
Change-Id: I8e1f2597fa465b7d3aa16fa1d21c052a3219694a
Fix: 35359289
Test: RunSettingsRoboTests
1. Show gauge icon at the top of battery main page instead of
battery usage graph.
2. Move the click action from battery usage graph to gauge icon.
Bug: 34387464
Test: RunSettingsRoboTest
Change-Id: Ib182619d6805b401cde03a50e2ae907cf4df7b94
1. Add screen check in the shouldHideSipper()
2. remove all the battery usage for hiddenSipper from
percentage calculation, in this way we can distribute
hidden sippers to all the apps
Bug: 35153599
Test: RunSettingsRoboTests
Change-Id: I82673b282c14c92269d7f8bc71e07de90a37720c
The advanced page shows two major parts, one is the battery usage
graph and the other is battery usage list. In usage list, each item
shows basic info of battery usage of one type(e.g. Apps, System)
Bug: 34385770
Test: RunSettingsRoboTests
Change-Id: I22475a489285787afa775af8d5ae3340eff1eed9
This summary shows the active time of the app. For example
"Used for 27m".
Bug: 34467139
Test: RunSettingsRoboTests & Take screenshots
Change-Id: I0ef48427ad21be4dacd290fffb2c5d519ef58506
By using MasterSwitchPreference, we make "battery saver" to have
two parts: left part is the clickable summary jumping to other
fragment while right part is a switch toggle.
Also remove the previous battery saver preference.
Bug: 34279051
Test: RunSettingsRoboTests
Change-Id: If36fa9741e413a9bbdd57fa67a2c15b6e457afd7
Use the centralized registry to look up category key instead.
Bug: 32936784
Test: make RunSettingsRoboTests -j40
Change-Id: I0b8c72d70f93e4b5c58871ac90de41f69ad15653
The items been added to group are: Adaptive brightness, Sleep.
Battery saver has been moved into this group as well.
Also refactor the code a little bit to make it fit the
preferenceController. Whole refactor of PowerUsageSummary and
PowerUsageDetail will be tracked in b/34386721
Bug: 34279051
Test: runSettingsRoboTests & Screenshot
Change-Id: I702d8479d1b80f7e9cf1a46752c75bf5d189e0f6
It doesn't make sense to show battery cost of "SCREEN". In this cl, I
attribute this cost to all the other apps/services.
Bug: 34390125
Test: RunSettingsRoboTests
Change-Id: Ia6ff39d5fa21eacf1ff97a28e2ff59d1cf169885
We want to hide the OS items from battery usage page and let users
focus on the items that they can control.
Currently the hidden items are:
Android OS, Android System, Phone idle, Cell Standby
Bug: 34274844
Test: RunSettingsRoboTests & screenshots
Change-Id: I75165376d5038b6ec17a7b73ae3c5fcd24753fa9
This cl is to fix the preference flicker issue. The main reason is
that we cannot find cached preference because of the inconsistent
search key. The search key is calculated without considering
uidObj, but the key in preference(aka changed preference) maybe
changed later based on the existence of uidObj. So when we search
the changed preference using the wrong key, we won't get it even
though it exists in the cache.
In my cl, I group two parts(search key calc + considering uidObj)
together in a method to extract the key.
Bug: 33663705
Test: make RunSettingsRoboTests
Change-Id: I2ca0c558ffc0d49ed9576321ecbc02542b568d65
Bug: 30681771
Test: SettingsUnitTests
Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.
Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622