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 <whiteshell2544@naver.com>
This commit is contained in:
roynatech2544 2021-11-10 17:59:56 +09:00
commit 9d3976a986
No known key found for this signature in database
GPG key ID: 9675C32163D88D30

View file

@ -301,7 +301,7 @@ public class CameraLightSensorService extends Service {
destroy = false;
avail = true;
startForeground(50, PushNotification());
return START_NOT_STICKY;
return START_STICKY;
}
@Override