[Android Q&A, Help & Troubleshooting] Amromnia913:
So i have a simple but frustrating when i try to open camera app it says can't connect to camera now i know the exact cause of this but don't know how to fix it

the cause is i installed a zip file which was supposed to have the xperia z2 camera app and some different apps from a tutorial on matrudev i cant post the link cause i'm a new user

i have tried uninstalling every package this edited / reinstalling the zip / rebooting the phone multiple times / clearing cache and dalvik / installing different camera apps / installing camera fix magisk modules and none of these work

the phone's model is : Lenovo a6000

Android security patch level : September 5, 2017

baseband version : MPSS.DPM.1.0.1.C1.00093

Kernel version : 3.10.107-Oreo+ dev-harsh1998@HYPER #1 Mon Oct 18:45:59 IST 2017

Build Number : aosp_6000-userdebug 8.0.0 OPR6. 170623.021 17e6583dde

SELinux status :Permissive

Its System-lessly Rooted Using Magisk

I have TWRP Installed

here is a logcat

[ 10-03 21:25:40.044 14651:14697 E/CAM_CameraDataAdapter ]
Error loading data:/storage/4AC7-1C03/DCIM/Camera/VID_20180919_143234.mp4

[ 10-03 21:25:40.066 14651:14701 W/Adreno-EGL ]
<qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE

[ 10-03 21:25:40.142 214: 214 W//system/bin/hwservicemanager ]
getTransportFromManifest: Cannot find entry android.hardware.graphics.mapper@2.0::IMapper in either framework or device manifest, using default transport.

[ 10-03 21:25:40.244 4243: 4291 I/ActivityManager ]
Displayed org.cyanogenmod.snap/com.android.camera.CameraLauncher: +1s732ms

[ 10-03 21:25:40.313 311: 311 I/surfaceflinger ]
type=1400 audit(0.0:1112): avc: denied { read write } for path="/dev/kgsl-3d0" dev="tmpfs" ino=7433 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1

[ 10-03 21:25:40.542 11691:14721 I/vfp ]
Launching job OfflineSearchIndexingJob

[ 10-03 21:25:40.542 11691:14721 I/vfc ]
Starting Job(OfflineSearchIndexingJob#1.35) (priority=0)

[ 10-03 21:25:40.547 11691:14722 I/vsr ]
Job(OfflineSearchIndexingJob#1.35) Started new READ_ONLY transaction readtx68 [readDatabaseResultsToIndex]

[ 10-03 21:25:40.554 11691:11809 I/vsr ]
Closing transaction readtx68 [readDatabaseResultsToIndex]: Stats[1 Reads (rows: 1)]

[ 10-03 21:25:40.555 11691:14722 I/mjn ]
Job(OfflineSearchIndexingJob#1.35) Already caught up to the current max write_sequence_id

[ 10-03 21:25:40.556 11691:14722 I/mjn ]
Job(OfflineSearchIndexingJob#1.35) Scheduling next offline search indexing in 60000 ms

[ 10-03 21:25:40.557 11691:14722 I/vfc ]
Job(OfflineSearchIndexingJob#1.35) Finished Job(OfflineSearchIndexingJob#1.35) (14 ms)

[ 10-03 21:25:41.592 320: 1121 D/audio_hw_primary ]
out_standby: enter: stream (0xb0a45980) usecase(1: low-latency-playback)

[ 10-03 21:25:41.764 320: 1121 D/audio_hw_primary ]
disable_audio_route: reset and update mixer path: low-latency-playback

[ 10-03 21:25:41.765 320: 1121 D/hardware_info ]
hw_info_append_hw_type : device_name = speaker

[ 10-03 21:25:41.765 320: 1121 D/audio_hw_primary ]
disable_snd_device: snd_device(2: speaker)

[ 10-03 21:25:41.769 4243: 8864 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.releaseWakeLock(PowerManagerService.java:4159)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:94)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:43.536 5798: 5798 I/HwDetectorWithState ]
#performNextHotwordAction action: 0

[ 10-03 21:25:43.537 320: 320 D/audio_hw_primary ]
adev_open_input_stream: enter: sample_rate(16000) channel_mask(0x10) devices(0x80000004) stream_handle(0xb0a30ac0) io_handle(1190)

[ 10-03 21:25:43.539 320:14729 I/AudioFlinger ]
AudioFlinger's thread 0xaee031c0 tid=14729 ready to run

[ 10-03 21:25:43.539 320:14729 D/audio_hw_primary ]
in_standby: enter: stream (0xb0a30ac0) usecase(7: audio-record)

[ 10-03 21:25:43.540 320:14729 D/audio_hw_primary ]
in_standby: enter: stream (0xb0a30ac0) usecase(7: audio-record)

[ 10-03 21:25:43.540 4243: 8865 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.acquireWakeLock(PowerManagerService.java:4131)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:66)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:43.541 4243: 8865 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.updateWakeLockWorkSource(PowerManagerService.java:4190)
at com.android.server.power.PowerManagerService$BinderService.updateWakeLockUids(PowerManagerService.java:4181)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:105)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:43.541 320: 6580 E/ ]
Request denied by app op OP_RECORD_AUDIO

[ 10-03 21:25:43.541 320: 6580 E/AudioFlinger ]
openRecord() permission denied: recording not allowed

[ 10-03 21:25:43.541 5798: 5798 E/AudioRecord ]
AudioFlinger could not create record track, status: -1

[ 10-03 21:25:43.541 4243: 8865 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.releaseWakeLock(PowerManagerService.java:4159)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:94)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:43.544 4243: 8228 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.acquireWakeLock(PowerManagerService.java:4131)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:66)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:43.544 4243: 8228 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.updateWakeLockWorkSource(PowerManagerService.java:4190)
at com.android.server.power.PowerManagerService$BinderService.updateWakeLockUids(PowerManagerService.java:4181)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:105)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:43.545 320: 510 D/audio_hw_primary ]
adev_close_input_stream: enter:stream_handle(0xb0a30ac0)

