Skip to content

Commit

Permalink
Remove unused OpenPgpAppPreference
Browse files Browse the repository at this point in the history
  • Loading branch information
cketti committed May 21, 2018
1 parent ffbd8b1 commit 5e3efd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 344 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import com.fsck.k9.R;
import com.fsck.k9.ui.dialog.ApgDeprecationWarningDialog;
import org.openintents.openpgp.util.OpenPgpApi;
import org.openintents.openpgp.util.OpenPgpAppPreference;
import org.openintents.openpgp.util.OpenPgpProviderUtil;
import timber.log.Timber;

Expand All @@ -41,6 +40,7 @@ public class OpenPgpAppSelectDialog extends FragmentActivity {
private static final String EXTRA_ACCOUNT = "account";

private static final String OPENKEYCHAIN_PACKAGE = "org.sufficientlysecure.keychain";
private static final String PACKAGE_NAME_APG = "org.thialfihar.android.apg";
private static final String APG_PROVIDER_PLACEHOLDER = "apg-placeholder";

public static final String FRAG_OPENPGP_SELECT = "openpgp_select";
Expand Down Expand Up @@ -124,7 +124,7 @@ private void populateAppList() {
getResources().getDrawable(R.drawable.ic_action_cancel_launchersize_light));
openPgpProviderList.add(noneEntry);

if (OpenPgpAppPreference.isApgInstalled(getActivity())) {
if (isApgInstalled(getActivity())) {
Drawable icon = getResources().getDrawable(R.drawable.ic_apg_small);
openPgpProviderList.add(new OpenPgpProviderEntry(
APG_PROVIDER_PLACEHOLDER, getString(R.string.apg), icon));
Expand Down Expand Up @@ -168,6 +168,13 @@ private void populateAppList() {
}
}

private boolean isApgInstalled(Context context) {
Intent intent = new Intent("org.openintents.openpgp.IOpenPgpService");
intent.setPackage(PACKAGE_NAME_APG);
List<ResolveInfo> resInfo = context.getPackageManager().queryIntentServices(intent, 0);
return resInfo != null && !resInfo.isEmpty();
}

@Override
public void onStop() {
super.onStop();
Expand Down

This file was deleted.

0 comments on commit 5e3efd3

Please sign in to comment.