am 8a1131d7: Merge "DO NOT MERGE cherry-picked FU framework tablet commits" into ics-mr1

* commit '8a1131d78925756835561c3e19cddd2ddf9dbd99':
  DO NOT MERGE cherry-picked FU framework tablet commits
This commit is contained in:
Brian Colonna
2012-01-12 06:35:27 -08:00
committed by Android Git Automerger
5 changed files with 222 additions and 151 deletions

View File

@@ -63,7 +63,7 @@
</RelativeLayout> </RelativeLayout>
<!-- right side: password --> <!-- right side: password -->
<LinearLayout <RelativeLayout
android:layout_width="0dip" android:layout_width="0dip"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="match_parent" android:layout_height="match_parent"
@@ -72,6 +72,7 @@
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_centerInParent="true"
android:layout_width="330dip" android:layout_width="330dip"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@@ -152,6 +153,15 @@
</LinearLayout> </LinearLayout>
</LinearLayout> <!-- Area to overlay FaceLock -->
<View android:id="@+id/faceLockAreaView"
android:visibility="invisible"
android:layout_width="512dip"
android:layout_height="512dip"
android:layout_centerInParent="true"
android:background="@color/facelock_color_background"
/>
</RelativeLayout>
</LinearLayout> </LinearLayout>

View File

@@ -61,10 +61,16 @@
</RelativeLayout> </RelativeLayout>
<!-- bottom: password --> <!-- bottom: password -->
<LinearLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dip" android:layout_height="0dip"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:orientation="vertical" android:orientation="vertical"
android:gravity="center"> android:gravity="center">
@@ -137,8 +143,7 @@
/> />
<!-- emergency call button --> <!-- emergency call button -->
<Button <Button android:id="@+id/emergencyCallButton"
android:id="@+id/emergencyCallButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_emergency" android:drawableLeft="@drawable/ic_emergency"
@@ -149,4 +154,16 @@
/> />
</LinearLayout> </LinearLayout>
<!-- Area to overlay FaceLock -->
<View android:id="@+id/faceLockAreaView"
android:visibility="invisible"
android:layout_width="512dip"
android:layout_height="512dip"
android:layout_centerInParent="true"
android:background="@color/facelock_color_background"
/>
</RelativeLayout>
</LinearLayout> </LinearLayout>

View File

@@ -72,6 +72,12 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal"> android:gravity="center_vertical|center_horizontal">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_vertical|center_horizontal">
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern" <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="354dip" android:layout_width="354dip"
android:layout_height="354dip" android:layout_height="354dip"
@@ -80,15 +86,15 @@
<!-- Emergency and forgot pattern buttons. --> <!-- Emergency and forgot pattern buttons. -->
<LinearLayout <LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/lockPattern" android:layout_below="@id/lockPattern"
android:layout_alignLeft="@id/lockPattern" android:layout_alignLeft="@id/lockPattern"
android:layout_alignRight="@id/lockPattern" android:layout_alignRight="@id/lockPattern"
android:layout_marginTop="28dip" android:layout_marginTop="28dip"
android:gravity="center"
style="?android:attr/buttonBarStyle" style="?android:attr/buttonBarStyle"
android:gravity="center"
android:weightSum="2"> android:weightSum="2">
<Button android:id="@+id/forgotPatternButton" <Button android:id="@+id/forgotPatternButton"
@@ -117,4 +123,15 @@
</RelativeLayout> </RelativeLayout>
<!-- Area to overlay FaceLock -->
<View android:id="@+id/faceLockAreaView"
android:visibility="invisible"
android:layout_width="512dip"
android:layout_height="512dip"
android:layout_centerInParent="true"
android:background="@color/facelock_color_background"
/>
</RelativeLayout>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient> </com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>

View File

@@ -62,23 +62,32 @@
</RelativeLayout> </RelativeLayout>
<!-- bottom: lock pattern, emergency dialer and forgot pattern button --> <!-- bottom: lock pattern, emergency dialer and forgot pattern button -->
<LinearLayout <RelativeLayout
android:layout_weight="1" android:layout_weight="1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dip" android:layout_height="0dip"
android:orientation="vertical" android:gravity="center">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"> android:gravity="center">
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern" <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="354dip" android:layout_width="354dip"
android:layout_height="354dip" android:layout_height="354dip"
android:layout_marginTop="50dip"/> android:layout_marginTop="50dip"
/>
<!-- Emergency and forgot pattern buttons. --> <!-- Emergency and forgot pattern buttons. -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_below="@id/lockPattern"
android:layout_alignLeft="@id/lockPattern"
android:layout_alignRight="@id/lockPattern"
style="?android:attr/buttonBarStyle" style="?android:attr/buttonBarStyle"
android:gravity="center" android:gravity="center"
android:weightSum="2"> android:weightSum="2">
@@ -107,7 +116,17 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </RelativeLayout>
<!-- Area to overlay FaceLock -->
<View android:id="@+id/faceLockAreaView"
android:visibility="invisible"
android:layout_width="512dip"
android:layout_height="512dip"
android:layout_centerInParent="true"
android:background="@color/facelock_color_background"
/>
</RelativeLayout>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient> </com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>

