Update detector and action for restrict app
1. In detector, read data from database and display it. 2. Update the RestrictAppAction to mark anomaly as handled if restriction is toggled. 3. Update the RestrictAppTip to handle state change. Bug: 72385333 Test: RunSettingsRoboTests Change-Id: I0bbe6f6fd049bf2e7a2bee1dee08d5199f922e31
This commit is contained in:
@@ -81,7 +81,14 @@ public class RestrictAppTip extends BatteryTip {
|
||||
|
||||
@Override
|
||||
public void updateState(BatteryTip tip) {
|
||||
mState = tip.mState;
|
||||
if (tip.mState == StateType.NEW) {
|
||||
// Display it if new anomaly comes
|
||||
mState = StateType.NEW;
|
||||
mRestrictAppList = ((RestrictAppTip) tip).mRestrictAppList;
|
||||
} else if (mState == StateType.NEW && tip.mState == StateType.INVISIBLE) {
|
||||
// If anomaly becomes invisible, show it as handled
|
||||
mState = StateType.HANDLED;
|
||||
}
|
||||
}
|
||||
|
||||
public List<AppInfo> getRestrictAppList() {
|
||||
|
Reference in New Issue
Block a user