()
| 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() { |
no test coverage detected