Skip to content

Commit cd9db1c

Browse files
DvTonderGerrit Code Review
authored andcommitted
Merge "Lockscreen: longpress on expand challenge handle" into cm-10.1
2 parents 668ec5e + 1af816f commit cd9db1c

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

core/res/res/layout-port/keyguard_host_view.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
</com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer>
8181

8282
<ImageButton
83+
android:id="@+id/expand_challenge_handle"
8384
android:layout_width="match_parent"
8485
android:layout_height="@dimen/kg_widget_pager_bottom_padding"
8586
androidprv:layout_childType="expandChallengeHandle"

core/res/res/values/symbols.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,7 @@
18881888

18891889
<!-- Lockscreen -->
18901890
<java-symbol type="bool" name="config_disableHomeUnlockSetting" />
1891+
<java-symbol type="id" name="expand_challenge_handle" />
18911892
<!-- Lock screen always show battery -->
18921893
<java-symbol type="string" name="lockscreen_discharging" />
18931894

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import android.util.AttributeSet;
4848
import android.util.Log;
4949
import android.util.Slog;
50+
import android.view.HapticFeedbackConstants;
5051
import android.view.KeyEvent;
5152
import android.view.LayoutInflater;
5253
import android.view.MotionEvent;
@@ -79,6 +80,7 @@ public class KeyguardHostView extends KeyguardViewBase {
7980
private KeyguardSecurityViewFlipper mSecurityViewContainer;
8081
private KeyguardSelectorView mKeyguardSelectorView;
8182
private KeyguardTransportControlView mTransportControl;
83+
private View mExpandChallengeView;
8284
private boolean mIsVerifyUnlockOnly;
8385
private boolean mEnableFallback; // TODO: This should get the value from KeyguardPatternView
8486
private SecurityMode mCurrentSecuritySelection = SecurityMode.Invalid;
@@ -250,9 +252,27 @@ protected void onFinishInflate() {
250252

251253
showPrimarySecurityScreen(false);
252254
updateSecurityViews();
255+
256+
mExpandChallengeView = (View) findViewById(R.id.expand_challenge_handle);
257+
if (mExpandChallengeView != null) {
258+
mExpandChallengeView.setOnLongClickListener(mFastUnlockClickListener);
259+
}
260+
253261
minimizeChallengeIfDesired();
254262
}
255263

264+
private final OnLongClickListener mFastUnlockClickListener = new OnLongClickListener() {
265+
@Override
266+
public boolean onLongClick(View v) {
267+
if (mLockPatternUtils.isTactileFeedbackEnabled()) {
268+
v.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
269+
HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
270+
}
271+
showNextSecurityScreenOrFinish(false);
272+
return true;
273+
}
274+
};
275+
256276
private int getDisabledFeatures(DevicePolicyManager dpm) {
257277
int disabledFeatures = DevicePolicyManager.KEYGUARD_DISABLE_FEATURES_NONE;
258278
if (dpm != null) {

0 commit comments

Comments
 (0)