View File

@@ -584,15 +584,20 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
(failedBackupAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT); (failedBackupAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT);
if (tooManyFaceUnlockTries) Log.i(TAG, "tooManyFaceUnlockTries: " + tooManyFaceUnlockTries); if (tooManyFaceUnlockTries) Log.i(TAG, "tooManyFaceUnlockTries: " + tooManyFaceUnlockTries);
if (mUpdateMonitor.getPhoneState() == TelephonyManager.CALL_STATE_IDLE if (mUpdateMonitor.getPhoneState() == TelephonyManager.CALL_STATE_IDLE
&& usingFaceLock()
&& !mHasOverlay && !mHasOverlay
&& !tooManyFaceUnlockTries && !tooManyFaceUnlockTries
&& !backupIsTimedOut) { && !backupIsTimedOut) {
bindToFaceLock(); bindToFaceLock();
// Show FaceLock area, but only for a little bit so lockpattern will become visible if // Show FaceLock area, but only for a little bit so lockpattern will become visible if
// FaceLock fails to start or crashes // 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 { } else {
hideFaceLockArea(); hideFaceLockArea();
} }
@@ -1292,8 +1297,11 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
} }
if (mFaceLockAreaView != null) { if (mFaceLockAreaView != null) {
int[] faceLockPosition;
faceLockPosition = new int[2];
mFaceLockAreaView.getLocationInWindow(faceLockPosition);
startFaceLock(mFaceLockAreaView.getWindowToken(), startFaceLock(mFaceLockAreaView.getWindowToken(),
mFaceLockAreaView.getLeft(), mFaceLockAreaView.getTop(), faceLockPosition[0], faceLockPosition[1],
mFaceLockAreaView.getWidth(), mFaceLockAreaView.getHeight()); 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 // 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()) { if (usingFaceLock()) {
synchronized (mFaceLockServiceRunningLock) { synchronized (mFaceLockServiceRunningLock) {
if (!mFaceLockServiceRunning) { if (!mFaceLockServiceRunning) {
if (DEBUG) Log.d(TAG, "Starting FaceLock"); if (DEBUG) Log.d(TAG, "Starting FaceLock");
try { try {
mFaceLockService.startUi(windowToken, x, y, h, w); mFaceLockService.startUi(windowToken, x, y, w, h);
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Caught exception starting FaceLock: " + e.toString()); Log.e(TAG, "Caught exception starting FaceLock: " + e.toString());
return; return;
@@ -1360,7 +1368,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
public void unlock() { public void unlock() {
if (DEBUG) Log.d(TAG, "FaceLock unlock()"); if (DEBUG) Log.d(TAG, "FaceLock unlock()");
showFaceLockArea(); // Keep fallback covered showFaceLockArea(); // Keep fallback covered
stopFaceLock(); stopAndUnbindFromFaceLock();
mKeyguardScreenCallback.keyguardDone(true); mKeyguardScreenCallback.keyguardDone(true);
mKeyguardScreenCallback.reportSuccessfulUnlockAttempt(); mKeyguardScreenCallback.reportSuccessfulUnlockAttempt();
@@ -1372,7 +1380,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
public void cancel() { public void cancel() {
if (DEBUG) Log.d(TAG, "FaceLock cancel()"); if (DEBUG) Log.d(TAG, "FaceLock cancel()");
hideFaceLockArea(); // Expose fallback hideFaceLockArea(); // Expose fallback
stopFaceLock(); stopAndUnbindFromFaceLock();
mKeyguardScreenCallback.pokeWakelock(BACKUP_LOCK_TIMEOUT); mKeyguardScreenCallback.pokeWakelock(BACKUP_LOCK_TIMEOUT);
} }
@@ -1383,7 +1391,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
if (DEBUG) Log.d(TAG, "FaceLock reportFailedAttempt()"); if (DEBUG) Log.d(TAG, "FaceLock reportFailedAttempt()");
mFailedFaceUnlockAttempts++; mFailedFaceUnlockAttempts++;
hideFaceLockArea(); // Expose fallback hideFaceLockArea(); // Expose fallback
stopFaceLock(); stopAndUnbindFromFaceLock();
mKeyguardScreenCallback.pokeWakelock(BACKUP_LOCK_TIMEOUT); mKeyguardScreenCallback.pokeWakelock(BACKUP_LOCK_TIMEOUT);
} }