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

Commit a23a6035 authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge branch '3387-a15-fix_lockscreen_buttons' into 'v3.0-a15'

fix delete and enter button in lock screen

See merge request e/os/android_frameworks_base!280
parents 301c48d3 84eb780e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -859,6 +859,9 @@
    <!-- Used to launch a common app (FlipFlap) for devices with flip cover. -->
    <protected-broadcast android:name="lineageos.intent.action.LID_STATE_CHANGED" />

    <!-- Used to handle states for devices with a stylus pen. -->
    <protected-broadcast android:name="lineageos.intent.action.PEN_INSERTED_STATE_CHANGED" />

    <!-- Used for long press power torch feature - automatic turn off on timeout -->
    <protected-broadcast android:name="com.android.server.policy.PhoneWindowManager.ACTION_TORCH_OFF" />

+2 −0
Original line number Diff line number Diff line
@@ -77,4 +77,6 @@
    <string name="battery_notification_channel_tv">Advertencia de batería</string>
    <string name="screenshot_delete_label">Eliminar</string>
    <string name="screenshot_delete_description">Eliminar captura de pantalla</string>
    <string name="screen_pinning_description_no_navbar">Esto mantendrá la pantalla visible hasta que dejes de fijarla, para ello, mantén pulsado el botón «Atrás».</string>
    <string name="screen_pinning_toast_no_navbar">Para desanclar esta pantalla, toca y mantén presionado el botón «Atrás»</string>
</resources>
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.keyguard;

import static com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_BUTTON;
import static com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_KEY;
import static com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_ICON;

import android.content.Context;
import android.content.res.ColorStateList;
@@ -101,7 +102,7 @@ public class NumPadButton extends AlphaOptimizedImageButton implements NumPadAni
        if (mAnimator != null) mAnimator.reloadColors(getContext());

        int textColorResId = mIsTransparentMode ? NUM_PAD_KEY : NUM_PAD_BUTTON;
        int imageColor = Utils.getColorAttrDefaultColor(getContext(), textColorResId);
        int imageColor = Utils.getColorAttrDefaultColor(getContext(), NUM_PAD_ICON);
        ((VectorDrawable) getDrawable()).setTintList(ColorStateList.valueOf(imageColor));
    }

+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ object KeyguardBouncerConstants {
        const val NUM_PAD_PRESSED = com.android.internal.R.attr.materialColorOnPrimaryFixed
        const val NUM_PAD_KEY = com.android.internal.R.attr.materialColorOnSurface
        const val NUM_PAD_BUTTON = com.android.internal.R.attr.materialColorOnSecondaryFixed
        const val NUM_PAD_ICON = com.android.internal.R.attr.colorBackground
        const val EMERGENCY_BUTTON = com.android.internal.R.attr.materialColorTertiaryFixed
    }
}
+23 −0
Original line number Diff line number Diff line
@@ -407,6 +407,9 @@ public class InputManagerService extends IInputManager.Stub
    /** Switch code: Microphone. When set, the mic is muted. */
    public static final int SW_MUTE_DEVICE = 0x0e;

    /** Switch code: Stylus Pen. When set, the pen is inserted. */
    public static final int SW_PEN_INSERTED = 0x0f;

    public static final int SW_LID_BIT = 1 << SW_LID;
    public static final int SW_TABLET_MODE_BIT = 1 << SW_TABLET_MODE;
    public static final int SW_KEYPAD_SLIDE_BIT = 1 << SW_KEYPAD_SLIDE;
@@ -418,6 +421,8 @@ public class InputManagerService extends IInputManager.Stub
            SW_HEADPHONE_INSERT_BIT | SW_MICROPHONE_INSERT_BIT | SW_JACK_PHYSICAL_INSERT_BIT | SW_LINEOUT_INSERT_BIT;
    public static final int SW_CAMERA_LENS_COVER_BIT = 1 << SW_CAMERA_LENS_COVER;
    public static final int SW_MUTE_DEVICE_BIT = 1 << SW_MUTE_DEVICE;
    public static final int SW_PEN_INSERTED_BIT = 1 << SW_PEN_INSERTED;


    // The following are layer numbers used for z-ordering the input overlay layers on the display.
    // This is used for ordering layers inside {@code DisplayContent#getInputOverlayLayer()}.
@@ -2385,6 +2390,24 @@ public class InputManagerService extends IInputManager.Stub

            setSensorPrivacy(Sensors.MICROPHONE, micMute);
        }

	if ((switchMask & SW_PEN_INSERTED_BIT) != 0) {
            final boolean penInserted = ((switchValues & SW_PEN_INSERTED_BIT) != 0);

            Intent intent = new Intent("lineageos.intent.action.PEN_INSERTED_STATE_CHANGED");
            intent.putExtra("state", penInserted);
            intent.setPackage("org.lineageos.settings.device");

	    if (DEBUG) {
                Slog.d(TAG, "Dispatching pen state intent: "
                    + intent.getAction() + ", state=" + penInserted
                    + ", switchValues=" + Integer.toHexString(switchValues)
                    + ", switchMask=" + Integer.toHexString(switchMask));
	    }

	    mContext.sendBroadcastAsUser(intent, UserHandle.SYSTEM);
	}

    }

    // Set the sensor privacy state based on the hardware toggles switch states