use of com.android.internal.util.Predicate in project android_frameworks_base by DirtyUnicorns.
the class RecentsProvider method call.
@Override
public Bundle call(String method, String arg, Bundle extras) {
if (METHOD_PURGE.equals(method)) {
// Purge references to unknown authorities
final Intent intent = new Intent(DocumentsContract.PROVIDER_INTERFACE);
final Set<String> knownAuth = Sets.newHashSet();
for (ResolveInfo info : getContext().getPackageManager().queryIntentContentProviders(intent, 0)) {
knownAuth.add(info.providerInfo.authority);
}
purgeByAuthority(new Predicate<String>() {
@Override
public boolean apply(String authority) {
// Purge unknown authorities
return !knownAuth.contains(authority);
}
});
return null;
} else if (METHOD_PURGE_PACKAGE.equals(method)) {
// Purge references to authorities in given package
final Intent intent = new Intent(DocumentsContract.PROVIDER_INTERFACE);
intent.setPackage(arg);
final Set<String> packageAuth = Sets.newHashSet();
for (ResolveInfo info : getContext().getPackageManager().queryIntentContentProviders(intent, 0)) {
packageAuth.add(info.providerInfo.authority);
}
if (!packageAuth.isEmpty()) {
purgeByAuthority(new Predicate<String>() {
@Override
public boolean apply(String authority) {
// Purge authority matches
return packageAuth.contains(authority);
}
});
}
return null;
} else {
return super.call(method, arg, extras);
}
}
use of com.android.internal.util.Predicate in project AnExplorer by 1hakr.
the class RecentsProvider method call.
@Override
public Bundle call(String method, String arg, Bundle extras) {
if (METHOD_PURGE.equals(method)) {
// Purge references to unknown authorities
final ArraySet<String> knownAuth = new ArraySet<>();
List<ProviderInfo> providers = getContext().getPackageManager().queryContentProviders(getContext().getPackageName(), getContext().getApplicationInfo().uid, 0);
for (ProviderInfo providerInfo : providers) {
knownAuth.add(providerInfo.authority);
}
purgeByAuthority(new Predicate<String>() {
@Override
public boolean apply(String authority) {
// Purge unknown authorities
return !knownAuth.contains(authority);
}
});
return null;
} else if (METHOD_PURGE_PACKAGE.equals(method)) {
// Purge references to authorities in given package
final Intent intent = new Intent(DocumentsContract.PROVIDER_INTERFACE);
intent.setPackage(arg);
final ArraySet<String> packageAuth = new ArraySet<>();
List<ProviderInfo> providers = getContext().getPackageManager().queryContentProviders(getContext().getPackageName(), getContext().getApplicationInfo().uid, 0);
for (ProviderInfo providerInfo : providers) {
packageAuth.add(providerInfo.authority);
}
if (!packageAuth.isEmpty()) {
purgeByAuthority(new Predicate<String>() {
@Override
public boolean apply(String authority) {
// Purge authority matches
return packageAuth.contains(authority);
}
});
}
return null;
} else {
return super.call(method, arg, extras);
}
}
use of com.android.internal.util.Predicate in project android_frameworks_base by ParanoidAndroid.
the class InstrumentationCoreTestRunner method getBuilderRequirements.
@Override
List<Predicate<TestMethod>> getBuilderRequirements() {
List<Predicate<TestMethod>> builderRequirements = super.getBuilderRequirements();
Predicate<TestMethod> brokenTestPredicate = Predicates.not(new HasAnnotation(BrokenTest.class));
builderRequirements.add(brokenTestPredicate);
if (!singleTest) {
Predicate<TestMethod> sideEffectPredicate = Predicates.not(new HasAnnotation(SideEffect.class));
builderRequirements.add(sideEffectPredicate);
}
return builderRequirements;
}
use of com.android.internal.util.Predicate in project android_frameworks_base by AOSPA.
the class RecentsProvider method call.
@Override
public Bundle call(String method, String arg, Bundle extras) {
if (METHOD_PURGE.equals(method)) {
// Purge references to unknown authorities
final Intent intent = new Intent(DocumentsContract.PROVIDER_INTERFACE);
final Set<String> knownAuth = Sets.newHashSet();
for (ResolveInfo info : getContext().getPackageManager().queryIntentContentProviders(intent, 0)) {
knownAuth.add(info.providerInfo.authority);
}
purgeByAuthority(new Predicate<String>() {
@Override
public boolean apply(String authority) {
// Purge unknown authorities
return !knownAuth.contains(authority);
}
});
return null;
} else if (METHOD_PURGE_PACKAGE.equals(method)) {
// Purge references to authorities in given package
final Intent intent = new Intent(DocumentsContract.PROVIDER_INTERFACE);
intent.setPackage(arg);
final Set<String> packageAuth = Sets.newHashSet();
for (ResolveInfo info : getContext().getPackageManager().queryIntentContentProviders(intent, 0)) {
packageAuth.add(info.providerInfo.authority);
}
if (!packageAuth.isEmpty()) {
purgeByAuthority(new Predicate<String>() {
@Override
public boolean apply(String authority) {
// Purge authority matches
return packageAuth.contains(authority);
}
});
}
return null;
} else {
return super.call(method, arg, extras);
}
}
use of com.android.internal.util.Predicate in project android_frameworks_base by ResurrectionRemix.
the class RecentsProvider method call.
@Override
public Bundle call(String method, String arg, Bundle extras) {
if (METHOD_PURGE.equals(method)) {
// Purge references to unknown authorities
final Intent intent = new Intent(DocumentsContract.PROVIDER_INTERFACE);
final Set<String> knownAuth = Sets.newHashSet();
for (ResolveInfo info : getContext().getPackageManager().queryIntentContentProviders(intent, 0)) {
knownAuth.add(info.providerInfo.authority);
}
purgeByAuthority(new Predicate<String>() {
@Override
public boolean apply(String authority) {
// Purge unknown authorities
return !knownAuth.contains(authority);
}
});
return null;
} else if (METHOD_PURGE_PACKAGE.equals(method)) {
// Purge references to authorities in given package
final Intent intent = new Intent(DocumentsContract.PROVIDER_INTERFACE);
intent.setPackage(arg);
final Set<String> packageAuth = Sets.newHashSet();
for (ResolveInfo info : getContext().getPackageManager().queryIntentContentProviders(intent, 0)) {
packageAuth.add(info.providerInfo.authority);
}
if (!packageAuth.isEmpty()) {
purgeByAuthority(new Predicate<String>() {
@Override
public boolean apply(String authority) {
// Purge authority matches
return packageAuth.contains(authority);
}
});
}
return null;
} else {
return super.call(method, arg, extras);
}
}
Aggregations