Closed
Bug 1855034
Opened 2 years ago
Closed 2 years ago
ClassNotFound exception when getting download id from ACTION_DOWNLOAD_COMPLETE intent
Categories
(Firefox for Android :: General, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1847141
People
(Reporter: heath.borders, Unassigned)
Details
Firefox for Android
Steps to reproduce:
My app downloads with:
val request = DownloadManager.Request(uri)
.setDestinationInExternalPublicDir(Environment.DIRECTORY_DCIM, "myfile")
val downloadId = downloadManager.enqueue(request)
...
When my broadcast receiver receives DownloadManager.ACTION_DOWNLOAD_COMPLETE, I get the download ID:
override fun onReceive(context: Context, intent: Intent) {
super.onReceive(context, intent)
if (intent.action == DownloadManager.ACTION_DOWNLOAD_COMPLETE) {
val downloadId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1)
...
}
}
Actual results:
I get the following ClassNotFoundException:
Caused by java.lang.ClassNotFoundException: Didn't find class "mozilla.components.browser.state.state.content.DownloadState$Status" on path <REDACTED>
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:171)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Class.java)
at java.lang.Class.forName(Class.java:453)
at android.os.Parcel$2.resolveClass(Parcel.java:2927)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1615)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1520)
at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1728)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at android.os.Parcel.readSerializable(Parcel.java:2935)
at android.os.Parcel.readValue(Parcel.java:2722)
at android.os.Parcel.readArrayMapInternal(Parcel.java:3045)
at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:288)
at android.os.BaseBundle.unparcel(BaseBundle.java:232)
at android.os.BaseBundle.getLong(BaseBundle.java:1073)
at android.content.Intent.getLongExtra(Intent.java:7423)
at REDACTED.MyBroadcastReceiver.onReceive(MyBroadcastReceiver.kt:27)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3412)
at android.app.ActivityThread.access$1300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1684)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Expected results:
I expect to get a Long for the associated download id.
| Reporter | ||
Comment 1•2 years ago
|
||
This is the class my download receiver is trying to find:
https://github.com/mozilla-mobile/android-components/blob/main/components/browser/state/src/main/java/mozilla/components/browser/state/state/content/DownloadState.kt#L62
Comment 2•2 years ago
|
||
Moving this to Fenix > General component to allow our engineers to examine it more closely. If this is not the right component, please move it to a more appropriate one. Thanks!
Component: Untriaged → General
Product: Firefox → Fenix
Updated•2 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1847141
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•