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

Commit e06540c8 authored by David Luhmer's avatar David Luhmer
Browse files

Improve error messages

parent 4474216c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@ public class NextcloudFilesAppNotInstalledException extends SSOException {
    public void loadExceptionMessage(Context context) {
        this.em = new ExceptionMessage(
                context.getString(R.string.nextcloud_files_app_not_installed_title),
                context.getString(R.string.nextcloud_files_app_not_installed_message)
                context.getString(
                        R.string.nextcloud_files_app_not_installed_message,
                        "https://play.google.com/store/apps/details?id=com.nextcloud.client")
        );
    }
}
+3 −1
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@ public class NextcloudFilesAppNotSupportedException extends SSOException {
    public void loadExceptionMessage(Context context) {
        this.em = new ExceptionMessage(
                context.getString(R.string.nextcloud_files_app_not_supported_title),
                context.getString(R.string.nextcloud_files_app_not_supported_message)
                context.getString(
                        R.string.nextcloud_files_app_not_supported_message,
                        "https://play.google.com/store/apps/details?id=com.nextcloud.client")
        );
    }
}
+5 −4
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ import com.nextcloud.android.sso.ui.UiExceptionManager;

public class VersionCheckHelper {

    private static final String TAG = VersionCheckHelper.class.getCanonicalName();

    public static boolean VerifyMinVersion(Activity activity, int minVersion) {
        try {
            int verCode = GetNextcloudFilesVersionCode(activity);
@@ -21,7 +23,8 @@ public class VersionCheckHelper {
                return false;
            }
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            Log.e(TAG, "PackageManager.NameNotFoundException: " + e.getLocalizedMessage());
            //e.printStackTrace();
            UiExceptionManager.ShowDialogForException(activity, new NextcloudFilesAppNotInstalledException());
            return false;
        }
@@ -30,11 +33,9 @@ public class VersionCheckHelper {
    }

    public static int GetNextcloudFilesVersionCode(Activity activity) throws PackageManager.NameNotFoundException {
        PackageInfo pinfo;
        pinfo = activity.getPackageManager().getPackageInfo("com.nextcloud.client", 0);
        PackageInfo pinfo = activity.getPackageManager().getPackageInfo("com.nextcloud.client", 0);
        int verCode = pinfo.versionCode;
        Log.e("VersionCheckHelper", "Version Code: " + verCode);

        return verCode;
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
    <string name="token_mismatch_message">Provided authentication token does not match or package name is not permitted to perform this action</string>

    <string name="nextcloud_files_app_not_installed_title">Error</string>
    <string name="nextcloud_files_app_not_installed_message">Nextcloud Files App is not installed. Please install it: https://play.google.com/store/apps/details?id=com.nextcloud.client</string>
    <string name="nextcloud_files_app_not_installed_message" formatted="true">Nextcloud Files App is not installed. Please install it: %1$s</string>

    <string name="nextcloud_files_app_account_not_found_title">Error</string>
    <string name="nextcloud_files_app_account_not_found_message">Account not found in nextcloud files app</string>
@@ -26,6 +26,6 @@
    <string name="nextcloud_invalid_request_url_message" translatable="false" formatted="true">The requested URL is invalid: %1$s</string>

    <string name="nextcloud_files_app_not_supported_title">Error</string>
    <string name="nextcloud_files_app_not_supported_message">Your nextcloud files app currently does not support the single sign on feature. Please update it: https://play.google.com/store/apps/details?id=com.nextcloud.client</string>
    <string name="nextcloud_files_app_not_supported_message" formatted="true">Your nextcloud files app currently does not support the single sign on feature. Please update it: %1$s</string>

</resources>