Hi All,
I've published my little application Camera Unlock on the playstore and I get a crash on a Sony Xperia device. From what I understand, it seems that "iskeyguardLocked" is the root cause
the piece of code in which the keyguard status is checked is this one :
Is there another way to check if the device is locked or not ?
Any help welcome ...
Thanks
Alain
the crash log :
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.SCREEN_OFF flg=0x40000000 } in anywheresoftware.b4a.phone.PhoneEvents$16@40582880
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:722)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:138)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: isKeyguardLocked
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at anywheresoftware.b4a.phone.PhoneEvents$ActionHandler.send(PhoneEvents.java:326)
at anywheresoftware.b4a.phone.PhoneEvents$6.handle(PhoneEvents.java:140)
at anywheresoftware.b4a.phone.PhoneEvents$16.onReceive(PhoneEvents.java:268)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:709)
... 9 more
Caused by: java.lang.NoSuchMethodException: isKeyguardLocked
at java.lang.ClassCache.findMethodByName(ClassCache.java:247)
at java.lang.Class.getDeclaredMethod(Class.java:731)
at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:214)
at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod(Reflection.java:802)
at com.aeropic.CameraUnlockFree.unlock._vvvvvvvvvv7(unlock.java:104)
at com.aeropic.CameraUnlockFree.unlock._pe_screenoff(unlock.java:111)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
... 14 more
I've published my little application Camera Unlock on the playstore and I get a crash on a Sony Xperia device. From what I understand, it seems that "iskeyguardLocked" is the root cause
the piece of code in which the keyguard status is checked is this one :
B4X:
Sub CheckLock As Boolean ' permet de tester l'etat locked ou non du téléphone
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String")
Return r.RunMethod("isKeyguardLocked")
End Sub
Is there another way to check if the device is locked or not ?
Any help welcome ...
Thanks
Alain
the crash log :
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.SCREEN_OFF flg=0x40000000 } in anywheresoftware.b4a.phone.PhoneEvents$16@40582880
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:722)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:138)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: isKeyguardLocked
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at anywheresoftware.b4a.phone.PhoneEvents$ActionHandler.send(PhoneEvents.java:326)
at anywheresoftware.b4a.phone.PhoneEvents$6.handle(PhoneEvents.java:140)
at anywheresoftware.b4a.phone.PhoneEvents$16.onReceive(PhoneEvents.java:268)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:709)
... 9 more
Caused by: java.lang.NoSuchMethodException: isKeyguardLocked
at java.lang.ClassCache.findMethodByName(ClassCache.java:247)
at java.lang.Class.getDeclaredMethod(Class.java:731)
at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:214)
at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod(Reflection.java:802)
at com.aeropic.CameraUnlockFree.unlock._vvvvvvvvvv7(unlock.java:104)
at com.aeropic.CameraUnlockFree.unlock._pe_screenoff(unlock.java:111)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
... 14 more