diff --git a/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java b/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java index d5e9d4f..5588581 100644 --- a/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java +++ b/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java @@ -176,8 +176,8 @@ public class DozeSettingsFragment extends PreferenceFragment } mHandler.post(() -> { - DozeUtils.checkDozeService(getActivity()); - DozeUtils.updateDozeBrightnessIcon(getContext(), mDozeBrightnessPreference); + DozeUtils.checkDozeService(getActivity()); + DozeUtils.updateDozeBrightnessIcon(getContext(), mDozeBrightnessPreference); }); return true; diff --git a/parts/src/org/lineageos/settings/doze/DozeUtils.java b/parts/src/org/lineageos/settings/doze/DozeUtils.java index b1523d6..eec61db 100644 --- a/parts/src/org/lineageos/settings/doze/DozeUtils.java +++ b/parts/src/org/lineageos/settings/doze/DozeUtils.java @@ -17,12 +17,15 @@ package org.lineageos.settings.doze; +import static android.provider.Settings.Secure.DOZE_ALWAYS_ON; +import static android.provider.Settings.Secure.DOZE_ENABLED; + import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; -import android.hardware.display.AmbientDisplayConfiguration; import android.hardware.Sensor; import android.hardware.SensorManager; +import android.hardware.display.AmbientDisplayConfiguration; import android.os.PowerManager; import android.os.SystemClock; import android.os.UserHandle; @@ -34,9 +37,6 @@ import androidx.preference.PreferenceManager; import org.lineageos.settings.R; import org.lineageos.settings.utils.FileUtils; -import static android.provider.Settings.Secure.DOZE_ALWAYS_ON; -import static android.provider.Settings.Secure.DOZE_ENABLED; - public final class DozeUtils { private static final String TAG = "DozeUtils"; private static final boolean DEBUG = false; @@ -119,11 +119,15 @@ public final class DozeUtils { protected static void wakeOrLaunchDozePulse(Context context) { if (isWakeOnGestureEnabled(context)) { - if (DEBUG) Log.d(TAG, "Wake up display"); + if (DEBUG) { + Log.d(TAG, "Wake up display"); + } PowerManager powerManager = context.getSystemService(PowerManager.class); powerManager.wakeUp(SystemClock.uptimeMillis(), PowerManager.WAKE_REASON_GESTURE, TAG); } else { - if (DEBUG) Log.d(TAG, "Launch doze pulse"); + if (DEBUG) { + Log.d(TAG, "Launch doze pulse"); + } context.sendBroadcastAsUser( new Intent(DOZE_INTENT), new UserHandle(UserHandle.USER_CURRENT)); }