diff --git a/assets/android.lua b/assets/android.lua index 5370b37a7..7bbec8b69 100644 --- a/assets/android.lua +++ b/assets/android.lua @@ -1047,7 +1047,7 @@ function JNI:callBooleanMethod(object, method, signature, ...) local clazz = self.env[0].GetObjectClass(self.env, object) local methodID = self.env[0].GetMethodID(self.env, clazz, method, signature) self.env[0].DeleteLocalRef(self.env, clazz) - return self.env[0].callBooleanMethod(self.env, object, methodID, ...) + return self.env[0].CallBooleanMethod(self.env, object, methodID, ...) end function JNI:callStaticBooleanMethod(class, method, signature, ...) @@ -1363,10 +1363,10 @@ local function run(android_app_state) local fullscreen = JNI:callIntMethod( android.app.activity.clazz, "isFullscreen", - "()Z" + "()I" ) android.LOGI("is fullscreen =", fullscreen) - return fullscreen + return fullscreen == 1 end) end android.setFullscreen = function(fullscreen) @@ -1398,10 +1398,10 @@ local function run(android_app_state) local isWifiEnabled = JNI:callIntMethod( android.app.activity.clazz, "isWifiEnabled", - "()Z" + "()I" ) android.LOGI("is WifiEnabled =", isWifiEnabled) - return isWifiEnabled + return isWifiEnabled == 1 end) end diff --git a/src/org/koreader/launcher/MainActivity.java b/src/org/koreader/launcher/MainActivity.java index 9620568b0..adb37d2da 100644 --- a/src/org/koreader/launcher/MainActivity.java +++ b/src/org/koreader/launcher/MainActivity.java @@ -158,8 +158,8 @@ public void run() { }); } - public boolean isFullscreen() { - return (getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0; + public int isFullscreen() { + return ((getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0) ? 1: 0; } @@ -167,8 +167,8 @@ public void setWifiEnabled(final boolean enabled) { this.getWifiManager().setWifiEnabled(enabled); } - public boolean isWifiEnabled() { - return this.getWifiManager().isWifiEnabled(); + public int isWifiEnabled() { + return this.getWifiManager().isWifiEnabled() ? 1 : 0; } private WifiManager getWifiManager() {