diff --git a/F-Droid/src/org/fdroid/fdroid/AppDetails.java b/F-Droid/src/org/fdroid/fdroid/AppDetails.java index 1d587e7e0..4bdc1621f 100644 --- a/F-Droid/src/org/fdroid/fdroid/AppDetails.java +++ b/F-Droid/src/org/fdroid/fdroid/AppDetails.java @@ -1553,10 +1553,10 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A if (activity.downloadHandler != null) { btMain.setText(R.string.downloading); btMain.setEnabled(false); - // Check count > 0 due to incompatible apps resulting in an empty list. - // If App isn't installed } else if (!app.isInstalled() && app.suggestedVercode > 0 && activity.adapter.getCount() > 0) { + // Check count > 0 due to incompatible apps resulting in an empty list. + // If App isn't installed installed = false; statusView.setText(R.string.details_notinstalled); NfcHelper.disableAndroidBeam(activity); @@ -1564,8 +1564,8 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A btMain.setText(R.string.menu_install); btMain.setOnClickListener(mOnClickListener); btMain.setEnabled(true); - // If App is installed } else if (app.isInstalled()) { + // If App is installed installed = true; statusView.setText(getString(R.string.details_installed, app.installedVersionName)); NfcHelper.setAndroidBeam(activity, app.packageName); @@ -1607,16 +1607,16 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A return; } } - // If installed if (installed) { - // If "launchable", launch + // If installed if (activity.mPm.getLaunchIntentForPackage(app.packageName) != null) { + // If "launchable", launch activity.launchApk(app.packageName); } else { activity.removeApk(app.packageName); } - // If not installed, install } else if (app.suggestedVercode > 0) { + // If not installed, install btMain.setEnabled(false); btMain.setText(R.string.system_install_installing); final Apk apkToInstall = ApkProvider.Helper.find(activity, app.packageName, app.suggestedVercode); diff --git a/F-Droid/src/org/fdroid/fdroid/CompatibilityChecker.java b/F-Droid/src/org/fdroid/fdroid/CompatibilityChecker.java index db22131d6..6046f677e 100644 --- a/F-Droid/src/org/fdroid/fdroid/CompatibilityChecker.java +++ b/F-Droid/src/org/fdroid/fdroid/CompatibilityChecker.java @@ -17,7 +17,7 @@ import java.util.List; import java.util.Set; // Call getIncompatibleReasons(apk) on an instance of this class to - // find reasons why an apk may be incompatible with the user's device. +// find reasons why an apk may be incompatible with the user's device. public class CompatibilityChecker extends Compatibility { private static final String TAG = "Compatibility"; diff --git a/F-Droid/src/org/fdroid/fdroid/localrepo/LocalRepoKeyStore.java b/F-Droid/src/org/fdroid/fdroid/localrepo/LocalRepoKeyStore.java index b1a2a6125..5b223c044 100644 --- a/F-Droid/src/org/fdroid/fdroid/localrepo/LocalRepoKeyStore.java +++ b/F-Droid/src/org/fdroid/fdroid/localrepo/LocalRepoKeyStore.java @@ -165,8 +165,8 @@ public final class LocalRepoKeyStore { }; } catch (UnrecoverableKeyException | KeyStoreException | NoSuchAlgorithmException | CertificateException | OperatorCreationException | IOException e) { Log.e(TAG, "Error loading keystore", e); - // TODO: Remove once we have a proper fix for #334 } catch (IllegalArgumentException e) { + // TODO: Remove once we have a proper fix for #334 Log.e(TAG, "Error loading keystore", e); Log.e(TAG, "See https://gitlab.com/fdroid/fdroidclient/issues/334"); } diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 3d09e8bbc..70e9127e0 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -49,6 +49,7 @@ +