mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 13:47:41 +00:00
Fixed bugs in NotificationsPlugin
Already existing notifications were not retrieved Notifications without tickerText were crashing the plugin
This commit is contained in:
parent
996516ec88
commit
786ea7658f
@ -126,12 +126,10 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
||||
public void onServiceStart(NotificationReceiver service) {
|
||||
try {
|
||||
service.addListener(NotificationsPlugin.this);
|
||||
/*
|
||||
StatusBarNotification[] notifications = service.getActiveNotifications();
|
||||
for (StatusBarNotification notification : notifications) {
|
||||
onNotificationPosted(notification);
|
||||
}
|
||||
*/
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e("NotificationsPlugin","Exception");
|
||||
@ -204,7 +202,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
||||
np.set("id", id.serialize());
|
||||
np.set("appName", appName == null? packageName : appName);
|
||||
np.set("isClearable", statusBarNotification.isClearable());
|
||||
np.set("ticker", notification.tickerText.toString());
|
||||
np.set("ticker", (notification != null && notification.tickerText != null)? notification.tickerText.toString() : "");
|
||||
np.set("time", Long.toString(statusBarNotification.getPostTime()));
|
||||
if (requestAnswer) np.set("requestAnswer", true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user