Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38f65081 authored by Chris Wren's avatar Chris Wren Committed by Android Git Automerger
Browse files

am 413edd50: Merge "Disable the attention light on devices that do not have...

am 413edd50: Merge "Disable the attention light on devices that do not have it." into lmp-preview-dev

* commit '413edd50540a7890949c5370d18f293f2e6f8841':
  Disable the attention light on devices that do not have it.
parents d450a3a9 3af4edf5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -364,6 +364,9 @@
    <!-- If this is true, the screen will come on when you unplug usb/power/whatever. -->
    <bool name="config_unplugTurnsOnScreen">false</bool>

    <!-- Set this true only if the device has separate attention and notification lights. -->
    <bool name="config_useAttentionLight">false</bool>

    <!-- If this is true, the screen will fade off. -->
    <bool name="config_animateScreenLights">true</bool>

+1 −0
Original line number Diff line number Diff line
@@ -1458,6 +1458,7 @@
  <java-symbol type="array" name="config_defaultNotificationVibePattern" />
  <java-symbol type="array" name="config_notificationFallbackVibePattern" />
  <java-symbol type="array" name="config_onlySingleDcAllowed" />
  <java-symbol type="bool" name="config_useAttentionLight" />
  <java-symbol type="bool" name="config_animateScreenLights" />
  <java-symbol type="bool" name="config_automatic_brightness_available" />
  <java-symbol type="bool" name="config_enableFusedLocationOverlay" />
+6 −1
Original line number Diff line number Diff line
@@ -163,6 +163,7 @@ public class NotificationManagerService extends SystemService {
    private long[] mDefaultVibrationPattern;

    private long[] mFallbackVibrationPattern;
    private boolean mUseAttentionLight;
    boolean mSystemReady;

    private boolean mDisableNotificationAlerts;
@@ -797,6 +798,8 @@ public class NotificationManagerService extends SystemService {
                VIBRATE_PATTERN_MAXLEN,
                DEFAULT_VIBRATE_PATTERN);

        mUseAttentionLight = resources.getBoolean(R.bool.config_useAttentionLight);

        // Don't start allowing notifications until the setup wizard has run once.
        // After that, including subsequent boots, init with notifications turned on.
        // This works on the first boot because the setup wizard will toggle this
@@ -1742,7 +1745,9 @@ public class NotificationManagerService extends SystemService {
        if ((notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0 && canInterrupt) {
            mLights.add(record.getKey());
            updateLightsLocked();
            if (mUseAttentionLight) {
                mAttentionLight.pulse();
            }
        } else if (wasShowLights) {
            updateLightsLocked();
        }