summaryrefslogtreecommitdiffstats
path: root/policy/src/com/android/internal
diff options
context:
space:
mode:
authorBrian Colonna <bcolonna@google.com>2012-01-09 16:22:12 -0500
committerBrian Colonna <bcolonna@google.com>2012-01-09 16:22:12 -0500
commit7664c0e99d2ee70ad714b904a166b17ac7efdf9f (patch)
tree1d384e6c64435e185a7ba34ccfbe46e07a5d440c /policy/src/com/android/internal
parent7944704e6c4cc10105838b78d3d8403bf66a066b (diff)
downloadframeworks_base-7664c0e99d2ee70ad714b904a166b17ac7efdf9f.zip
frameworks_base-7664c0e99d2ee70ad714b904a166b17ac7efdf9f.tar.gz
frameworks_base-7664c0e99d2ee70ad714b904a166b17ac7efdf9f.tar.bz2
DO NOT MERGE cherry-picked FU framework tablet commits
- cherry-picking framework CLs from master into ics-mr1 that are needed for FU to work on tablets - needed for OEM partners even FU isn't going on xoom Squashed commit of the following: commit 3258f2528f558efdaf34ae15c5425f2d879848fe Author: Brian Colonna <bcolonna@google.com> Date: Tue Dec 13 15:49:48 2011 -0500 Added Face Unlock to tablet lockscreen layouts The Face Unlock Area was not part of the tablet layouts, so prior to this change, Face Unlock would not show up on tablets when selected as the unlock method. The backup unlock method would show up instead. The goal here is for the pattern and PIN unlock layouts (in both portrait and landscape mode) to look the same as before this change. This was a little harder than it was with the phone layouts for two reasons: 1) For the phones it was ok for Face Unlock to be sized such that it just covers the backup method. For the tablets we want Face Unlock to cover far more real estate. 2) The phones were based on a grid layout, whereas the tablet is a linear layout. Note that the diff makes the modifications look way more extensive than they actually are. Basically, in most cases I am putting a relative layout around some existing portion of the layout and putting the Face Unlock Area area inside of the new relative layout. Change-Id: I478becddf2a9ee9fe7b6d653e604fa3ad89b822f commit 821cfe85cf2b3daf074d9749dbf6e0a5663af0de Author: Brian Colonna <bcolonna@google.com> Date: Mon Dec 19 15:51:10 2011 -0500 Unbinding from FU when going to backup Lockscreen was stopping Face Unlock when going to the backup lock, but not unbinding from the Face Unlock service until the device was unlocked. This caused a bug on the tablets where Face Unlock would reappear when switching between portait and landscape orientations, even after the backup lock was exposed. On an orientation change, Face Unlock is restarted if the service is bound to during the orientation change. Since it was bound to when it should not have been, Face Unlock was restarting when it should not have been. The wakelock is also now being poked on an orientation change because on the tablet you can keep Face Unlock alive by switching the orientation back and forth, but eventually the screen would go dark with Face Unlock running. Also, a conditional was moved in activateFaceLockIfAble() so the whole section isn't executed if Face Unlock is not in use. Part of it was being executed with only the inner-most part having the check. This did not cause any issues that I am aware of. Change-Id: Ib452b8ced28a507bf9272dbf5d3477a8abd1ba90 commit fa90bb76ac6b311d12b55d23df4ac44cec62c7b3 Author: Brian Colonna <bcolonna@google.com> Date: Mon Dec 12 18:02:23 2011 -0500 Changed how Face Unlock coordinates are specified Was using View.getLeft() and View.getTop() to specify the upper-left corner of the Face Unlock area. That gives coordinates relative the view, which was fine for the phones. For the tablet it needs coordinates relative to the window (which still works for the phones). Also fixed a 'bug' where h and w were swapped. However, it wasn't causing a problem because it was swapped in two places. Change-Id: I86c1f68439f1dcef826cfe6b8fb56c9a4a6b8dc3 Change-Id: I962c0486be85949e002b0a2701286a6a39251f36
Diffstat (limited to 'policy/src/com/android/internal')
-rw-r--r--policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index 6eff4b6..d1d9e9a 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);
}