Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leftover File on Certain Camera App Caused by Unable to Remove the File -- SecurityException #377

Open
wilinz opened this issue Aug 7, 2021 · 1 comment

Comments

@wilinz
Copy link

wilinz commented Aug 7, 2021

Steps to Reproduce the Problem

After entering the camera, I did not take a picture and exited. At this time, it saved a gray picture, which is not what I need.

Specifications

  • Image Picker Version: 3.0.0-beta1
  • Android OS: Android
  • Phone: pixel 3 api 29
@esafirm esafirm closed this as completed Nov 20, 2022
@esafirm esafirm reopened this Nov 20, 2022
@esafirm esafirm added the bug label Nov 20, 2022
@esafirm
Copy link
Owner

esafirm commented Nov 20, 2022

This should handled by CameraModule.removeImage in here but in newer OS it got a SecurityException

19:15:17.859  E  Writing exception to parcel
                 java.lang.SecurityException: com.esafirm.imagepicker.sample has no access to content://media/external_primary/images/media/1000000043
                 	at com.android.providers.media.MediaProvider.enforceCallingPermissionInternal(MediaProvider.java:10043)
                 	at com.android.providers.media.MediaProvider.enforceCallingPermission(MediaProvider.java:9940)
                 	at com.android.providers.media.MediaProvider.deleteInternal(MediaProvider.java:5941)
                 	at com.android.providers.media.MediaProvider.delete(MediaProvider.java:5830)
                 	at android.content.ContentProvider$Transport.delete(ContentProvider.java:443)
                 	at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:215)
                 	at android.os.Binder.execTransactInternal(Binder.java:1280)
                 	at android.os.Binder.execTransact(Binder.java:1244)
19:15:17.863  E  Can't delete cancelled uri
19:15:17.863  W  java.lang.SecurityException: com.esafirm.imagepicker.sample has no access to content://media/external_primary/images/media/1000000043
19:15:17.863  W  	at android.os.Parcel.createExceptionOrNull(Parcel.java:3011)
19:15:17.863  W  	at android.os.Parcel.createException(Parcel.java:2995)
19:15:17.863  W  	at android.os.Parcel.readException(Parcel.java:2978)
19:15:17.863  W  	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
19:15:17.863  W  	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
19:15:17.863  W  	at android.content.ContentProviderProxy.delete(ContentProviderNative.java:629)
19:15:17.863  W  	at android.content.ContentResolver.delete(ContentResolver.java:2333)
19:15:17.863  W  	at android.content.ContentResolver.delete(ContentResolver.java:2299)
19:15:17.863  W  	at com.esafirm.imagepicker.features.camera.DefaultCameraModule.removeImage(DefaultCameraModule.kt:137)
19:15:17.863  W  	at com.esafirm.imagepicker.features.ImagePickerActivity.onActivityResult(ImagePickerActivity.kt:154)
19:15:17.863  W  	at android.app.Activity.dispatchActivityResult(Activity.java:8628)
19:15:17.863  W  	at android.app.ActivityThread.deliverResults(ActivityThread.java:5316)
19:15:17.863  W  	at android.app.ActivityThread.handleSendResult(ActivityThread.java:5362)
19:15:17.863  W  	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
19:15:17.863  W  	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
19:15:17.863  W  	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
19:15:17.863  W  	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
19:15:17.863  W  	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
19:15:17.863  W  	at android.os.Handler.dispatchMessage(Handler.java:106)
19:15:17.863  W  	at android.os.Looper.loopOnce(Looper.java:201)
19:15:17.863  W  	at android.os.Looper.loop(Looper.java:288)
19:15:17.863  W  	at android.app.ActivityThread.main(ActivityThread.java:7872)
19:15:17.863  W  	at java.lang.reflect.Method.invoke(Native Method)
19:15:17.863  W  	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
19:15:17.863  W  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

@esafirm esafirm changed the title Bug Leftover File on Certain Camera App Caused by Unable to Remove the File -- SecurityException Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants