Skip to content

Bug: App crash on permission denial when I tried to select image #4

@darewealth

Description

@darewealth

Describe the bug.

When I launched the app, I tried to select a photo to atomize, I selected a picture and I got a pop up that I should grant permission, I clicked on deny, and the app crashed, and I think that is weird.

Steps to reproduce.

  • Launch the app

  • Click on agree

  • Click on select a photo

  • Choose the photo you want, and deny permission when asked.

Expected Behaviour

I expect the app not to crash even as I deny permission. It should just go back that I can't select an image because I did not grant permission.

Screen recording

https://youtu.be/HzpnxF6rwjI

Devices and Versions)

  • Device: [itel]

  • Version [6.1]

  • App version [1.0]

Log

05-05 07:18:00.695  3360  3360 E AndroidRuntime: Process: com.wrmndfzzy.atomize, PID: 3360
05-05 07:18:00.695  3360  3360 E AndroidRuntime: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:3954 flg=0x1 }} to activity {com.wrmndfzzy.atomize/com.wrmndfzzy.atomize.MainActivity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=3360, uid=10208 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.app.ActivityThread.deliverResults(ActivityThread.java:3714)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:3757)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.app.ActivityThread.-wrap16(ActivityThread.java)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:148)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:5452)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:671)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=3360, uid=10208 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1599)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:235)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:176)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.content.ContentResolver.query(ContentResolver.java:491)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.content.ContentResolver.query(ContentResolver.java:434)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at com.wrmndfzzy.atomize.MainActivity.a(Unknown Source)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at com.wrmndfzzy.atomize.MainActivity.a(Unknown Source)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at com.wrmndfzzy.atomize.MainActivity.onActivityResult(Unknown Source)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.app.Activity.dispatchActivityResult(Activity.java:6510)
05-05 07:18:00.695  3360  3360 E AndroidRuntime: 	at android.app.ActivityThread.deliverResults(ActivityThread.java:3710)```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions