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

Camera Only - Permission Denial: with revoked permission android.permission.CAMERA #432

Open
mikemike396 opened this issue Nov 27, 2022 · 0 comments

Comments

@mikemike396
Copy link

Expected Behavior

Camera only intent should prompt for camera permission.

Actual Behavior

Application crashes

Steps to Reproduce the Problem

  1. Setup camera only Intent
  2. StartActivityForResult
CameraOnlyConfig config = new CameraOnlyConfig();
Intent intent = ImagePickerLauncherKt.createImagePickerIntent(this, config);
startActivityForResult(intent, ANDROID_IMAGE_PICKER_ACTIVITY_REQUEST_CODE);

Specifications

  • Image Picker Version: 3.0.0
  • Android OS: 30 & 31
  • Phone: Nexus 6
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: myapp, PID: 2266
    java.lang.RuntimeException: Unable to start activity ComponentInfo{myapp/com.esafirm.imagepicker.features.ImagePickerActivity}: java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.android.camera2/com.android.camera.CaptureActivity clip={text/uri-list {...}} (has extras) } from ProcessRecord{9198c53 2266: myapp/u0a182} (pid=2266, uid=10182) with revoked permission android.permission.CAMERA
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.android.camera2/com.android.camera.CaptureActivity clip={text/uri-list {...}} (has extras) } from ProcessRecord{9198c53 2266: myapp/u0a182} (pid=2266, uid=10182) with revoked permission android.permission.CAMERA
        at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
        at android.os.Parcel.createException(Parcel.java:2357)
        at android.os.Parcel.readException(Parcel.java:2340)
        at android.os.Parcel.readException(Parcel.java:2282)
        at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:3696)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1723)
        at android.app.Activity.startActivityForResult(Activity.java:5314)
        at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:574)
        at androidx.core.app.ActivityCompat.startActivityForResult(ActivityCompat.java:239)
        at androidx.activity.ComponentActivity$2.onLaunch(ComponentActivity.java:208)
        at androidx.activity.result.ActivityResultRegistry$2.launch(ActivityResultRegistry.java:166)
        at androidx.activity.result.ActivityResultLauncher.launch(ActivityResultLauncher.java:47)
        at com.esafirm.imagepicker.features.ImagePickerActivity.onCreate(ImagePickerActivity.kt:75)
        at android.app.Activity.performCreate(Activity.java:7994)
        at android.app.Activity.performCreate(Activity.java:7978)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:223) 
        at android.app.ActivityThread.main(ActivityThread.java:7656) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
     Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1032)
        at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:999)
        at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:669)
        at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1100)
        at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1072)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant