Merge "Move IPC out of critical path"
This commit is contained in:
committed by
Android (Google) Code Review
commit
5bc6ff72ad
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user