Browse Source

fix: check compatibility on notification settings

main
Distopico Vegan 6 years ago
parent
commit
36b3e25259
1 changed files with 12 additions and 4 deletions
  1. +12
    -4
      app/src/main/java/org/dystopia/email/FragmentSetup.java

+ 12
- 4
app/src/main/java/org/dystopia/email/FragmentSetup.java View File

@ -542,10 +542,18 @@ public class FragmentSetup extends FragmentEx {
}
private static Intent getIntentNotifications(Context context) {
return new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
.putExtra("app_package", context.getPackageName())
.putExtra("app_uid", context.getApplicationInfo().uid)
.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
Intent intent = new Intent();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
} else {
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
}
intent.putExtra("app_package", context.getPackageName())
.putExtra("app_uid", context.getApplicationInfo().uid);
return intent;
}
private void handleExport(Intent data) {


Loading…
Cancel
Save