collect icon indicating copy to clipboard operation
collect copied to clipboard

Using a different camera app to record a video in video widget which is on a field-list crashes the app on Android 10 Redmi 9T

Open dbemke opened this issue 1 year ago • 5 comments

ODK Collect version

the store version 2023.3.1 , 2024.1.0 beta 2

Android version

10

Device used

Redmi 9T

Problem description

Using a different camera app to record a video in video widget which is on a field-list crashes the app on Android 10 Redmi 9T. The issue occurred on Android 10 ( but not Android 14 cause the bottom sheet to choose camera doesn't appear on that device).

Steps to reproduce the problem

  1. Install int the device Open Camera app.
  2. Go to the form. OnePageForm.xml.txt
  3. Go to the video widget.
  4. When the bottom sheet opens choose Open Camera.
  5. Start recording and try to save the video.

Logs of the crash:

2024-02-05 10:58:00.328 19591-21780 DatabaseUtils android.process.media E Writing exception to parcel java.lang.SecurityException: org.odk.collect.android has no access to content://media/external_primary/video/media/41863 at com.android.providers.media.MediaProvider.enforceCallingPermissionInternal(MediaProvider.java:5915) at com.android.providers.media.MediaProvider.enforceCallingPermission(MediaProvider.java:5838) at com.android.providers.media.MediaProvider.checkAccess(MediaProvider.java:5935) at com.android.providers.media.MediaProvider.openFileAndEnforcePathPermissionsHelper(MediaProvider.java:5565) at com.android.providers.media.MediaProvider.openFileCommon(MediaProvider.java:5375) at com.android.providers.media.MediaProvider.openTypedAssetFileCommon(MediaProvider.java:5407) at com.android.providers.media.MediaProvider.openTypedAssetFile(MediaProvider.java:5387) at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:516) at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:307) at android.os.Binder.execTransactInternal(Binder.java:1024) at android.os.Binder.execTransact(Binder.java:997) 2024-02-05 10:58:00.332 21020-21579 AndroidRuntime org.odk.collect.android E FATAL EXCEPTION: AsyncTask #2 Process: org.odk.collect.android, PID: 21020 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$4.done(AsyncTask.java:399) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383) at java.util.concurrent.FutureTask.setException(FutureTask.java:252) at java.util.concurrent.FutureTask.run(FutureTask.java:271) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) Caused by: java.lang.SecurityException: org.odk.collect.android has no access to content://media/external_primary/video/media/41863 at android.os.Parcel.createException(Parcel.java:2074) at android.os.Parcel.readException(Parcel.java:2042) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188) at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:151) at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:705) at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1702) at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1518) at android.content.ContentResolver.openInputStream(ContentResolver.java:1202) at org.odk.collect.android.utilities.FileUtils.saveAnswerFileFromUri(Unknown Source:4) at org.odk.collect.android.tasks.MediaLoadingTask.doInBackground(SourceFile:0) at org.odk.collect.android.tasks.MediaLoadingTask.doInBackground(SourceFile:0) at android.os.AsyncTask$3.call(AsyncTask.java:378) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919)

dbemke avatar Feb 14 '24 13:02 dbemke