I am integrating turn by turn navigation provided by Here Maps. It works perfectly on Android 5 or less. It breaks in Android 6 and above. It throws following error. I can't understand why Camera is used for navigation. I have added all runtime permission checks.
E/art: JNI DETECTED ERROR IN APPLICATION: JNI CallVoidMethodV called with
pending exception java.lang.SecurityException: Lacking privileges to access camera service
E/art: at void android.hardware.camera2.utils.CameraBinderDecorator.throwOnError(int) (CameraBinderDecorator.java:108)
E/art: at android.hardware.camera2.legacy.CameraDeviceUserShim android.hardware.camera2.legacy.CameraDeviceUserShim.connectBinderShim(android.hardware.camera2.ICameraDeviceCallbacks, int) (CameraDeviceUserShim.java:336)
E/art: at android.hardware.camera2.CameraDevice android.hardware.camera2.CameraManager.openCameraDeviceUserAsync(java.lang.String, android.hardware.camera2.CameraDevice$StateCallback, android.os.Handler) (CameraManager.java:330)
E/art: at void android.hardware.camera2.CameraManager.openCamera(java.lang.String, android.hardware.camera2.CameraDevice$StateCallback, android.os.Handler) (CameraManager.java:460)
E/art: at boolean com.nokia.maps.b.a() (ARCameraImpl.java:184)
E/art: at boolean com.nokia.maps.a.r() (ARCamera.java:543)
E/art: at void com.nokia.maps.a.p() (ARCamera.java:508)
E/art: at void com.nokia.maps.a.a(boolean) (ARCamera.java:228)
E/art: at void com.nokia.maps.ARLayoutControl.onRequestToStartCamera(boolean) (ARLayoutControl.java:619)
E/art: at boolean com.nokia.maps.ARLayoutControl.startLivesight() (ARLayoutControl.java:-2)
E/art: at com.here.android.mpa.ar.ARController$Error com.nokia.maps.d.a() (ARControllerImpl.java:332)
E/art: at com.here.android.mpa.ar.ARController$Error com.here.android.mpa.ar.ARController.start() (ARController.java:2919)
E/art: at void com.mbrdi.anita.cabpool.screen.TravelGroupPickupDrop.startLiveSight(android.view.View) (TravelGroupPickupDrop.java:832)
E/art: at void com.mbrdi.anita.cabpool.screen.TravelGroupPickupDrop$4.onClick(android.view.View) (TravelGroupPickupDrop.java:335)
E/art: at boolean android.view.View.performClick() (View.java:5277)
E/art: at void android.view.View$PerformClick.run() (View.java:21711)
E/art: at void android.os.Handler.handleCallback(android.os.Message) (Handler.java:815)
E/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:104)
E/art: at void android.os.Looper.loop() (Looper.java:207)
E/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:5896)
E/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
E/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:789)
E/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:679)
E/art: in call to CallVoidMethodV
E/art: from boolean com.nokia.maps.ARLayoutControl.startLivesight()
E/art: "main" prio=5 tid=1 Runnable
E/art: | group="main" sCount=0 dsCount=0 obj=0x74bc3868 self=0xf3e37a00
E/art: | sysTid=27152 nice=-6 cgrp=default sched=0/0 handle=0xf7590de4
E/art: | state=R schedstat=( 8532467750 683951359 18337 ) utm=643 stm=210 core=2 HZ=100
E/art: | stack=0xff16c000-0xff16e000 stackSize=8MB
E/art: | held mutexes= "mutator lock"(shared held)
Help me out.
From your callstack it looks like you application started AR.
E/art: at void com.nokia.maps.ARLayoutControl.onRequestToStartCamera(boolean) (ARLayoutControl.java:619) E/art: at boolean com.nokia.maps.ARLayoutControl.startLivesight() (ARLayoutControl.java:-2) E/art: at com.here.android.mpa.ar.ARController$Error com.nokia.maps.d.a() (ARControllerImpl.java:332) E/art: at com.here.android.mpa.ar.ARController$Error com.here.android.mpa.ar.ARController.start() (ARController.java:2919) E/art: at void com.mbrdi.anita.cabpool.screen.TravelGroupPickupDrop.startLiveSight(android.view.View) (TravelGroupPickupDrop.java:832) E/art: at void com.mbrdi.anita.cabpool.screen.TravelGroupPickupDrop$4.onClick(android.view.View) (TravelGroupPickupDrop.java:335) E/art: at boolean android.view.View.performClick() (View.java:5277)
Perhaps just a red herring? of something else?