Fix crash preventing some Xiaomi devices from showing notifications

pull/535/head
Alinson S. Xavier 6 years ago
parent ce27773138
commit e50c411d1e

@ -1,5 +1,9 @@
# Changelog # Changelog
### 1.7.10 (June 15, 2019)
* Fix bug that prevented some devices from showing notifications.
### 1.7.8 (April 21, 2018) ### 1.7.8 (April 21, 2018)
* Add support for adaptive icons (Oreo) * Add support for adaptive icons (Oreo)

@ -21,8 +21,8 @@
<manifest <manifest
package="org.isoron.uhabits" package="org.isoron.uhabits"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="36" android:versionCode="37"
android:versionName="1.7.9"> android:versionName="1.7.10">
<uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.VIBRATE"/>

@ -239,7 +239,13 @@ public class NotificationTray
createAndroidNotificationChannel(context); createAndroidNotificationChannel(context);
int notificationId = getNotificationId(habit); int notificationId = getNotificationId(habit);
notificationManager.notify(notificationId, builder.build());
try {
notificationManager.notify(notificationId, builder.build());
} catch(RuntimeException e) {
builder.setSound(null);
notificationManager.notify(notificationId, builder.build());
}
} }
private boolean shouldShowReminderToday() private boolean shouldShowReminderToday()

Loading…
Cancel
Save