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:
Lei Yu
2018-07-09 14:53:55 -07:00
committed by jackqdyulei
parent 636cc6caf9
commit b07d1f34c6
4 changed files with 54 additions and 0 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.fuelgauge.batterytip.tips;
import android.content.ContentResolver;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
@@ -133,6 +134,14 @@ public abstract class BatteryTip implements Comparable<BatteryTip>, Parcelable {
*/
public abstract void updateState(BatteryTip tip);
/**
* Check whether data is still make sense. If not, try recover.
* @param context used to do sanity check
*/
public void sanityCheck(Context context) {
// do nothing
}
/**
* Log the battery tip
*/