Commit 63e9e7f5 authored by Albert Vaca's avatar Albert Vaca

Fix crash on Android < 7.0

getOrDefault is not supported until java 8, introduced on Android 7
parent 7e5df069
......@@ -318,7 +318,11 @@ public class SMSHelper {
@NonNull Map<String, String> messageInfo,
@NonNull int eventFlag
) {
int oldEvent = Integer.parseInt(messageInfo.getOrDefault(Message.EVENT, "0"));
int oldEvent = 0; //Default value
String oldEventString = messageInfo.get(Message.EVENT);
if (oldEventString != null) {
oldEvent = Integer.parseInt(oldEventString);
}
messageInfo.put(Message.EVENT, Integer.toString(oldEvent | eventFlag));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment