Make app predicates singleton

1. AppLabelPredicate
2. AppRestrictionPredicate

Change-Id: I1fd8611c5dd7ffa6318bcb23de7a973c111910b6
Fixes: 111323520
Test: RunSettingsRoboTests
This commit is contained in:
jackqdyulei
2018-07-18 13:06:11 -07:00
parent d3e18dcf0a
commit 341ad63da7
10 changed files with 70 additions and 11 deletions

View File

@@ -112,7 +112,7 @@ public class RestrictAppTip extends BatteryTip {
super.sanityCheck(context);
// Set it invisible if there is no valid app
mRestrictAppList.removeIf(new AppLabelPredicate(context));
mRestrictAppList.removeIf(AppLabelPredicate.getInstance(context));
if (mRestrictAppList.isEmpty()) {
mState = StateType.INVISIBLE;
}