HUAWEI "android.media.action.STILL_IMAGE_CAMERA_SECURE" intent Permission Denial

1

I'm getting the following error in Firebase from HUAWEI devices:

Fatal Exception: java.lang.SecurityException
Permission Denial: starting Intent { 
act=android.media.action.STILL_IMAGE_CAMERA_SECURE flg=0x10000000 
cmp=com.huawei.camera/.controller.SecureCameraActivity 
}
from ProcessRecord{d677674 11018} (pid=11018, uid=10125) 
requires com.huawei.camera.permission.PRIVATE

I added this permission to the manifest file but still no luck i'm trying to open the camera with "android.media.action.STILL_IMAGE_CAMERA_SECURE" intent.

any info on this problem with huawei devices?

the code i'm using

    intentAboveM = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE);
                    intentAboveM.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
                    if(intentAboveM.resolveActivity(getPackageManager()) !=null) {
                        this.startActivity(intentAboveM);
                    }
android-camera
android-permissions
android-camera2
huawei-mobile-services
huawei-developers
asked on Stack Overflow Nov 8, 2020 by Mohammed Said • edited Jan 1, 2021 by piotrek1543

2 Answers

1

This message indicates that you need to obtain the security camera permission.

android.media.action.STILL_IMAGE_CAMERA_SECURE does not require permissions. You may have invoked other components. For security reasons, this component needs to obtain permissions: pic1 pic2

answered on Stack Overflow Nov 9, 2020 by shirley
0

You got this "Fatal Exception: java.lang.SecurityException" for "android.media.action.STILL_IMAGE_CAMERA_SECURE" intent, is because: the permission you asked for is EMUI level of camera permission, which is not opened to 3rd party users on Huawei platforms. There is no way for your App. to be granted with this permission on Huawei phones. However if you would like to post your detailed use case in this thread, we might be able to find some alternative solutions for you.

answered on Stack Overflow Nov 26, 2020 by Zinna

User contributions licensed under CC BY-SA 3.0