MCPcopy Create free account
hub / github.com/M66B/FairEmail / onExit

Method onExit

app/src/main/java/eu/faircode/email/ActivitySetup.java:362–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

360 }
361
362 public void onExit() {
363 if (drawerLayout.isDrawerOpen(drawerContainer))
364 drawerLayout.closeDrawer(drawerContainer);
365 else {
366 if (getSupportFragmentManager().getBackStackEntryCount() > 1) {
367 performBack();
368 return;
369 }
370
371 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
372 boolean setup_reminder = prefs.getBoolean("setup_reminder", true);
373
374 boolean hasContactPermissions =
375 hasPermission(android.Manifest.permission.READ_CONTACTS);
376 boolean hasNotificationPermissions =
377 (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU ||
378 hasPermission(Manifest.permission.POST_NOTIFICATIONS));
379 boolean isIgnoring = !Boolean.FALSE.equals(Helper.isIgnoringOptimizations(this));
380
381 if (!setup_reminder ||
382 (hasContactPermissions && hasNotificationPermissions && isIgnoring))
383 performBack();
384 else {
385 FragmentDialogPermissions fragment = new FragmentDialogPermissions();
386 fragment.setTargetActivity(this, REQUEST_STILL);
387 fragment.show(getSupportFragmentManager(), "setup:still");
388 }
389 }
390 }
391
392 @Override
393 public void onBackStackChanged() {

Callers 2

handleOnBackPressedMethod · 0.95
onMenuCloseMethod · 0.95

Calls 7

performBackMethod · 0.80
getBooleanMethod · 0.80
setTargetActivityMethod · 0.80
hasPermissionMethod · 0.45
equalsMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected