mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 19:55:33 -04:00
universal7885: CameraLightSensor: Fix the service running even if I turn auto-brightness off
Change-Id: I795aef4cbd9d2d5676c8d4ccae11ce5fef828907 Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
parent
7d795b7fe3
commit
4f2af28177
1 changed files with 2 additions and 2 deletions
|
|
@ -65,7 +65,8 @@ public class CameraLightSensorService extends Activity {
|
|||
};
|
||||
private void onDisplayOn() throws Settings.SettingNotFoundException {
|
||||
if(Settings.System.getInt(getContentResolver(),
|
||||
Settings.System.SCREEN_BRIGHTNESS_MODE ) == 1){
|
||||
Settings.System.SCREEN_BRIGHTNESS_MODE ) ==
|
||||
Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC){
|
||||
if(DEBUG) Log.d(TAG, "AutoBrightness Mode Enabled. Starting...");
|
||||
i = new Intent(mContext, Camera2Service.class);
|
||||
mContext.startForegroundService(i);
|
||||
|
|
@ -75,7 +76,6 @@ public class CameraLightSensorService extends Activity {
|
|||
}
|
||||
private void onDisplayOff(){
|
||||
if(DEBUG) Log.d(TAG, "Screen is off. Stopping Service...");
|
||||
i = new Intent(mContext, Camera2Service.class);
|
||||
mContext.stopService(i);
|
||||
}
|
||||
public static void BatteryOptimization(Context context){
|
||||
|
|
|
|||
Loading…
Reference in a new issue