This enables the back button in keyguard
When pressed, the back button now takes the user to the selector screen. Change-Id: Ib8d86c6fe0b46de5ad482d526783b4542fdb3336
This commit is contained in:
@@ -33,7 +33,6 @@ import android.content.pm.UserInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.os.UserManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.Slog;
|
||||
@@ -42,7 +41,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.Button;
|
||||
import android.widget.RemoteViews.OnClickHandler;
|
||||
import android.widget.ViewFlipper;
|
||||
|
||||
@@ -51,7 +49,6 @@ import com.android.internal.policy.impl.keyguard.KeyguardSecurityModel.SecurityM
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KeyguardHostView extends KeyguardViewBase {
|
||||
@@ -202,6 +199,17 @@ public class KeyguardHostView extends KeyguardViewBase {
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
if (event.getAction() == KeyEvent.ACTION_UP
|
||||
&& event.getKeyCode() == KeyEvent.KEYCODE_BACK
|
||||
&& mCurrentSecuritySelection != SecurityMode.None) {
|
||||
mCallback.dismiss(false);
|
||||
return true;
|
||||
}
|
||||
return super.dispatchKeyEvent(event);
|
||||
}
|
||||
|
||||
private void showTimeoutDialog() {
|
||||
int timeoutInSeconds = (int) LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
|
||||
int messageId = 0;
|
||||
|
||||
Reference in New Issue
Block a user