Cwa-app-android: Notification doesn't expand when dragging

Created on 9 Dec 2020  路  13Comments  路  Source: corona-warn-app/cwa-app-android

Avoid duplicates

  • [X] Bug is not mentioned in the FAQ
  • [X] Bug is specific for Android only, for general issues / questions that apply to iOS and Android please raise them in the documentation repository
  • [X] Bug is not already reported in another issue

Technical details

  • Device name: Xiaomi Mi 10 (MIUI Global 11.0.13.0 QJBEUVF)
  • Android version: 10 QKQ1.191117.002
  • App version: 1.7.1

Describe the bug

When I receive notifications from cwa that contain multiple lines of text, I can't expand the notification. Therefore it's not possible to see the entire content of the notification, but just the first line of text. See animated GIF below.

ExpandNotificationBug

Steps to reproduce the issue

  1. Receive a multi line notification from cwa.
  2. Try to expand the notification by dragging it.

Expected behaviour

The notification expands and shows it's entire content.


Internal Tracking ID: EXPOSUREAPP-4251

bug mirrored-to-jira

Most helpful comment

Dear @JanRaber, @MikeMcC399, @vaubaehn, and community

Thank you for your contributions and detailed analysis. This is forwarded to the developers (Internal Tracking ID: EXPOSUREAPP-4251) in the internal Jira system. Any further developments will be notified here in this Github issue.

Best wishes,
DS


Corona-Warn-App Open Source Team

All 13 comments

@JanRaber
It looks like the notification showing as a one line truncated text is:

risk_details_deadman_notification_body
"Bitte denken Sie daran, die Corona-Warn-App regelm盲脽ig zu 枚ffnen, um Ihren Risikostatus zu 眉berpr眉fen."

@MikeMcC399 thanks for sharing the full notification text.

At this point I'm not yet able to tell if this behaviour specific to my device. I'll try to reproduce this on another Android device. Did anybody experience this issue as well?
Is it intended that notifications are shown as one line truncated text and are not expandable?

@JanRaber
The Deadman notification is an enhancement with quite a bit of new code (see https://github.com/corona-warn-app/cwa-app-android/pull/1513 (EXPOSUREAPP-2332)).

I would wait for a response from the Open Source Team / developers first before investing any more effort into investigating. It looks like the notification call needs a little tweaking.

@vaubaehn
The Deadman notification comes from
https://github.com/corona-warn-app/cwa-app-android/blob/main/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/deadman/DeadmanNotificationSender.kt

"By default, the notification's text content is truncated to fit one line. If you want your notification to be longer, you can enable an expandable notification by adding a style template with setStyle()"
See https://developer.android.com/training/notify-user/build-notification#builder.

I'm not experienced in this area, but it seems that private fun buildNotification might benefit from using:
.setStyle(NotificationCompat.BigTextStyle()
.bigText(content))

@MikeMcC399
Yes, could be!

I referenced @kbobrowski 's PR and comment, because in the past there was already an issue, where the notification was not expandable.
See here:

https://github.com/kbobrowski/cwa-app-android/blob/5b6caee492714c99db905205d52caa343c419d8b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/notification/NotificationHelper.kt#L158-L169

sendNotification has a property for expandableLongText: Boolean = false , and in order to expand the text, it needed a call like

    fun sendNotification(content: String, visibility: Int) {
        if (!CoronaWarnApplication.isAppInForeground) {
            sendNotification("", content, visibility, true)
        }
    }

where that property was set to true(which was missing in that old CWA version, so the text was not expandable).

But I'm not sure if NotificationCompat.Builder
https://github.com/corona-warn-app/cwa-app-android/blob/3ca4752876af458f7bf3a41d392623529e863ecf/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/deadman/DeadmanNotificationSender.kt#L36-L52

should have an expandableLongText by default?
There were so many UI changes since...

But like @JanRaber wrote, it could also be a device/MIUI specific issue, so let's see the result, if he's able to test on a different device.

@vaubaehn
I was able to see the problem on an Android 11 emulator, which had been idle for several days, and I tried out my fix suggestion on a test program, which worked, so I think we just need to let the developers take over now.

@MikeMcC399

I was able to see the problem on an Android 11 emulator, which had been idle for several days, and I tried out my fix suggestion on a test program, which worked, so I think we just need to let the developers take over now.

That's great, good job! :+1: Wouldn't it be nice if you created a PR and contribute? You'd definitely deserve to get the contributer badge! And I'm sure devs would love to offer you to open a PR :)

@vaubaehn

That's great, good job! 馃憤 Wouldn't it be nice if you created a PR and contribute? You'd definitely deserve to get the contributer badge! And I'm sure devs would love to offer you to open a PR :)

I'm flattered by your confidence, however I can't test the app if I were to make changes (I'm not whitelisted), and the functionality involved has compatibility dependencies according to the version of Android in use, so changes would need to be checked on Android versions which I don't have hardware for anyway.

So, I'm happy for the real developers to be looking at this, and I'm glad if any pre-qualification that's been done in this issue speeds up the resolution.

@MikeMcC399

I was able to see the problem on an Android 11 emulator, which had been idle for several days, and I tried out my fix suggestion on a test program, which worked, so I think we just need to let the developers take over now.

Great work! This should be enough to verify that we're not facing a device specific issue.

Dear @JanRaber, @MikeMcC399, @vaubaehn, and community

Thank you for your contributions and detailed analysis. This is forwarded to the developers (Internal Tracking ID: EXPOSUREAPP-4251) in the internal Jira system. Any further developments will be notified here in this Github issue.

Best wishes,
DS


Corona-Warn-App Open Source Team

@dsarkar

Internal Tracking ID: EXPOSUREAPP-4251

Thank you for logging the issue internally! The repo steps from https://github.com/corona-warn-app/cwa-app-android/pull/1513 @AlexanderAlferov are sufficient to show the problem on an Android 11 emulator.

Steps to reproduce

Risk calculation should fail and never succeed in 36 hours (either in foreground or background).

  1. Wait until risk calculation finished
  2. Go to settings -> Date & time
  3. Add two days to current date
  4. Deadman notification should appear

Here are screen shots from advancing the date by 3 days to next Sunday. The text which should be displayed, but which is truncated is:

risk_details_deadman_notification_body
"Please remember to open the Corona-Warn-App regularly to check your risk status."
which appears as:
"Please remember to open the Corona-Warn-App regula.." in the example. The truncation will be dependent on the screen size of the device.

Sunday


Truncated notification

@MikeMcC399, thanks for the additional analysis. We update the developers with these details. DS

Was this page helpful?
0 / 5 - 0 ratings