Move battery stats loading to AsyncLoader.
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
This commit is contained in:
@@ -126,7 +126,6 @@ public class PowerUsageAdvanced extends PowerUsageBase {
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
refreshStats();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -165,8 +164,11 @@ public class PowerUsageAdvanced extends PowerUsageBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshStats() {
|
||||
super.refreshStats();
|
||||
protected void refreshUi() {
|
||||
final Context context = getContext();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
updatePreference(mHistPref);
|
||||
|
||||
|
Reference in New Issue
Block a user