From 2e2a6bd4190c3ccadf52883ca86e75d63c96922c Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 2 May 2017 22:00:24 +0200 Subject: [PATCH] show Toast when file type cannot be installed This is just a placeholder until we implement proper "installing" for non-APK files. !504 #982 --- .../org/fdroid/fdroid/installer/InstallerFactory.java | 9 +++++---- app/src/main/res/values/strings.xml | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/installer/InstallerFactory.java b/app/src/main/java/org/fdroid/fdroid/installer/InstallerFactory.java index 55dfa7a01..e00206d17 100644 --- a/app/src/main/java/org/fdroid/fdroid/installer/InstallerFactory.java +++ b/app/src/main/java/org/fdroid/fdroid/installer/InstallerFactory.java @@ -22,8 +22,8 @@ package org.fdroid.fdroid.installer; import android.content.Context; import android.text.TextUtils; -import android.util.Log; - +import android.widget.Toast; +import org.fdroid.fdroid.R; import org.fdroid.fdroid.Utils; import org.fdroid.fdroid.data.Apk; @@ -41,7 +41,6 @@ public class InstallerFactory { * @return instance of an Installer */ public static Installer create(Context context, Apk apk) { - Log.d(TAG, "Apk.apkName " + apk.apkName); if (apk == null || TextUtils.isEmpty(apk.packageName)) { throw new IllegalArgumentException("Apk.packageName must not be empty: " + apk); } @@ -49,7 +48,9 @@ public class InstallerFactory { Installer installer; if (!apk.apkName.endsWith(".apk")) { - Utils.debugLog(TAG, "Using DummyInstaller for " + apk.apkName); + String msg = context.getString(R.string.install_error_not_yet_supported, apk.apkName); + Toast.makeText(context, msg, Toast.LENGTH_LONG).show(); + Utils.debugLog(TAG, msg); installer = new DummyInstaller(context, apk); } else if (PrivilegedInstaller.isDefault(context)) { Utils.debugLog(TAG, "privileged extension correctly installed -> PrivilegedInstaller"); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c2ed120dd..02fe5dfe7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -351,6 +351,7 @@ Failed to install due to an unknown error Failed to uninstall due to an unknown error + File type cannot yet be installed: %s F-Droid Privileged Extension is not available This option is only available when F-Droid Privileged Extension is installed.