[ 10-03 21:25:43.545 4243: 8228 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.releaseWakeLock(PowerManagerService.java:4159)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:94)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:43.545 320: 510 D/audio_hw_primary ]
in_standby: enter: stream (0xb0a30ac0) usecase(7: audio-record)

[ 10-03 21:25:43.545 5798: 5798 E/AudioRecord-JNI ]
Error creating AudioRecord instance: initialization check failed with status -1.

[ 10-03 21:25:43.545 5798: 5798 E/android.media.AudioRecord ]
Error code -20 when initializing native AudioRecord object.

[ 10-03 21:25:43.545 5798: 5798 E/AudioProvider ]
Failed to initialize AudioRecord

[ 10-03 21:25:43.546 5798: 5798 E/AudioProvider ]
Unable to create audio record

[ 10-03 21:25:43.546 5798: 5798 E/HotwordDetector ]
Unable to create parcel file descriptor

[ 10-03 21:25:43.622 320: 1121 D/audio_hw_primary ]
out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2

[ 10-03 21:25:43.623 4243: 8883 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.acquireWakeLock(PowerManagerService.java:4131)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:66)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:43.624 320: 5994 D/audio_hw_primary ]
start_output_stream: enter: stream(0xb0a45980)usecase(1: low-latency-playback) devices(0x2)

[ 10-03 21:25:43.624 320: 5994 D/audio_hw_primary ]
select_devices: out_snd_device(2: speaker) in_snd_device(0: )

[ 10-03 21:25:43.624 320: 5994 W/msm8916_platform ]
Codec backend bitwidth 16, samplerate 48000

[ 10-03 21:25:43.625 320: 5994 D/hardware_info ]
hw_info_append_hw_type : device_name = speaker

[ 10-03 21:25:43.625 320: 5994 D/audio_hw_primary ]
enable_snd_device: snd_device(2: speaker)

[ 10-03 21:25:43.627 4243: 8883 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.updateWakeLockWorkSource(PowerManagerService.java:4190)
at com.android.server.power.PowerManagerService$BinderService.updateWakeLockUids(PowerManagerService.java:4181)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:105)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:43.628 4243: 8883 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.updateWakeLockWorkSource(PowerManagerService.java:4190)
at com.android.server.power.PowerManagerService$BinderService.updateWakeLockUids(PowerManagerService.java:4181)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:105)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:43.632 320: 5994 W/audio_hw_utils ]
audio_extn_utils_update_stream_app_type_cfg: App type could not be selected. Falling back to default

[ 10-03 21:25:43.632 320: 5994 I/audio_hw_primary ]
select_devices Selected apptype: 69936

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> send_audio_cal, acdb_id = 15, path = 0

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> send_asm_topology

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TOPOLOGY_ID

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> send_adm_topology

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> send_audtable

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TABLE_SIZE

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TABLE

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> AUDIO_SET_AUDPROC_CAL

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> send_audvoltable

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> ACDB_CMD_GET_AUDPROC_GAIN_DEP_STEP_TABLE

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> AUDIO_SET_AUDPROC_VOL_CAL

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> send_afe_cal

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> ACDB_CMD_GET_AFE_COMMON_TABLE

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> AUDIO_SET_AFE_CAL

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> send_hw_delay : acdb_id = 15 path = 0

[ 10-03 21:25:43.632 320: 5994 D/ACDB-LOADER ]
ACDB -> ACDB_AVSYNC_INFO: ACDB_CMD_GET_DEVICE_PROPERTY

[ 10-03 21:25:43.633 320: 5994 I/audio_hw_utils ]
audio_extn_utils_send_app_type_cfg: PLAYBACK app_type 69936, acdb_dev_id 15, sample_rate 48000

[ 10-03 21:25:43.633 320: 5994 D/audio_hw_primary ]
enable_audio_route: apply mixer and update path: low-latency-playback

[ 10-03 21:25:43.633 320: 5994 D/audio_hw_primary ]
select_devices: done

