use of android.app.AppOpsManager.PackageOps in project robolectric by robolectric.
the class ShadowAppOpsManager method getOpsForPackage.
@Implementation(minSdk = KITKAT)
@HiddenApi
public List<PackageOps> getOpsForPackage(int uid, String packageName, int[] ops) {
Set<Integer> opFilter = new HashSet<>();
if (ops != null) {
for (int op : ops) {
opFilter.add(op);
}
}
List<OpEntry> opEntries = new ArrayList<>();
for (Integer op : storedOps.get(Key.create(uid, packageName, null))) {
if (opFilter.isEmpty() || opFilter.contains(op)) {
opEntries.add(toOpEntry(op, AppOpsManager.MODE_ALLOWED));
}
}
return ImmutableList.of(new PackageOps(packageName, uid, opEntries));
}
Aggregations