- } catch (PackageManager.NameNotFoundException exception) { // I2P is not installed.
- // Sow the I2P not installed dialog if it is not already displayed.
- if (getSupportFragmentManager().findFragmentByTag(getString(R.string.proxy_not_installed_dialog)) == null) {
- // Get a handle for the waiting for proxy alert dialog.
- DialogFragment i2pNotInstalledDialogFragment = ProxyNotInstalledDialog.displayDialog(proxyMode);
+ } catch (PackageManager.NameNotFoundException fdroidException) { // The F-Droid flavor is not installed.
+ try {
+ // Check to see if the Google Play flavor is installed. This will throw an error and drop to the catch section if it isn't installed.
+ packageManager.getPackageInfo("net.i2p.android", 0);
+ } catch (PackageManager.NameNotFoundException googlePlayException) { // The Google Play flavor is not installed.
+ // Sow the I2P not installed dialog if it is not already displayed.
+ if (getSupportFragmentManager().findFragmentByTag(getString(R.string.proxy_not_installed_dialog)) == null) {
+ // Get a handle for the waiting for proxy alert dialog.
+ DialogFragment i2pNotInstalledDialogFragment = ProxyNotInstalledDialog.displayDialog(proxyMode);