Refine the update process of battery tip
1. When device is rotated, don't update the battery tip 2. When user go back to battery main page from other page, start battery tip update process 3. In RestrictAppTip, if there aren't restricted apps anymore, hide the tip. Bug: 74467010 Test: RunSettingsRobotests Change-Id: I300bcc5b487d587f6618e340ac074fe416dcc1b2
This commit is contained in:
@@ -352,6 +352,14 @@ public class PowerUsageSummaryTest {
|
||||
R.string.advanced_battery_title);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRefreshUi_deviceRotate_doNotUpdateBatteryTip() {
|
||||
mFragment.mNeedUpdateBatteryTip = false;
|
||||
mFragment.refreshUi();
|
||||
|
||||
verify(mFragment, never()).restartBatteryTipLoader();
|
||||
}
|
||||
|
||||
public static class TestFragment extends PowerUsageSummary {
|
||||
private Context mContext;
|
||||
|
||||
@@ -364,12 +372,6 @@ public class PowerUsageSummaryTest {
|
||||
return mContext;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void refreshUi() {
|
||||
// Leave it empty for toggle apps menu test
|
||||
}
|
||||
|
||||
@Override
|
||||
void showBothEstimates() {
|
||||
List<BatteryInfo> fakeBatteryInfo = new ArrayList<>(2);
|
||||
|
Reference in New Issue
Block a user