convert battery framework provided package name to formal one, since
some returned package name will append the process name to avoid
fetching app label and icon not found. for example:
Bug: 188751551
Test: make SettingsgRoboTests
Change-Id: If59167d575154f99eba2c7bd81a1d862652ea47b
some items are not clickable to launch the restriction page in the
battery usage list, we will apply the disabled visual in the
preferrence item to improve the UX (avoid users click the item without
any action)
Bug: 188751551
Bug: 188663505
Test: make SettingsgRoboTests
Change-Id: Ib8925b8e191117543bb1c74d6d01191e3043fc73
for power component, the battery UI is designed to show system relative component without considering the attributed apps, update the current formula to use `devicePowerMah` value data only
Bug: 188663505
Test: make SettingsgRoboTests
Change-Id: Ibeeb360915303faed2f79c4621f17d6ba0dd725f
In the original design, BatteyEntry will load icon and label in the
background thread and cache them into memory, but we don't need such
information in the periodic fetching job. Add a method to disable it to
improve the performance and memory footprint.
Bug: 185207505
Test: make SettingsRoboTests
Test: make SettingsGoogleRoboTests
Change-Id: Iba759256e94159fce243ff4d700a8adf9e92f82c
Export getting icon and name function as static method in the
BatteryEntry for further restoring from database history records, and
export the mBatteryConsumer to record the type into local database.
Bug: 183906918
Test: make RunSettingsRoboTests
Test: make RunSettingsGoogleRoboTests
Change-Id: Ib3f0a457c8265baf0f6b97798bef0ea4a7156070
The implementations of getConsumedPower() now consistently returns
the total power consumed, not the power unattributed to apps.
Bug: 183235836
Test: make RunSettingsRoboTests
Test: make RunSettingsGoogleRoboTests
Change-Id: I9ea1592581b50d1533b00c28c9db4eab1e88edac
Export a method to fetch BatteryEntry for battery usage new design, and
we have to fetch the label name each time when the new UI is shown to
avoid locale is changed from database records.
Bug: 180607705
Test: make RunSettingsRoboTests
Test: make RunSettingsGoogleRoboTests
Change-Id: Iae8f0b4812beb760b690e622f707fb67388221a2
For now, keep both BatteryStatsHelper and BatteryUsageStats in play.
The plan is to transition from the former to the latter, one usage
at a time. When all is said and done, all references to
BatteryStatsHelper will be gone.
Bug: 173745486
Test: atest --host SettingsRoboTests
Change-Id: I37e1dfff0043b1845992f18d72067bb547bb69ff
A bunch of icons were using PNGs which didn't allow their color
to change when in dark mode. This CL simply adds vector drawables
for all the PNGs and sets the tint to the correct color where needed.
Test: visual inspection, robotests pass
Bug: 126199274
Change-Id: I372d94e374173ab0572dacb03674a40fa14cffb9
Keep it in both app list and full usage list for now,
so we don't need to update smearing code.
Bug: 77156569
Test: Screenshot | RunSettingsRoboTests
Change-Id: I5247da90ea591b226cafef8f2d1ffcbff387b62f
Clear uid to package detail cache by checking locale before use.
Fixes: 62422871
Test: RunSettingsRoboTest pass,
manual test
(1) open advance battery settings page,
(2) switch locale,
(3) back to advance battery settings page => pass
manual test
(1) open advance battery settings page, and then back to settings main page
(2) switch locale,
(3) go to advance battery settings page => pass
Change-Id: Ifac830706539022cd9bf51d3f33e728aadc163f4
In battery settings, the system item contains many packages. In old
behaviour it will use the first package(which has legal name and icon)
to represent this item. This behaviour is not consistent.
In this cl, we always use package "android" to extract name and icon
if it is system item.
Bug: 65090883
Test: RunSettingsRoboTests
Change-Id: Ibb7f85c06ab1745867f1eaa666cea32c8d3295a6
Set correct defaultPackageName and Label for Apps in BatteryEntry.java
so PowerUsageDetails will show the correct information.
Bug: 24187923
Fixes: 24187923
Test: Open Settings, click on Apps, select any app. Note the name and
icon on the Header. Click the Battery item. The app name and icon should
match that of the previous name, as opposed to showing the package name
and default Android icon.
Change-Id: I7b6c3b404fcd298c6670cceecd29915abd325d1f
UIDs that consumed power and were actually shared app GIDs are now
coelsced for system apps as well as regular applications. In addition,
system UIDs like logd, NFC, DRM, etc are coalesced into Android System.
Bug:23189342
Change-Id: I6c8eb4baec66fba3d1f71a155d8ea1fe920ffec9
Tint icons properly
Bug: 21077770
Show better icons for wifi and bt (remove the old ones)
Bug: 21172936
Also add a way to show fake items in power list for testing.
Change-Id: I6b6804673a68190ebc3f2ea32802e30811a7f5b2
Explicit null theme is passed when using Resources.getDrawable() and
no theme is available, e.g. when using getResourcesForApplication().
This fixes an issue with ic_text_dot theming and helps avoid similar
issues in the future.
BUG: 17648301
Change-Id: I3e97c3490b6f2a55744f567b21284f2935ae9af7
App icons appeared as the default icon and sometimes without the corp badge on
Data Usage and Battery screens for applications that were only installed for
the managed profile. This CL fixes the issue.
Bug:16705204
Change-Id: I778d36554feb19f28f3cb9321a291cab3d3e17bb
...Attempt to invoke virtual method 'boolean android.os.Handler.sendEmptyMessage(int)' on a null object reference
- prevent NPE by checking the nullity of the Handler reference
- remove dead code
- rename mHandler to sHandler as it is a static
Change-Id: I7f4101f860f24b0cd49a4656971e9b54e55c1286