diff --git a/core/res/res/layout-sw600dp/keyguard_screen_password_landscape.xml b/core/res/res/layout-sw600dp/keyguard_screen_password_landscape.xml
index 7a5bb6a915b14..568933c0a7f76 100644
--- a/core/res/res/layout-sw600dp/keyguard_screen_password_landscape.xml
+++ b/core/res/res/layout-sw600dp/keyguard_screen_password_landscape.xml
@@ -63,7 +63,7 @@
-
@@ -152,6 +153,15 @@
-
+
+
+
+
diff --git a/core/res/res/layout-sw600dp/keyguard_screen_password_portrait.xml b/core/res/res/layout-sw600dp/keyguard_screen_password_portrait.xml
index 6df22cae5fcdf..335a6419d069c 100644
--- a/core/res/res/layout-sw600dp/keyguard_screen_password_portrait.xml
+++ b/core/res/res/layout-sw600dp/keyguard_screen_password_portrait.xml
@@ -61,92 +61,109 @@
-
-
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_centerInParent="true"
+ android:orientation="vertical"
+ android:gravity="center">
-
+
+
+
+
+
+
+
+
+
+
+
+
+ />
-
-
+
+
+
+
-
-
+ style="@style/Widget.Button.Transparent"
+ />
-
+
-
-
+
-
-
-
-
diff --git a/core/res/res/layout-sw600dp/keyguard_screen_unlock_landscape.xml b/core/res/res/layout-sw600dp/keyguard_screen_unlock_landscape.xml
index 70d18cc7c1ab7..802ef822f9c37 100644
--- a/core/res/res/layout-sw600dp/keyguard_screen_unlock_landscape.xml
+++ b/core/res/res/layout-sw600dp/keyguard_screen_unlock_landscape.xml
@@ -72,48 +72,65 @@
android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal">
-
-
-
-
+ android:layout_centerInParent="true"
+ android:gravity="center_vertical|center_horizontal">
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/core/res/res/layout-sw600dp/keyguard_screen_unlock_portrait.xml b/core/res/res/layout-sw600dp/keyguard_screen_unlock_portrait.xml
index 7a623ce1b777f..40f24929f9bac 100644
--- a/core/res/res/layout-sw600dp/keyguard_screen_unlock_portrait.xml
+++ b/core/res/res/layout-sw600dp/keyguard_screen_unlock_portrait.xml
@@ -62,52 +62,71 @@
-
-
-
-
-
+ android:layout_centerInParent="true"
+ android:gravity="center">
-
-
+
-
+
+
+
+
+
+
+
+
+
+
-
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index 6eff4b6e1c2f0..d1d9e9a05a0ba 100644
--- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -584,15 +584,20 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
(failedBackupAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT);
if (tooManyFaceUnlockTries) Log.i(TAG, "tooManyFaceUnlockTries: " + tooManyFaceUnlockTries);
if (mUpdateMonitor.getPhoneState() == TelephonyManager.CALL_STATE_IDLE
+ && usingFaceLock()
&& !mHasOverlay
&& !tooManyFaceUnlockTries
&& !backupIsTimedOut) {
bindToFaceLock();
+
// Show FaceLock area, but only for a little bit so lockpattern will become visible if
// FaceLock fails to start or crashes
- if (usingFaceLock()) {
- showFaceLockAreaWithTimeout(FACELOCK_VIEW_AREA_SERVICE_TIMEOUT);
- }
+ showFaceLockAreaWithTimeout(FACELOCK_VIEW_AREA_SERVICE_TIMEOUT);
+
+ // When switching between portrait and landscape view while FaceLock is running, the
+ // screen will eventually go dark unless we poke the wakelock when FaceLock is
+ // restarted
+ mKeyguardScreenCallback.pokeWakelock();
} else {
hideFaceLockArea();
}
@@ -1292,8 +1297,11 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
}
if (mFaceLockAreaView != null) {
+ int[] faceLockPosition;
+ faceLockPosition = new int[2];
+ mFaceLockAreaView.getLocationInWindow(faceLockPosition);
startFaceLock(mFaceLockAreaView.getWindowToken(),
- mFaceLockAreaView.getLeft(), mFaceLockAreaView.getTop(),
+ faceLockPosition[0], faceLockPosition[1],
mFaceLockAreaView.getWidth(), mFaceLockAreaView.getHeight());
}
}
@@ -1311,14 +1319,14 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
};
// Tells the FaceLock service to start displaying its UI and perform recognition
- public void startFaceLock(IBinder windowToken, int x, int y, int h, int w)
+ public void startFaceLock(IBinder windowToken, int x, int y, int w, int h)
{
if (usingFaceLock()) {
synchronized (mFaceLockServiceRunningLock) {
if (!mFaceLockServiceRunning) {
if (DEBUG) Log.d(TAG, "Starting FaceLock");
try {
- mFaceLockService.startUi(windowToken, x, y, h, w);
+ mFaceLockService.startUi(windowToken, x, y, w, h);
} catch (RemoteException e) {
Log.e(TAG, "Caught exception starting FaceLock: " + e.toString());
return;
@@ -1360,7 +1368,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
public void unlock() {
if (DEBUG) Log.d(TAG, "FaceLock unlock()");
showFaceLockArea(); // Keep fallback covered
- stopFaceLock();
+ stopAndUnbindFromFaceLock();
mKeyguardScreenCallback.keyguardDone(true);
mKeyguardScreenCallback.reportSuccessfulUnlockAttempt();
@@ -1372,7 +1380,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
public void cancel() {
if (DEBUG) Log.d(TAG, "FaceLock cancel()");
hideFaceLockArea(); // Expose fallback
- stopFaceLock();
+ stopAndUnbindFromFaceLock();
mKeyguardScreenCallback.pokeWakelock(BACKUP_LOCK_TIMEOUT);
}
@@ -1383,7 +1391,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
if (DEBUG) Log.d(TAG, "FaceLock reportFailedAttempt()");
mFailedFaceUnlockAttempts++;
hideFaceLockArea(); // Expose fallback
- stopFaceLock();
+ stopAndUnbindFromFaceLock();
mKeyguardScreenCallback.pokeWakelock(BACKUP_LOCK_TIMEOUT);
}