Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Snippets Groups Projects
Commit c4e5e6b1 authored by cketti's avatar cketti
Browse files

Rename PROVIDER_BLACKLIST to DISALLOWED_PROVIDERS

parent 4b8d6bf5
Branches
No related tags found
No related merge requests found
......@@ -141,7 +141,7 @@ public class OpenPgpAppSelectDialog extends FragmentActivity {
// search for OpenPGP providers...
Intent intent = new Intent(OpenPgpApi.SERVICE_INTENT_2);
List<ResolveInfo> resInfo = getActivity().getPackageManager().queryIntentServices(intent, 0);
boolean hasNonBlacklistedChoices = false;
boolean hasAllowedChoices = false;
if (resInfo != null) {
for (ResolveInfo resolveInfo : resInfo) {
if (resolveInfo.serviceInfo == null) {
......@@ -152,14 +152,14 @@ public class OpenPgpAppSelectDialog extends FragmentActivity {
String simpleName = String.valueOf(resolveInfo.serviceInfo.loadLabel(context.getPackageManager()));
Drawable icon = resolveInfo.serviceInfo.loadIcon(context.getPackageManager());
if (!OpenPgpProviderUtil.isBlacklisted(packageName)) {
if (OpenPgpProviderUtil.isProviderAllowed(packageName)) {
openPgpProviderList.add(new OpenPgpProviderEntry(packageName, simpleName, icon));
hasNonBlacklistedChoices = true;
hasAllowedChoices = true;
}
}
}
if (!hasNonBlacklistedChoices) {
if (!hasAllowedChoices) {
// add install links if provider list is empty
resInfo = context.getPackageManager().queryIntentActivities(MARKET_INTENT, 0);
for (ResolveInfo resolveInfo : resInfo) {
......
......@@ -12,9 +12,9 @@ import android.content.pm.ResolveInfo;
public class OpenPgpProviderUtil {
private static final String PACKAGE_NAME_APG = "org.thialfihar.android.apg";
private static final ArrayList<String> PROVIDER_BLACKLIST = new ArrayList<>();
private static final ArrayList<String> DISALLOWED_PROVIDERS = new ArrayList<>();
static {
PROVIDER_BLACKLIST.add(PACKAGE_NAME_APG);
DISALLOWED_PROVIDERS.add(PACKAGE_NAME_APG);
}
public static List<String> getOpenPgpProviderPackages(Context context) {
......@@ -56,7 +56,7 @@ public class OpenPgpProviderUtil {
return null;
}
public static boolean isBlacklisted(String packageName) {
return PROVIDER_BLACKLIST.contains(packageName);
public static boolean isProviderAllowed(String packageName) {
return !DISALLOWED_PROVIDERS.contains(packageName);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment