mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 19:55:33 -04:00
universal7885: CameraLightSensor: Be more sensitive
This commit is contained in:
parent
3c7ca85990
commit
7a9bbf0e14
1 changed files with 3 additions and 2 deletions
|
|
@ -151,7 +151,8 @@ class CameraLightSensorService : Service() {
|
|||
} catch (e: IllegalStateException) {
|
||||
Log.w(TAG, "onReady: Session is NULL")
|
||||
}
|
||||
cameraDevice!!.close() session.close()
|
||||
cameraDevice!!.close()
|
||||
session.close()
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Camera is in use")
|
||||
e.printStackTrace()
|
||||
|
|
@ -301,7 +302,7 @@ class CameraLightSensorService : Service() {
|
|||
"AdjustBrightness: OldVal = " + oldbrightness + " NewVal = " +
|
||||
brightness + " Adjusting.."
|
||||
)
|
||||
var newbrightness = brightness
|
||||
var newbrightness = 2 * brightness - oldbrightness
|
||||
if (newbrightness > 255) {
|
||||
newbrightness = 255
|
||||
} else if (newbrightness < 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue