reflect changes in koreader/android-luajit-launcher#62 (#3254)

This commit is contained in:
Huang Xin
2017-09-24 05:58:34 +08:00
committed by GitHub
parent 8f3a5353e5
commit a4e1a3ba5e
7 changed files with 17 additions and 9 deletions

View File

@@ -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()