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

Commit 5bc6ff72 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Move IPC out of critical path"

parents 3abcde24 1fae62ab
Loading
Loading
Loading
Loading
+7 −11
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.keyguard;

import static com.android.systemui.DejankUtils.whitelistIpcs;

import android.content.Context;
import android.content.res.TypedArray;
import android.os.PowerManager;
@@ -36,13 +34,14 @@ public class NumPadKey extends ViewGroup {
    // list of "ABC", etc per digit, starting with '0'
    static String sKlondike[];

    private final TextView mDigitText;
    private final TextView mKlondikeText;
    private final LockPatternUtils mLockPatternUtils;
    private final PowerManager mPM;

    private int mDigit = -1;
    private int mTextViewResId;
    private PasswordTextView mTextView;
    private TextView mDigitText;
    private TextView mKlondikeText;
    private boolean mEnableHaptics;
    private PowerManager mPM;

    private View.OnClickListener mListener = new View.OnClickListener() {
        @Override
@@ -92,10 +91,7 @@ public class NumPadKey extends ViewGroup {
        setOnClickListener(mListener);
        setOnHoverListener(new LiftToActivateListener(context));

        // TODO(b/140043085)
        mEnableHaptics = whitelistIpcs(() ->
                new LockPatternUtils(context).isTactileFeedbackEnabled());

        mLockPatternUtils = new LockPatternUtils(context);
        mPM = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
        LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(
                Context.LAYOUT_INFLATER_SERVICE);
@@ -166,7 +162,7 @@ public class NumPadKey extends ViewGroup {

    // Cause a VIRTUAL_KEY vibration
    public void doHapticKeyClick() {
        if (mEnableHaptics) {
        if (mLockPatternUtils.isTactileFeedbackEnabled()) {
            performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
                    HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING
                    | HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);