diff --git a/universal7885-common/apps/CameraLightSensor/AndroidManifest.xml b/universal7885-common/apps/CameraLightSensor/AndroidManifest.xml index 0201b11..04d9cfe 100755 --- a/universal7885-common/apps/CameraLightSensor/AndroidManifest.xml +++ b/universal7885-common/apps/CameraLightSensor/AndroidManifest.xml @@ -34,7 +34,7 @@ android:foregroundServiceType="camera"> - + diff --git a/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.kt b/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.kt index e1ebd03..13bf77b 100755 --- a/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.kt +++ b/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.kt @@ -91,7 +91,7 @@ open class CameraLightSensorService : Service() { private val mScreenStateReceiver: BroadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { - if (intent.action == Intent.ACTION_SCREEN_ON) { + if (intent.action == Intent.ACTION_USER_PRESENT) { onDisplayOn() mServiceStarted = true } else if (intent.action == Intent.ACTION_SCREEN_OFF) { @@ -249,7 +249,7 @@ open class CameraLightSensorService : Service() { startForeground(50, pushNotification(), ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA) batteryOptimization(mContext) mRegistered = false - screenStateFilter = IntentFilter(Intent.ACTION_SCREEN_ON) + screenStateFilter = IntentFilter(Intent.ACTION_USER_PRESENT) screenStateFilter!!.addAction(Intent.ACTION_SCREEN_OFF) try { if (Settings.System.getInt(contentResolver, Settings.System.SCREEN_BRIGHTNESS_MODE)