Add sanity check method for BatteryTip
This method is used to check whether data in battery tip is still valid. If not, try recover the data or dismiss the tip. Change-Id: Idc9e4d49f99e33d3f5e82e694dc78227fc1da41c Fixes: 111218723 Test: RunSettingsRoboTests
This commit is contained in:
@@ -106,6 +106,17 @@ public class RestrictAppTip extends BatteryTip {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sanityCheck(Context context) {
|
||||
super.sanityCheck(context);
|
||||
|
||||
// Set it invisible if there is no valid app
|
||||
mRestrictAppList.removeIf(new AppLabelPredicate(context));
|
||||
if (mRestrictAppList.isEmpty()) {
|
||||
mState = StateType.INVISIBLE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(Context context, MetricsFeatureProvider metricsFeatureProvider) {
|
||||
metricsFeatureProvider.action(context, MetricsProto.MetricsEvent.ACTION_APP_RESTRICTION_TIP,
|
||||
|
Reference in New Issue
Block a user