mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 12:35: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 {
|
private void onDisplayOn() throws Settings.SettingNotFoundException {
|
||||||
if(Settings.System.getInt(getContentResolver(),
|
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...");
|
if(DEBUG) Log.d(TAG, "AutoBrightness Mode Enabled. Starting...");
|
||||||
i = new Intent(mContext, Camera2Service.class);
|
i = new Intent(mContext, Camera2Service.class);
|
||||||
mContext.startForegroundService(i);
|
mContext.startForegroundService(i);
|
||||||
|
|
@ -75,7 +76,6 @@ public class CameraLightSensorService extends Activity {
|
||||||
}
|
}
|
||||||
private void onDisplayOff(){
|
private void onDisplayOff(){
|
||||||
if(DEBUG) Log.d(TAG, "Screen is off. Stopping Service...");
|
if(DEBUG) Log.d(TAG, "Screen is off. Stopping Service...");
|
||||||
i = new Intent(mContext, Camera2Service.class);
|
|
||||||
mContext.stopService(i);
|
mContext.stopService(i);
|
||||||
}
|
}
|
||||||
public static void BatteryOptimization(Context context){
|
public static void BatteryOptimization(Context context){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue