diff --git a/Makefile b/Makefile index 38f28736b..75064202d 100644 --- a/Makefile +++ b/Makefile @@ -292,6 +292,8 @@ utupdate: all androidupdate: all mkdir -p $(ANDROID_LAUNCHER_DIR)/assets/module -rm $(ANDROID_LAUNCHER_DIR)/assets/module/koreader-* + # in runtime luajit-launcher's libluajit.so will be loaded + -rm $(INSTALL_DIR)/koreader/libs/libluajit.so # create zip package cd $(INSTALL_DIR)/koreader && \ zip -9 -r \ diff --git a/frontend/device/android/device.lua b/frontend/device/android/device.lua index a90bcff2c..9e1bd570c 100644 --- a/frontend/device/android/device.lua +++ b/frontend/device/android/device.lua @@ -13,7 +13,7 @@ local Device = Generic:new{ isAndroid = yes, hasFrontlight = yes, firmware_rev = "none", - display_dpi = ffi.C.AConfiguration_getDensity(android.app.config), + display_dpi = android.lib.AConfiguration_getDensity(android.app.config), } function Device:init() @@ -35,13 +35,13 @@ function Device:init() } -- check if we have a keyboard - if ffi.C.AConfiguration_getKeyboard(android.app.config) + if android.lib.AConfiguration_getKeyboard(android.app.config) == ffi.C.ACONFIGURATION_KEYBOARD_QWERTY then self.hasKeyboard = yes end -- check if we have a touchscreen - if ffi.C.AConfiguration_getTouchscreen(android.app.config) + if android.lib.AConfiguration_getTouchscreen(android.app.config) ~= ffi.C.ACONFIGURATION_TOUCHSCREEN_NOTOUCH then self.isTouchDevice = yes diff --git a/frontend/device/android/powerd.lua b/frontend/device/android/powerd.lua index cc26ecd27..fa5267bf5 100644 --- a/frontend/device/android/powerd.lua +++ b/frontend/device/android/powerd.lua @@ -7,11 +7,13 @@ local AndroidPowerD = BasePowerD:new{ } function AndroidPowerD:frontlightIntensityHW() - return android.getScreenBrightness() + return math.floor(android.getScreenBrightness() / 255 * self.fl_max) end function AndroidPowerD:setIntensityHW(intensity) - android.setScreenBrightness(math.floor(255 * intensity / 25)) + if self.fl_intensity ~= intensity then + android.setScreenBrightness(math.floor(255 * intensity / self.fl_max)) + end end function AndroidPowerD:getCapacityHW() diff --git a/frontend/device/generic/device.lua b/frontend/device/generic/device.lua index 87b050bc8..d442c3b1a 100644 --- a/frontend/device/generic/device.lua +++ b/frontend/device/generic/device.lua @@ -166,6 +166,9 @@ function Device:initNetworkManager() end function Device:supportsScreensaver() return false end +-- Device specific method to set datetime +function Device:setDateTime(year, month, day, hour, min, sec) end + -- Device specific method if any setting needs being saved function Device:saveSettings() end diff --git a/frontend/gettext.lua b/frontend/gettext.lua index c357ad416..5800ce321 100644 --- a/frontend/gettext.lua +++ b/frontend/gettext.lua @@ -106,9 +106,9 @@ end if isAndroid then local ffi = require("ffi") local buf = ffi.new("char[?]", 16) - ffi.C.AConfiguration_getLanguage(android.app.config, buf) + android.lib.AConfiguration_getLanguage(android.app.config, buf) local lang = ffi.string(buf) - ffi.C.AConfiguration_getCountry(android.app.config, buf) + android.lib.AConfiguration_getCountry(android.app.config, buf) local country = ffi.string(buf) if lang and country then GetText.changeLang(lang.."_"..country) diff --git a/platform/android/llapp_main.lua b/platform/android/llapp_main.lua index bbea29718..a84ec80c5 100644 --- a/platform/android/llapp_main.lua +++ b/platform/android/llapp_main.lua @@ -46,8 +46,9 @@ local function update() end +-- (Disabled, since we hide navbar on start now no need for this hack) -- run koreader patch before koreader startup -pcall(function() dofile("/sdcard/koreader/patch.lua") end) +-- pcall(function() dofile("/sdcard/koreader/patch.lua") end) -- set proper permission for sdcv A.execute("chmod", "755", "./sdcv") diff --git a/platform/android/luajit-launcher b/platform/android/luajit-launcher index bcda26e00..19779beab 160000 --- a/platform/android/luajit-launcher +++ b/platform/android/luajit-launcher @@ -1 +1 @@ -Subproject commit bcda26e0092400959388d5ee2be534773defda71 +Subproject commit 19779beabfbd6f8195efcaa998a739f39742c71e