From 334c67d79dde177f9265e6bc193d2b616228ae94 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 7 Dec 2019 17:45:41 +0100 Subject: [PATCH] To do: fix permission request --- .../main/java/eu/faircode/email/ActivitySetup.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 87b2dfe899..535898b34c 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -991,9 +991,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac protected void onExecuted(Bundle args, Boolean oauth) { ToastEx.makeText(ActivitySetup.this, R.string.title_setup_imported, Toast.LENGTH_LONG).show(); - if (oauth && - Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && - getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) { + if (oauth && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { List permissions = new ArrayList<>(); permissions.add(Manifest.permission.READ_CONTACTS); // profile if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) @@ -1001,11 +999,13 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac for (String permission : permissions) if (!hasPermission(permission)) { + // TODO: fix permissions request requestPermissions(permissions.toArray(new String[0]), REQUEST_IMPORT_OAUTH); - break; + //return; } - } else - ServiceSynchronize.eval(ActivitySetup.this, false, "import"); + } + + ServiceSynchronize.eval(ActivitySetup.this, false, "import"); } @Override