1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 09:47:13 +00:00

Added service disabled message

This commit is contained in:
M66B 2020-07-22 16:23:54 +02:00
parent f38a33ee7b
commit de4efc9297
2 changed files with 9 additions and 0 deletions

View file

@ -24,6 +24,7 @@ import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.accounts.AuthenticatorException;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@ -251,6 +252,8 @@ public class FragmentGmail extends FragmentBase {
String name = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);
String type = data.getStringExtra(AccountManager.KEY_ACCOUNT_TYPE);
final String disabled = getString(R.string.title_setup_advanced_protection);
boolean found = false;
AccountManager am = AccountManager.get(getContext());
Account[] accounts = am.getAccountsByType(type);
@ -275,7 +278,12 @@ public class FragmentGmail extends FragmentBase {
onAuthorized(name, token);
} catch (Throwable ex) {
if (ex instanceof AuthenticatorException &&
"ServiceDisabled".equals(ex.getMessage()))
ex = new IllegalArgumentException(disabled, ex);
Log.e(ex);
tvError.setText(Log.formatThrowable(ex));
grpError.setVisibility(View.VISIBLE);

View file

@ -179,6 +179,7 @@
<string name="title_setup_no_auth_hint">Please double check your email address and password and make sure external access (IMAP/SMTP) is enabled for your account</string>
<string name="title_setup_app_password_hint">This provider requires an app password instead of the account password, please check the instructions of your provider</string>
<string name="title_setup_no_system_folders">Inbox or draft folder not found</string>
<string name="title_setup_advanced_protection">When enrolled in the advanced protection program it is not possible to use a third party email app. This is a restriction imposed by Google.</string>
<string name="title_setup_quick_success">An account and an identity have successfully been added</string>
<string name="title_setup_quick_failed">You can try to configure an account and an identity below too</string>
<string name="title_setup_manage">Manage</string>