mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 09:58:08 +00:00
Fixed exception while handling notifications
Summary: An exception occurred while processing non-repliable notifications Test Plan: Send a non-repliable notification, look in log for exception Reviewers: #kde_connect, albertvaka Reviewed By: #kde_connect, albertvaka Subscribers: apol, albertvaka, #kde_connect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D6740
This commit is contained in:
parent
c62a4bb4c4
commit
2ffeab0c5e
@ -323,18 +323,20 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
||||
Boolean reply = false;
|
||||
|
||||
//works for WhatsApp, but not for Telegram
|
||||
for(Notification.Action act : statusBarNotification.getNotification().actions) {
|
||||
if(act != null && act.getRemoteInputs() != null) {
|
||||
repliableNotification.remoteInputs.addAll(Arrays.asList(act.getRemoteInputs()));
|
||||
repliableNotification.pendingIntent = act.actionIntent;
|
||||
reply = true;
|
||||
break;
|
||||
if(statusBarNotification.getNotification().actions!=null) {
|
||||
for (Notification.Action act : statusBarNotification.getNotification().actions) {
|
||||
if (act != null && act.getRemoteInputs() != null) {
|
||||
repliableNotification.remoteInputs.addAll(Arrays.asList(act.getRemoteInputs()));
|
||||
repliableNotification.pendingIntent = act.actionIntent;
|
||||
reply = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
repliableNotification.packageName = statusBarNotification.getPackageName();
|
||||
|
||||
repliableNotification.tag = statusBarNotification.getTag();//TODO find how to pass Tag with sending PendingIntent, might fix Hangout problem
|
||||
}
|
||||
|
||||
repliableNotification.packageName = statusBarNotification.getPackageName();
|
||||
|
||||
repliableNotification.tag = statusBarNotification.getTag();//TODO find how to pass Tag with sending PendingIntent, might fix Hangout problem
|
||||
} catch(Exception e) {
|
||||
Log.w("NotificationPlugin","problem extracting notification wear for " + statusBarNotification.getNotification().tickerText);
|
||||
e.printStackTrace();
|
||||
|
Loading…
x
Reference in New Issue
Block a user