Merge pull request #1235 from ifsnow/fix-notification-android-defaults

[Android] Fix setDefaults in Notifications.
This commit is contained in:
Chris Bianca 2018-06-21 08:46:21 +01:00 committed by GitHub
commit afb511f968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions

View File

@ -142,12 +142,19 @@ public class DisplayNotificationTask extends AsyncTask<Void, Void, Void> {
if (android.containsKey("contentInfo")) {
nb = nb.setContentInfo(android.getString("contentInfo"));
}
if (notification.containsKey("defaults")) {
double[] defaultsArray = android.getDoubleArray("defaults");
int defaults = 0;
for (Double d : defaultsArray) {
defaults |= d.intValue();
if (android.containsKey("defaults")) {
Double defaultValues = android.getDouble("defaults");
int defaults = defaultValues.intValue();
if (defaults == 0) {
ArrayList<Integer> defaultsArray = android.getIntegerArrayList("defaults");
if(defaultsArray != null) {
for (Integer defaultValue : defaultsArray) {
defaults |= defaultValue;
}
}
}
nb = nb.setDefaults(defaults);
}
if (android.containsKey("group")) {