D22140: Fix text extraction from notifications

Dmitriy Bogdanov noreply at phabricator.kde.org
Fri Jun 28 14:07:37 BST 2019


di72nn added a comment.


  I'm not familiar with `arcanist`, so I'll just add some extra info in a message.
  
  There was a warning message in logs (when a message received in Conversations, for example):
  
    org.kde.kdeconnect_tp W/Bundle: Key text expected String but value was a android.text.SpannableString.  The default value <null> was returned.
    org.kde.kdeconnect_tp W/Bundle: Attempt to cast generated internal exception:
        java.lang.ClassCastException: android.text.SpannableString cannot be cast to java.lang.String
            at android.os.BaseBundle.getString(BaseBundle.java:1121)
            at org.kde.kdeconnect.Plugins.NotificationsPlugin.NotificationsPlugin.extractConversation(NotificationsPlugin.java:380)
            at org.kde.kdeconnect.Plugins.NotificationsPlugin.NotificationsPlugin.sendNotification(NotificationsPlugin.java:254)
            at org.kde.kdeconnect.Plugins.NotificationsPlugin.NotificationsPlugin.onNotificationPosted(NotificationsPlugin.java:179)
            at org.kde.kdeconnect.Plugins.NotificationsPlugin.NotificationReceiver.onNotificationPosted(NotificationReceiver.java:63)
            at android.service.notification.NotificationListenerService.onNotificationPosted(NotificationListenerService.java:317)
            at android.service.notification.NotificationListenerService$MyHandler.handleMessage(NotificationListenerService.java:1830)
            at android.os.Handler.dispatchMessage(Handler.java:106)
            at android.os.Looper.loop(Looper.java:164)
            at android.app.ActivityThread.main(ActivityThread.java:6494)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
  
  Also `Notification.EXTRA_IS_GROUP_CONVERSATION` was replaced with a `NotificationCompat` equivalent which does make a difference on Android <9 (tested on Android 8.1 with Conversations).
  
  Other `Build.VERSION.SDK_INT`-related changes are not so important, but can improve something on pre-KITKAT devices.
  
  Oh, and thanks for all the great work you guys put into this app!

REPOSITORY
  R225 KDE Connect - Android application

REVISION DETAIL
  https://phabricator.kde.org/D22140

To: di72nn
Cc: kdeconnect, ewentzel, dshelley, pawelkwiecinski, ctakano, vporvaznik, mschroeder, varunp, shivanshukantprasad, skymoore, fbampaloukas, brute4s99, wistak, anoopv, dvalencia, rmenezes, julioc, Leptopoda, timothyc, Danial0_0, johnq, Pitel, domson, adeen-s, SemperPeritus, daniel.z.tg, jeanv, seebauer, bugzy, MayeulC, lemuel, menasshock, mikesomov, tctara, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20190628/5a9efa2c/attachment.html>


More information about the KDEConnect mailing list