Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a1131d7 authored by Brian Colonna's avatar Brian Colonna Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE cherry-picked FU framework tablet commits" into ics-mr1

parents 4ac4ab4e 7664c0e9
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@
    </RelativeLayout>

    <!-- right side: password -->
    <LinearLayout
    <RelativeLayout
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="match_parent"
@@ -72,6 +72,7 @@

        <LinearLayout
            android:orientation="vertical"
            android:layout_centerInParent="true"
            android:layout_width="330dip"
            android:layout_height="wrap_content">

@@ -152,6 +153,15 @@

        </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>
+83 −66
Original line number Diff line number Diff line
@@ -61,10 +61,16 @@
    </RelativeLayout>

    <!-- bottom: password -->
    <LinearLayout
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="0dip"
        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:gravity="center">

@@ -137,8 +143,7 @@
            />

            <!-- emergency call button -->
        <Button
            android:id="@+id/emergencyCallButton"
            <Button android:id="@+id/emergencyCallButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableLeft="@drawable/ic_emergency"
@@ -149,4 +154,16 @@
            />

        </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>
+54 −37
Original line number Diff line number Diff line
@@ -72,6 +72,12 @@
        android:layout_height="match_parent"
        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"
                android:layout_width="354dip"
                android:layout_height="354dip"
@@ -80,15 +86,15 @@

            <!-- Emergency and forgot pattern buttons. -->
            <LinearLayout
            android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_below="@id/lockPattern"
                android:layout_alignLeft="@id/lockPattern"
                android:layout_alignRight="@id/lockPattern"
                android:layout_marginTop="28dip"
            android:gravity="center"
                style="?android:attr/buttonBarStyle"
                android:gravity="center"
                android:weightSum="2">

                <Button android:id="@+id/forgotPatternButton"
@@ -117,4 +123,15 @@

        </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>
+54 −35
Original line number Diff line number Diff line
@@ -62,23 +62,32 @@
    </RelativeLayout>

    <!-- bottom: lock pattern, emergency dialer and forgot pattern button -->
    <LinearLayout
    <RelativeLayout
        android:layout_weight="1"
        android:layout_width="match_parent"
        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">

            <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
                android:layout_width="354dip"
                android:layout_height="354dip"
            android:layout_marginTop="50dip"/>
                android:layout_marginTop="50dip"
            />

            <!-- Emergency and forgot pattern buttons. -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_below="@id/lockPattern"
                android:layout_alignLeft="@id/lockPattern"
                android:layout_alignRight="@id/lockPattern"
                style="?android:attr/buttonBarStyle"
                android:gravity="center"
                android:weightSum="2">
@@ -107,7 +116,17 @@

            </LinearLayout>

    </LinearLayout>
        </RelativeLayout>

</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
        <!-- 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>
+17 −9
Original line number Diff line number Diff line
@@ -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);
            }

            // 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);
        }