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

@@ -19,6 +19,8 @@ package com.android.settings.testutils;
import android.content.Intent;
import android.os.BatteryManager;
import java.lang.reflect.Field;
public class BatteryTestUtils {
public static Intent getChargingIntent() {
@@ -47,4 +49,15 @@ public class BatteryTestUtils {
return intent;
}
public static void clearStaticInstance(Class clazz, String fieldName) {
Field instance;
try {
instance = clazz.getDeclaredField(fieldName);
instance.setAccessible(true);
instance.set(null, null);
} catch (Exception e) {
throw new RuntimeException();
}
}
}