sm6150-common: parts: Semantic fixes

Change-Id: I26ad700931e8b104ee21666eff1ce73eafbac56d
This commit is contained in:
Arian 2021-10-12 21:56:31 +02:00
parent b3b6b7c683
commit 3182cdfce9
2 changed files with 12 additions and 8 deletions

View File

@ -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;

View File

@ -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));
}