Open chop-suey opened 7 months ago
Hi @chop-suey,
Thanks for reporting! Could you please provide us the steps to reproduce on the demo app?
Hi @tianyif Thanks for getting back. Unfortunetaly i cannot reproduce this issue, since it only happens on some devices i do not have at hand. What i forgot to mention, but might be quite important: It only happens when the device language is set to chinese.
There seems to be a problem when the notification for the foreground service is shown in that language. #903 implicates there might be some problem with the duration of the media. But i am not quite sure if that correlates to a language dependent problem.
What we do:
In case it helps debug further, that exception seems to originate here in the framework: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java;l=1396;drc=c11765ac782525cb803ac13886bd61dcdf71e33b
And the message "long overflow
" probably comes from an invocation of one of the Math.xxxExact
methods: https://cs.android.com/android/platform/superproject/main/+/main:libcore/ojluni/src/main/java/java/lang/Math.java
Unfortunately we're obviously missing the stack trace to indicate where the ArithmeticException
is being thrown from.
I wonder if we need to look at the other place we call setWhen
?
It doesn't look obviously problematic though...
Aside: I'm not sure how this code interacts with live playback, when getContentPosition
returns a negative value (https://developer.android.com/media/media3/exoplayer/live-streaming). I think that results in a 'future' timestamp on the notification, which looks like it's permitted: https://developer.android.com/reference/android/app/Notification#when
Version
Media3 main branch
More version details
1.2.1
Devices that reproduce the issue
Huawei Mate 40 Pro running Android 12
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
I do not have the affected device available
Expected result
The media plays successfully without crashing the app
Actual result
When playing media using a service that extends
MediaSessionService
the app crashes. This sounds similar to #903 but we do not usesetWhen
norsetShowWhen
.Stacktrace:
Media
Do not have specific media at hand, but doubt that it is related to the actual media it probably has the following specs, though:
Format: AAC LC Codec ID: mp4a-40-2 Bit rate: 32.0 kb/s Channels: 1 channel Sampling rate: 44.1 kHz
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.