fixed a rare SecurityException when trying to display dictionary loading progress on the lock screen of some devices
This commit is contained in:
parent
6873d302b2
commit
3f1330f152
1 changed files with 6 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ import androidx.core.app.NotificationCompat;
|
||||||
|
|
||||||
import io.github.sspanak.tt9.hacks.DeviceInfo;
|
import io.github.sspanak.tt9.hacks.DeviceInfo;
|
||||||
import io.github.sspanak.tt9.languages.Language;
|
import io.github.sspanak.tt9.languages.Language;
|
||||||
|
import io.github.sspanak.tt9.util.Logger;
|
||||||
|
|
||||||
public abstract class DictionaryNotification {
|
public abstract class DictionaryNotification {
|
||||||
private static final int NOTIFICATION_ID = 1;
|
private static final int NOTIFICATION_ID = 1;
|
||||||
|
|
@ -110,6 +111,10 @@ public abstract class DictionaryNotification {
|
||||||
.setContentTitle(title)
|
.setContentTitle(title)
|
||||||
.setContentText(message);
|
.setContentText(message);
|
||||||
|
|
||||||
|
try {
|
||||||
manager.notify(NOTIFICATION_ID, notificationBuilder.build());
|
manager.notify(NOTIFICATION_ID, notificationBuilder.build());
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
Logger.e(getClass().getSimpleName(), "Failed to show dictionary notification. " + e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue