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

Commit 10217be5 authored by Steve Kondik's avatar Steve Kondik
Browse files

Control the attention light using a config value.

parent 4de06442
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -218,4 +218,8 @@
    <!-- Component name of the default wallpaper. This will be ImageWallpaper if not 
         specified -->
    <string name="default_wallpaper_component">@null</string>

    <!-- Use notification light instead of attention light -->
    <bool name="config_hasIntrusiveLed">false</bool>

</resources>
+9 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server;

import com.android.cts.stub.R;
import com.android.internal.app.IBatteryStats;
import com.android.server.am.BatteryStatsService;

@@ -319,7 +320,10 @@ public class HardwareService extends IHardwareService.Stub {
            if (!mAttentionLightOn && !mPulsing) {
                mPulsing = true;
                // Use LIGHT_ID_NOTIFICATIONS to allow full color. LIGHT_ID_ATTENTION only allows white and blue
                setLight_native(mNativePointer, LIGHT_ID_NOTIFICATIONS, color,
                int lightId = mContext.getResources().getBoolean(
                        com.android.internal.R.bool.config_hasIntrusiveLed)
                        ? LIGHT_ID_NOTIFICATIONS : LIGHT_ID_ATTENTION;
                setLight_native(mNativePointer, lightId, color,
                        LIGHT_FLASH_HARDWARE, 7, 0, 0);
                mH.sendMessageDelayed(Message.obtain(mH, 1), 2000);
            }
@@ -336,7 +340,10 @@ public class HardwareService extends IHardwareService.Stub {
                if (mPulsing) {
                    mPulsing = false;
                    // Use LIGHT_ID_NOTIFICATIONS to allow full color. LIGHT_ID_ATTENTION only allows white and blue
                    setLight_native(mNativePointer, LIGHT_ID_NOTIFICATIONS,
                    int lightId = mContext.getResources().getBoolean(
                            com.android.internal.R.bool.config_hasIntrusiveLed)
                            ? LIGHT_ID_NOTIFICATIONS : LIGHT_ID_ATTENTION;
                    setLight_native(mNativePointer, lightId,
                            mAttentionLightOn ? 0xffffffff : 0,
                            LIGHT_FLASH_NONE, 0, 0, 0);
                }