[ 10-03 21:25:43.675 320: 5994 D/msm8916_platform ]
platform_set_channel_map mixer_ctl_name:Playback Channel Map12

[ 10-03 21:25:43.675 320: 5994 D/msm8916_platform ]
platform_set_channel_map: set mapping(1 2 3 0 0 0 0 0) for channel:2

[ 10-03 21:25:43.675 320: 5994 D/audio_hw_primary ]
start_output_stream: exit

[ 10-03 21:25:43.675 320: 1120 E/FastThread ]
did not receive expected priority boost on time

[ 10-03 21:25:43.679 320: 5994 W/StreamHAL ]
Error from HAL stream in function get_presentation_position: Operation not permitted

[ 10-03 21:25:43.679 320: 5994 W/StreamHAL ]
Error from HAL stream in function get_presentation_position: Operation not permitted

[ 10-03 21:25:43.700 4243: 8879 D/Sensors ]
batch called handle:3 sample_ns:200000000 latency_ns:0

[ 10-03 21:25:43.700 4243: 8879 D/Sensors ]
kxtj9-accel calling driver setDelay 200 ms

[ 10-03 21:25:43.703 14651:14651 V/CAM_UI ]
surfaceDestroyed

[ 10-03 21:25:43.703 311: 5087 E/SurfaceFlinger ]
Failed to find layer (SurfaceView - org.cyanogenmod.snap/com.android.camera.CameraLauncher#0) in layer parent (no-parent).

[ 10-03 21:25:43.704 311: 466 E/SurfaceFlinger ]
Failed to find layer (Background for - SurfaceView - org.cyanogenmod.snap/com.android.camera.CameraLauncher#0) in layer parent (no-parent).

[ 10-03 21:25:43.704 4243: 4324 I/Sensors ]
kxtj9-accel: activate: 0

[ 10-03 21:25:43.704 4243: 4324 D/Sensors ]
activate called handle:3 enable:0

[ 10-03 21:25:43.704 4243: 4324 D/Sensors ]
kxtj9-accel calling driver disable

[ 10-03 21:25:43.706 14651:14651 D/CAM_PhotoModule ]
remove idle handleer in onPause

[ 10-03 21:25:43.707 14651:14651 V/CAM_PhotoModule ]
On pause.

[ 10-03 21:25:43.710 14651:14651 D/LocationManager ]
stopReceivingLocationUpdates

[ 10-03 21:25:43.710 14651:14651 V/CAM_PhotoModule ]
Close camera device.

[ 10-03 21:25:43.799 5853: 5999 W/Adreno-EGL ]
<qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE

[ 10-03 21:25:43.860 4243: 8860 W/Binder ]
Binder call failed.
java.lang.SecurityException: Neither user 1041 nor current process has android.permission.WAKE_LOCK.
at android.app.ContextImpl.enforce(ContextImpl.java:1735)
at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1767)
at com.android.server.power.PowerManagerService$BinderService.updateWakeLockWorkSource(PowerManagerService.java:4190)
at com.android.server.power.PowerManagerService$BinderService.updateWakeLockUids(PowerManagerService.java:4181)
at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:105)
at android.os.Binder.execTransact(Binder.java:674)

[ 10-03 21:25:44.136 4243: 4283 I/ActivityManager ]
Killing 11521:com.whatsapp/u0a95 (adj 904): empty #17

[ 10-03 21:25:44.139 4243: 4283 I/ActivityManager ]
Killing 11034:com.android.chrome/u0a85 (adj 906): empty #18

[ 10-03 21:25:44.176 14651:14651 E/WindowManager ]

android.view.WindowLeaked: Activity com.android.camera.CameraActivity has leaked window DecorView@3133d66[] that was originally added here
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:485)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:346)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:92)
at android.app.Dialog.show(Dialog.java:330)
at android.app.AlertDialog$Builder.show(AlertDialog.java:1114)
at com.android.camera.util.CameraUtil.showErrorAndFinish(CameraUtil.java:456)
at com.android.camera.CameraActivity.showOpenCameraErrorDialog(CameraActivity.java:2440)
at com.android.camera.CameraActivity.access$300(CameraActivity.java:127)
at com.android.camera.CameraActivity$2.onDeviceOpenFailure(CameraActivity.java:324)
at com.android.camera.AndroidCameraManagerImpl$CameraOpenErrorCallbackForward$2.run(AndroidCameraManagerImpl.java:1018)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

[ 10-03 21:25:44.225 311: 311 D/SurfaceFlinger ]
Backpressure trigger, skipping transaction & refresh!

[ 10-03 21:25:44.343 4991: 4991 I/RenderThread ]
type=1400 audit(0.0:1114): avc: denied { read write } for path="/dev/kgsl-3d0" dev="tmpfs" ino=7433 scontext=u:r:system_server:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1

[ 10-03 21:25:44.354 4243: 4991 I/OpenGLRenderer ]
Initialized EGL, version 1.4

[ 10-03 21:25:44.354 4243: 4991 D/OpenGLRenderer ]
Swap behavior 1

i couldn't post the whole thing because of limitations