From 9d3976a986cc1ae1eaa5628e97812fc63168d9d2 Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Wed, 10 Nov 2021 17:59:56 +0900 Subject: [PATCH] universal7885: CameraLightSensor: return START_STICKY * Both codes are only relevant when the phone runs out of memory and kills the service before it finishes executing. START_STICKY tells the OS to recreate the service after it has enough memory and call onStartCommand() again with a null intent. START_NOT_STICKY tells the OS to not bother recreating the service again. There is also a third code START_REDELIVER_INTENT that tells the OS to recreate the service and redeliver the same intent to onStartCommand(). https: //stackoverflow.com/questions/9093271/start-sticky-and-start-not-sticky Change-Id: I3d5e8d8ee4e6c7270e0a7c8ccc881ec520563801 Signed-off-by: roynatech2544 --- .../eurekateam/cameralightsensor/CameraLightSensorService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.java b/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.java index 7a797f5..eeb74e5 100755 --- a/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.java +++ b/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.java @@ -301,7 +301,7 @@ public class CameraLightSensorService extends Service { destroy = false; avail = true; startForeground(50, PushNotification()); - return START_NOT_STICKY; + return START_STICKY; } @Override