Merge "Move IPC out of critical path"

This commit is contained in:
TreeHugger Robot
2019-08-28 04:35:24 +00:00
committed by Android (Google) Code Review

View File

@@ -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);