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:
jackqdyulei
2018-02-08 10:07:11 -08:00
parent fe13d2813a
commit af2ece7387
7 changed files with 194 additions and 8 deletions

View File

@@ -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() {