Merge pull request #1235 from ifsnow/fix-notification-android-defaults
[Android] Fix setDefaults in Notifications.
This commit is contained in:
commit
afb511f968
|
@ -142,12 +142,19 @@ public class DisplayNotificationTask extends AsyncTask<Void, Void, Void> {
|
||||||
if (android.containsKey("contentInfo")) {
|
if (android.containsKey("contentInfo")) {
|
||||||
nb = nb.setContentInfo(android.getString("contentInfo"));
|
nb = nb.setContentInfo(android.getString("contentInfo"));
|
||||||
}
|
}
|
||||||
if (notification.containsKey("defaults")) {
|
if (android.containsKey("defaults")) {
|
||||||
double[] defaultsArray = android.getDoubleArray("defaults");
|
Double defaultValues = android.getDouble("defaults");
|
||||||
int defaults = 0;
|
int defaults = defaultValues.intValue();
|
||||||
for (Double d : defaultsArray) {
|
|
||||||
defaults |= d.intValue();
|
if (defaults == 0) {
|
||||||
|
ArrayList<Integer> defaultsArray = android.getIntegerArrayList("defaults");
|
||||||
|
if(defaultsArray != null) {
|
||||||
|
for (Integer defaultValue : defaultsArray) {
|
||||||
|
defaults |= defaultValue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nb = nb.setDefaults(defaults);
|
nb = nb.setDefaults(defaults);
|
||||||
}
|
}
|
||||||
if (android.containsKey("group")) {
|
if (android.containsKey("group")) {
|
||||||
|
|
Loading…
Reference in New Issue