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

Unverified Commit e21273ec authored by AdrianDC's avatar AdrianDC Committed by Michael Bestas
Browse files

fw: Move Notification LEDs settings to CMSettings



 * Lights with Screen On
 * LEDs Brightness
 * Multiple LEDs

Change-Id: Ife49a2f8077e9361f56990fb4b0b49e1c44bdd5e
Signed-off-by: default avatarAdrianDC <radian.dc@gmail.com>
parent 26c86de7
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -21,12 +21,10 @@
    <private-symbols package="com.android.internal" />

    <!-- Notification and battery light -->
    <java-symbol type="bool" name="config_adjustableNotificationLedBrightness" />
    <java-symbol type="bool" name="config_intrusiveNotificationLed" />
    <java-symbol type="bool" name="config_multiColorNotificationLed" />
    <java-symbol type="bool" name="config_intrusiveBatteryLed" />
    <java-symbol type="bool" name="config_multiColorBatteryLed" />
    <java-symbol type="bool" name="config_multipleNotificationLeds" />
    <java-symbol type="array" name="notification_light_package_mapping" />
    <java-symbol type="array" name="config_notificationNoAlertsVibePattern" />
    
+0 −8
Original line number Diff line number Diff line
@@ -973,10 +973,6 @@
    <!-- Default value for LED on time when the battery is low on charge in miliseconds -->
    <integer name="config_notificationsBatteryLedOn">125</integer>

    <!-- Is the notification LED brightness adjustable ?
         Used to decide if the user can set LED brightness -->
    <bool name="config_adjustableNotificationLedBrightness">false</bool>

    <!-- Is the notification LED intrusive? Used to decide if there should be a disable option -->
    <bool name="config_intrusiveNotificationLed">false</bool>

@@ -991,10 +987,6 @@
         Used to decide if the user can change the colors -->
    <bool name="config_multiColorBatteryLed">false</bool>

    <!-- Does the device have multiple LEDs ?
         Used to decide if the user can change the multiple LEDs settings -->
    <bool name="config_multipleNotificationLeds">false</bool>

    <!-- Do the battery/notification LEDs support pulsing?
         Used to decide if we show pulse settings -->
    <bool name="config_ledCanPulse">true</bool>
+0 −8
Original line number Diff line number Diff line
@@ -69,14 +69,6 @@
         pending notification -->
    <bool name="def_notification_pulse">true</bool>

    <!-- Default value for the notification LEDs brightness
         on devices equiped with configurable LED controller -->
    <integer name="def_notification_brightness_level">255</integer>

    <!-- Default value for whether or not to use multiple notification LEDs
         on devices equiped with more than one LED -->
    <bool name="def_notification_multiple_leds">false</bool>

    <bool name="def_mount_play_notification_snd">true</bool>
    <bool name="def_mount_ums_autostart">false</bool>
    <bool name="def_mount_ums_prompt">true</bool>
+5 −4
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;

import cyanogenmod.providers.CMSettings;

/**
 * <p>BatteryService monitors the charging status, and charge level of the device
@@ -951,11 +952,11 @@ public final class BatteryService extends SystemService {

            // Is the notification LED brightness changeable ?
            mAdjustableNotificationLedBrightness = context.getResources().getBoolean(
                    com.android.internal.R.bool.config_adjustableNotificationLedBrightness);
                    org.cyanogenmod.platform.internal.R.bool.config_adjustableNotificationLedBrightness);

            // Does the Device have multiple LEDs ?
            mMultipleNotificationLeds = context.getResources().getBoolean(
                    com.android.internal.R.bool.config_multipleNotificationLeds);
                    org.cyanogenmod.platform.internal.R.bool.config_multipleNotificationLeds);

            mBatteryLedOn = context.getResources().getInteger(
                    com.android.internal.R.integer.config_notificationsBatteryLedOn);
@@ -1203,8 +1204,8 @@ public final class BatteryService extends SystemService {

            // Multiple LEDs enabled
            if (mMultipleNotificationLeds) {
                mMultipleLedsEnabled = Settings.System.getInt(resolver,
                        Settings.System.NOTIFICATION_LIGHT_MULTIPLE_LEDS_ENABLE,
                mMultipleLedsEnabled = CMSettings.System.getInt(resolver,
                        CMSettings.System.NOTIFICATION_LIGHT_MULTIPLE_LEDS_ENABLE,
                        mMultipleNotificationLeds ? 1 : 0) != 0;
            }

+4 −2
Original line number Diff line number Diff line
@@ -148,6 +148,8 @@ import com.android.server.statusbar.StatusBarManagerInternal;
import com.android.server.vr.VrManagerInternal;
import com.android.server.notification.ManagedServices.UserProfiles;

import cyanogenmod.providers.CMSettings;

import libcore.io.IoUtils;

import org.json.JSONException;
@@ -1140,9 +1142,9 @@ public class NotificationManagerService extends SystemService {
                DEFAULT_VIBRATE_PATTERN);

        mAdjustableNotificationLedBrightness = resources.getBoolean(
                com.android.internal.R.bool.config_adjustableNotificationLedBrightness);
                org.cyanogenmod.platform.internal.R.bool.config_adjustableNotificationLedBrightness);
        mMultipleNotificationLeds = resources.getBoolean(
                com.android.internal.R.bool.config_multipleNotificationLeds);
                org.cyanogenmod.platform.internal.R.bool.config_multipleNotificationLeds);

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