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

Commit 1d396750 authored by Nick Desaulniers's avatar Nick Desaulniers
Browse files

framework: SystemUI: add tracing to Keyguard

Helps trace the phone unlock path.

Bug: 29693568
Bug: 30279403
Change-Id: I290864f525e3d08f1efc6b9fc603172a5d139ea0
parent 004d1400
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import android.os.IRemoteCallback;
import android.os.Message;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
@@ -259,10 +260,14 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                    handleFinishedGoingToSleep(msg.arg1);
                    break;
                case MSG_STARTED_WAKING_UP:
                    Trace.beginSection("KeyguardUpdateMonitor#handler MSG_STARTED_WAKING_UP");
                    handleStartedWakingUp();
                    Trace.endSection();
                    break;
                case MSG_FACE_UNLOCK_STATE_CHANGED:
                    Trace.beginSection("KeyguardUpdateMonitor#handler MSG_FACE_UNLOCK_STATE_CHANGED");
                    handleFaceUnlockStateChanged(msg.arg1 != 0, msg.arg2);
                    Trace.endSection();
                    break;
                case MSG_SIM_SUBSCRIPTION_INFO_CHANGED:
                    handleSimSubscriptionInfoChanged();
@@ -277,7 +282,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                    handleScreenTurnedOn();
                    break;
                case MSG_SCREEN_TURNED_OFF:
                    Trace.beginSection("KeyguardUpdateMonitor#handler MSG_SCREEN_TURNED_ON");
                    handleScreenTurnedOff();
                    Trace.endSection();
                    break;
            }
        }
@@ -399,6 +406,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    }

    private void onFingerprintAuthenticated(int userId) {
        Trace.beginSection("KeyGuardUpdateMonitor#onFingerPrintAuthenticated");
        mUserFingerprintAuthenticated.put(userId, true);

        // If fingerprint unlocking is allowed, this event will lead to a Keyguard dismiss or to a
@@ -411,6 +419,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                cb.onFingerprintAuthenticated(userId);
            }
        }
        Trace.endSection();
    }

    private void handleFingerprintAuthFailed() {
@@ -436,6 +445,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    }

    private void handleFingerprintAuthenticated() {
        Trace.beginSection("KeyGuardUpdateMonitor#handlerFingerPrintAuthenticated");
        try {
            final int userId;
            try {
@@ -452,6 +462,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        } finally {
            setFingerprintRunningState(FINGERPRINT_STATE_STOPPED);
        }
        Trace.endSection();
    }

    private void handleFingerprintHelp(int msgId, String helpString) {
@@ -690,8 +701,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_INFO_CHANGED,
                        intent.getIntExtra(Intent.EXTRA_USER_HANDLE, getSendingUserId()), 0));
            } else if (ACTION_FACE_UNLOCK_STARTED.equals(action)) {
                Trace.beginSection("KeyguardUpdateMonitor.mBroadcastAllReceiver#onReceive ACTION_FACE_UNLOCK_STARTED");
                mHandler.sendMessage(mHandler.obtainMessage(MSG_FACE_UNLOCK_STATE_CHANGED, 1,
                        getSendingUserId()));
                Trace.endSection();
            } else if (ACTION_FACE_UNLOCK_STOPPED.equals(action)) {
                mHandler.sendMessage(mHandler.obtainMessage(MSG_FACE_UNLOCK_STATE_CHANGED, 0,
                        getSendingUserId()));
@@ -731,7 +744,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {

        @Override
        public void onAuthenticationSucceeded(AuthenticationResult result) {
            Trace.beginSection("KeyguardUpdateMonitor#onAuthenticationSucceeded");
            handleFingerprintAuthenticated();
            Trace.endSection();
        }

        @Override
@@ -906,6 +921,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    }

    protected void handleStartedWakingUp() {
        Trace.beginSection("KeyguardUpdateMonitor#handleStartedWakingUp");
        updateFingerprintListeningState();
        final int count = mCallbacks.size();
        for (int i = 0; i < count; i++) {
@@ -914,6 +930,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                cb.onStartedWakingUp();
            }
        }
        Trace.endSection();
    }

    protected void handleStartedGoingToSleep(int arg1) {
+17 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.os.Bundle;
import android.os.Debug;
import android.os.IBinder;
import android.os.Process;
import android.os.Trace;
import android.util.Log;

import com.android.internal.policy.IKeyguardDrawnCallback;
@@ -73,21 +74,27 @@ public class KeyguardService extends Service {

        @Override // Binder interface
        public void verifyUnlock(IKeyguardExitCallback callback) {
            Trace.beginSection("KeyguardService.mBinder#verifyUnlock");
            checkPermission();
            mKeyguardViewMediator.verifyUnlock(callback);
            Trace.endSection();
        }

        @Override // Binder interface
        public void keyguardDone(boolean authenticated, boolean wakeup) {
            Trace.beginSection("KeyguardService.mBinder#keyguardDone");
            checkPermission();
            // TODO: Remove wakeup
            mKeyguardViewMediator.keyguardDone(authenticated);
            Trace.endSection();
        }

        @Override // Binder interface
        public void setOccluded(boolean isOccluded) {
            Trace.beginSection("KeyguardService.mBinder#setOccluded");
            checkPermission();
            mKeyguardViewMediator.setOccluded(isOccluded);
            Trace.endSection();
        }

        @Override // Binder interface
@@ -122,20 +129,26 @@ public class KeyguardService extends Service {

        @Override // Binder interface
        public void onStartedWakingUp() {
            Trace.beginSection("KeyguardService.mBinder#onStartedWakingUp");
            checkPermission();
            mKeyguardViewMediator.onStartedWakingUp();
            Trace.endSection();
        }

        @Override // Binder interface
        public void onScreenTurningOn(IKeyguardDrawnCallback callback) {
            Trace.beginSection("KeyguardService.mBinder#onScreenTurningOn");
            checkPermission();
            mKeyguardViewMediator.onScreenTurningOn(callback);
            Trace.endSection();
        }

        @Override // Binder interface
        public void onScreenTurnedOn() {
            Trace.beginSection("KeyguardService.mBinder#onScreenTurningOn");
            checkPermission();
            mKeyguardViewMediator.onScreenTurnedOn();
            Trace.endSection();
        }

        @Override // Binder interface
@@ -152,8 +165,10 @@ public class KeyguardService extends Service {

        @Override // Binder interface
        public void onSystemReady() {
            Trace.beginSection("KeyguardService.mBinder#onSystemReady");
            checkPermission();
            mKeyguardViewMediator.onSystemReady();
            Trace.endSection();
        }

        @Override // Binder interface
@@ -176,8 +191,10 @@ public class KeyguardService extends Service {

        @Override
        public void startKeyguardExitAnimation(long startTime, long fadeoutDuration) {
            Trace.beginSection("KeyguardService.mBinder#startKeyguardExitAnimation");
            checkPermission();
            mKeyguardViewMediator.startKeyguardExitAnimation(startTime, fadeoutDuration);
            Trace.endSection();
        }

        @Override
+73 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.os.PowerManager;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.StorageManager;
@@ -520,7 +521,9 @@ public class KeyguardViewMediator extends SystemUI {

        @Override
        public void keyguardDoneDrawing() {
            Trace.beginSection("KeyguardViewMediator.mViewMediatorCallback#keyguardDoneDrawing");
            mHandler.sendEmptyMessage(KEYGUARD_DONE_DRAWING);
            Trace.endSection();
        }

        @Override
@@ -530,6 +533,7 @@ public class KeyguardViewMediator extends SystemUI {

        @Override
        public void keyguardDonePending(boolean strongAuth) {
            Trace.beginSection("KeyguardViewMediator.mViewMediatorCallback#keyguardDonePending");
            mKeyguardDonePending = true;
            mHideAnimationRun = true;
            mStatusBarKeyguardViewManager.startPreHideAnimation(null /* finishRunnable */);
@@ -538,20 +542,25 @@ public class KeyguardViewMediator extends SystemUI {
            if (strongAuth) {
                mUpdateMonitor.reportSuccessfulStrongAuthUnlockAttempt();
            }
            Trace.endSection();
        }

        @Override
        public void keyguardGone() {
            Trace.beginSection("KeyguardViewMediator.mViewMediatorCallback#keyguardGone");
            mKeyguardDisplayManager.hide();
            Trace.endSection();
        }

        @Override
        public void readyForKeyguardDone() {
            Trace.beginSection("KeyguardViewMediator.mViewMediatorCallback#readyForKeyguardDone");
            if (mKeyguardDonePending) {
                // Somebody has called keyguardDonePending before, which means that we are
                // authenticated
                KeyguardViewMediator.this.keyguardDone(true /* authenticated */);
            }
            Trace.endSection();
        }

        @Override
@@ -892,6 +901,7 @@ public class KeyguardViewMediator extends SystemUI {
     * Let's us know when the device is waking up.
     */
    public void onStartedWakingUp() {
        Trace.beginSection("KeyguardViewMediator#onStartedWakingUp");

        // TODO: Rename all screen off/on references to interactive/sleeping
        synchronized (this) {
@@ -903,15 +913,20 @@ public class KeyguardViewMediator extends SystemUI {
        }
        KeyguardUpdateMonitor.getInstance(mContext).dispatchStartedWakingUp();
        maybeSendUserPresentBroadcast();
        Trace.endSection();
    }

    public void onScreenTurningOn(IKeyguardDrawnCallback callback) {
        Trace.beginSection("KeyguardViewMediator#onScreenTurningOn");
        notifyScreenOn(callback);
        Trace.endSection();
    }

    public void onScreenTurnedOn() {
        Trace.beginSection("KeyguardViewMediator#onScreenTurnedOn");
        notifyScreenTurnedOn();
        mUpdateMonitor.dispatchScreenTurnedOn();
        Trace.endSection();
    }

    public void onScreenTurnedOff() {
@@ -1025,6 +1040,7 @@ public class KeyguardViewMediator extends SystemUI {
     * @see android.app.KeyguardManager#exitKeyguardSecurely
     */
    public void verifyUnlock(IKeyguardExitCallback callback) {
        Trace.beginSection("KeyguardViewMediator#verifyUnlock");
        synchronized (this) {
            if (DEBUG) Log.d(TAG, "verifyUnlock");
            if (shouldWaitForProvisioning()) {
@@ -1075,6 +1091,7 @@ public class KeyguardViewMediator extends SystemUI {
                }
            }
        }
        Trace.endSection();
    }

    /**
@@ -1088,16 +1105,19 @@ public class KeyguardViewMediator extends SystemUI {
     * Notify us when the keyguard is occluded by another window
     */
    public void setOccluded(boolean isOccluded) {
        Trace.beginSection("KeyguardViewMediator#setOccluded");
        if (DEBUG) Log.d(TAG, "setOccluded " + isOccluded);
        mHandler.removeMessages(SET_OCCLUDED);
        Message msg = mHandler.obtainMessage(SET_OCCLUDED, (isOccluded ? 1 : 0), 0);
        mHandler.sendMessage(msg);
        Trace.endSection();
    }

    /**
     * Handles SET_OCCLUDED message sent by setOccluded()
     */
    private void handleSetOccluded(boolean isOccluded) {
        Trace.beginSection("KeyguardViewMediator#handleSetOccluded");
        synchronized (KeyguardViewMediator.this) {
            if (mHiding && isOccluded) {
                // We're in the process of going away but WindowManager wants to show a
@@ -1112,6 +1132,7 @@ public class KeyguardViewMediator extends SystemUI {
                adjustStatusBarLocked();
            }
        }
        Trace.endSection();
    }

    /**
@@ -1300,11 +1321,13 @@ public class KeyguardViewMediator extends SystemUI {
     * @see #handleShow
     */
    private void showLocked(Bundle options) {
        Trace.beginSection("KeyguardViewMediator#showLocked aqcuiring mShowKeyguardWakeLock");
        if (DEBUG) Log.d(TAG, "showLocked");
        // ensure we stay awake until we are finished displaying the keyguard
        mShowKeyguardWakeLock.acquire();
        Message msg = mHandler.obtainMessage(SHOW, options);
        mHandler.sendMessage(msg);
        Trace.endSection();
    }

    /**
@@ -1312,9 +1335,11 @@ public class KeyguardViewMediator extends SystemUI {
     * @see #handleHide()
     */
    private void hideLocked() {
        Trace.beginSection("KeyguardViewMediator#hideLocked");
        if (DEBUG) Log.d(TAG, "hideLocked");
        Message msg = mHandler.obtainMessage(HIDE);
        mHandler.sendMessage(msg);
        Trace.endSection();
    }

    public boolean isSecure() {
@@ -1359,10 +1384,12 @@ public class KeyguardViewMediator extends SystemUI {
    };

    public void keyguardDone(boolean authenticated) {
        Trace.beginSection("KeyguardViewMediator#keyguardDone");
        if (DEBUG) Log.d(TAG, "keyguardDone(" + authenticated +")");
        EventLog.writeEvent(70000, 2);
        Message msg = mHandler.obtainMessage(KEYGUARD_DONE, authenticated ? 1 : 0);
        mHandler.sendMessage(msg);
        Trace.endSection();
    }

    /**
@@ -1386,7 +1413,9 @@ public class KeyguardViewMediator extends SystemUI {
                    handleReset();
                    break;
                case VERIFY_UNLOCK:
                    Trace.beginSection("KeyguardViewMediator#handleMessage VERIFY_UNLOCK");
                    handleVerifyUnlock();
                    Trace.endSection();
                    break;
                case NOTIFY_STARTED_GOING_TO_SLEEP:
                    handleNotifyStartedGoingToSleep();
@@ -1395,25 +1424,37 @@ public class KeyguardViewMediator extends SystemUI {
                    handleNotifyFinishedGoingToSleep();
                    break;
                case NOTIFY_SCREEN_TURNING_ON:
                    Trace.beginSection("KeyguardViewMediator#handleMessage NOTIFY_SCREEN_TURNING_ON");
                    handleNotifyScreenTurningOn((IKeyguardDrawnCallback) msg.obj);
                    Trace.endSection();
                    break;
                case NOTIFY_SCREEN_TURNED_ON:
                    Trace.beginSection("KeyguardViewMediator#handleMessage NOTIFY_SCREEN_TURNED_ON");
                    handleNotifyScreenTurnedOn();
                    Trace.endSection();
                    break;
                case NOTIFY_SCREEN_TURNED_OFF:
                    handleNotifyScreenTurnedOff();
                    break;
                case NOTIFY_STARTED_WAKING_UP:
                    Trace.beginSection("KeyguardViewMediator#handleMessage NOTIFY_STARTED_WAKING_UP");
                    handleNotifyStartedWakingUp();
                    Trace.endSection();
                    break;
                case KEYGUARD_DONE:
                    Trace.beginSection("KeyguardViewMediator#handleMessage KEYGUARD_DONE");
                    handleKeyguardDone(msg.arg1 != 0);
                    Trace.endSection();
                    break;
                case KEYGUARD_DONE_DRAWING:
                    Trace.beginSection("KeyguardViewMediator#handleMessage KEYGUARD_DONE_DRAWING");
                    handleKeyguardDoneDrawing();
                    Trace.endSection();
                    break;
                case SET_OCCLUDED:
                    Trace.beginSection("KeyguardViewMediator#handleMessage SET_OCCLUDED");
                    handleSetOccluded(msg.arg1 != 0);
                    Trace.endSection();
                    break;
                case KEYGUARD_TIMEOUT:
                    synchronized (KeyguardViewMediator.this) {
@@ -1424,12 +1465,16 @@ public class KeyguardViewMediator extends SystemUI {
                    handleDismiss();
                    break;
                case START_KEYGUARD_EXIT_ANIM:
                    Trace.beginSection("KeyguardViewMediator#handleMessage START_KEYGUARD_EXIT_ANIM");
                    StartKeyguardExitAnimParams params = (StartKeyguardExitAnimParams) msg.obj;
                    handleStartKeyguardExitAnimation(params.startTime, params.fadeoutDuration);
                    FalsingManager.getInstance(mContext).onSucccessfulUnlock();
                    Trace.endSection();
                    break;
                case KEYGUARD_DONE_PENDING_TIMEOUT:
                    Trace.beginSection("KeyguardViewMediator#handleMessage KEYGUARD_DONE_PENDING_TIMEOUT");
                    Log.w(TAG, "Timeout while waiting for activity drawn!");
                    Trace.endSection();
                    // Fall through.
                case ON_ACTIVITY_DRAWN:
                    handleOnActivityDrawn();
@@ -1443,6 +1488,7 @@ public class KeyguardViewMediator extends SystemUI {
     * @see #KEYGUARD_DONE
     */
    private void handleKeyguardDone(boolean authenticated) {
        Trace.beginSection("KeyguardViewMediator#handleKeyguardDone");
        final int currentUser = KeyguardUpdateMonitor.getCurrentUser();
        if (mLockPatternUtils.isSecure(currentUser)) {
            mLockPatternUtils.getDevicePolicyManager().reportKeyguardDismissed(currentUser);
@@ -1480,6 +1526,7 @@ public class KeyguardViewMediator extends SystemUI {
        }

        handleHide();
        Trace.endSection();
    }

    private void sendUserPresentBroadcast() {
@@ -1504,6 +1551,7 @@ public class KeyguardViewMediator extends SystemUI {
     * @see #KEYGUARD_DONE_DRAWING
     */
    private void handleKeyguardDoneDrawing() {
        Trace.beginSection("KeyguardViewMediator#handleKeyguardDoneDrawing");
        synchronized(this) {
            if (DEBUG) Log.d(TAG, "handleKeyguardDoneDrawing");
            if (mWaitingUntilKeyguardVisible) {
@@ -1517,6 +1565,7 @@ public class KeyguardViewMediator extends SystemUI {
                mHandler.removeMessages(KEYGUARD_DONE_DRAWING);
            }
        }
        Trace.endSection();
    }

    private void playSounds(boolean locked) {
@@ -1548,10 +1597,12 @@ public class KeyguardViewMediator extends SystemUI {
    }

    private void updateActivityLockScreenState() {
        Trace.beginSection("KeyguardViewMediator#updateActivityLockScreenState");
        try {
            ActivityManagerNative.getDefault().setLockScreenShown(mShowing, mOccluded);
        } catch (RemoteException e) {
        }
        Trace.endSection();
    }

    /**
@@ -1559,6 +1610,7 @@ public class KeyguardViewMediator extends SystemUI {
     * @see #SHOW
     */
    private void handleShow(Bundle options) {
        Trace.beginSection("KeyguardViewMediator#handleShow");
        final int currentUser = KeyguardUpdateMonitor.getCurrentUser();
        if (mLockPatternUtils.isSecure(currentUser)) {
            mLockPatternUtils.getDevicePolicyManager().reportKeyguardSecured(currentUser);
@@ -1584,11 +1636,13 @@ public class KeyguardViewMediator extends SystemUI {
            mShowKeyguardWakeLock.release();
        }
        mKeyguardDisplayManager.show();
        Trace.endSection();
    }

    private final Runnable mKeyguardGoingAwayRunnable = new Runnable() {
        @Override
        public void run() {
            Trace.beginSection("KeyguardViewMediator.mKeyGuardGoingAwayRunnable");
            try {
                mStatusBarKeyguardViewManager.keyguardGoingAway();

@@ -1611,6 +1665,7 @@ public class KeyguardViewMediator extends SystemUI {
            } catch (RemoteException e) {
                Log.e(TAG, "Error while calling WindowManager", e);
            }
            Trace.endSection();
        }
    };

@@ -1619,6 +1674,7 @@ public class KeyguardViewMediator extends SystemUI {
     * @see #HIDE
     */
    private void handleHide() {
        Trace.beginSection("KeyguardViewMediator#handleHide");
        synchronized (KeyguardViewMediator.this) {
            if (DEBUG) Log.d(TAG, "handleHide");

@@ -1646,6 +1702,7 @@ public class KeyguardViewMediator extends SystemUI {
                        mHideAnimation.getDuration());
            }
        }
        Trace.endSection();
    }

    private void handleOnActivityDrawn() {
@@ -1656,6 +1713,7 @@ public class KeyguardViewMediator extends SystemUI {
    }

    private void handleStartKeyguardExitAnimation(long startTime, long fadeoutDuration) {
        Trace.beginSection("KeyguardViewMediator#handleStartKeyguardExitAnimation");
        synchronized (KeyguardViewMediator.this) {

            if (!mHiding) {
@@ -1686,6 +1744,7 @@ public class KeyguardViewMediator extends SystemUI {
            adjustStatusBarLocked();
            sendUserPresentBroadcast();
        }
        Trace.endSection();
    }

    private void adjustStatusBarLocked() {
@@ -1737,12 +1796,14 @@ public class KeyguardViewMediator extends SystemUI {
     * @see #VERIFY_UNLOCK
     */
    private void handleVerifyUnlock() {
        Trace.beginSection("KeyguardViewMediator#handleVerifyUnlock");
        synchronized (KeyguardViewMediator.this) {
            if (DEBUG) Log.d(TAG, "handleVerifyUnlock");
            setShowingLocked(true);
            mStatusBarKeyguardViewManager.verifyUnlock();
            updateActivityLockScreenState();
        }
        Trace.endSection();
    }

    private void handleNotifyStartedGoingToSleep() {
@@ -1764,13 +1825,16 @@ public class KeyguardViewMediator extends SystemUI {
    }

    private void handleNotifyStartedWakingUp() {
        Trace.beginSection("KeyguardViewMediator#handleMotifyStartedWakingUp");
        synchronized (KeyguardViewMediator.this) {
            if (DEBUG) Log.d(TAG, "handleNotifyWakingUp");
            mStatusBarKeyguardViewManager.onStartedWakingUp();
        }
        Trace.endSection();
    }

    private void handleNotifyScreenTurningOn(IKeyguardDrawnCallback callback) {
        Trace.beginSection("KeyguardViewMediator#handleNotifyScreenTurningOn");
        synchronized (KeyguardViewMediator.this) {
            if (DEBUG) Log.d(TAG, "handleNotifyScreenTurningOn");
            mStatusBarKeyguardViewManager.onScreenTurningOn();
@@ -1782,13 +1846,16 @@ public class KeyguardViewMediator extends SystemUI {
                }
            }
        }
        Trace.endSection();
    }

    private void handleNotifyScreenTurnedOn() {
        Trace.beginSection("KeyguardViewMediator#handleNotifyScreenTurnedOn");
        synchronized (this) {
            if (DEBUG) Log.d(TAG, "handleNotifyScreenTurnedOn");
            mStatusBarKeyguardViewManager.onScreenTurnedOn();
        }
        Trace.endSection();
    }

    private void handleNotifyScreenTurnedOff() {
@@ -1800,11 +1867,13 @@ public class KeyguardViewMediator extends SystemUI {
    }

    private void notifyDrawn(final IKeyguardDrawnCallback callback) {
        Trace.beginSection("KeyguardViewMediator#notifyDrawn");
        try {
            callback.onDrawn();
        } catch (RemoteException e) {
            Slog.w(TAG, "Exception calling onDrawn():", e);
        }
        Trace.endSection();
    }

    private void resetKeyguardDonePendingLocked() {
@@ -1824,8 +1893,10 @@ public class KeyguardViewMediator extends SystemUI {
    }

    public void onWakeAndUnlocking() {
        Trace.beginSection("KeyguardViewMediator#onWakeAndUnlocking");
        mWakeAndUnlocking = true;
        keyguardDone(true /* authenticated */);
        Trace.endSection();
    }

    public StatusBarKeyguardViewManager registerStatusBar(PhoneStatusBar phoneStatusBar,
@@ -1838,9 +1909,11 @@ public class KeyguardViewMediator extends SystemUI {
    }

    public void startKeyguardExitAnimation(long startTime, long fadeoutDuration) {
        Trace.beginSection("KeyguardViewMediator#startKeyguardExitAnimation");
        Message msg = mHandler.obtainMessage(START_KEYGUARD_EXIT_ANIM,
                new StartKeyguardExitAnimParams(startTime, fadeoutDuration));
        mHandler.sendMessage(msg);
        Trace.endSection();
    }

    public void onActivityDrawn() {
+20 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.os.Handler;
import android.os.PowerManager;
import android.os.SystemClock;
import android.os.Trace;
import android.util.Log;

import com.android.keyguard.KeyguardConstants;
@@ -140,11 +141,14 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {

    @Override
    public void onFingerprintAcquired() {
        Trace.beginSection("FingerprintUnlockController#onFingerprintAcquired");
        releaseFingerprintWakeLock();
        if (!mUpdateMonitor.isDeviceInteractive()) {
            mWakeLock = mPowerManager.newWakeLock(
                    PowerManager.PARTIAL_WAKE_LOCK, FINGERPRINT_WAKE_LOCK_NAME);
            Trace.beginSection("acquiring wake-and-unlock");
            mWakeLock.acquire();
            Trace.endSection();
            if (DEBUG_FP_WAKELOCK) {
                Log.i(TAG, "fingerprint acquired, grabbing fp wakelock");
            }
@@ -159,12 +163,15 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
                mStatusBarWindowManager.setForceDozeBrightness(true);
            }
        }
        Trace.endSection();
    }

    @Override
    public void onFingerprintAuthenticated(int userId) {
        Trace.beginSection("FingerprintUnlockController#onFingerprintAuthenticated");
        if (mUpdateMonitor.isGoingToSleep()) {
            mPendingAuthenticatedUserId = userId;
            Trace.endSection();
            return;
        }
        boolean wasDeviceInteractive = mUpdateMonitor.isDeviceInteractive();
@@ -175,25 +182,34 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
            }
            mPowerManager.wakeUp(SystemClock.uptimeMillis(), "android.policy:FINGERPRINT");
        }
        Trace.beginSection("release wake-and-unlock");
        releaseFingerprintWakeLock();
        Trace.endSection();
        switch (mMode) {
            case MODE_DISMISS_BOUNCER:
                Trace.beginSection("MODE_DISMISS");
                mStatusBarKeyguardViewManager.notifyKeyguardAuthenticated(
                        false /* strongAuth */);
                Trace.endSection();
                break;
            case MODE_UNLOCK:
            case MODE_SHOW_BOUNCER:
                Trace.beginSection("MODE_UNLOCK or MODE_SHOW_BOUNCER");
                if (!wasDeviceInteractive) {
                    mStatusBarKeyguardViewManager.notifyDeviceWakeUpRequested();
                }
                mStatusBarKeyguardViewManager.animateCollapsePanels(
                        FINGERPRINT_COLLAPSE_SPEEDUP_FACTOR);
                Trace.endSection();
                break;
            case MODE_WAKE_AND_UNLOCK_PULSING:
                Trace.beginSection("MODE_WAKE_AND_UNLOCK_PULSING");
                mPhoneStatusBar.updateMediaMetaData(false /* metaDataChanged */, 
                        true /* allowEnterAnimation */);
                // Fall through.
                Trace.endSection();
            case MODE_WAKE_AND_UNLOCK:
                Trace.beginSection("MODE_WAKE_AND_UNLOCK");
                mStatusBarWindowManager.setStatusBarFocusable(false);
                mDozeScrimController.abortPulsing();
                mKeyguardViewMediator.onWakeAndUnlocking();
@@ -201,6 +217,7 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
                if (mPhoneStatusBar.getNavigationBarView() != null) {
                    mPhoneStatusBar.getNavigationBarView().setWakeAndUnlocking(true);
                }
                Trace.endSection();
                break;
            case MODE_ONLY_WAKE:
            case MODE_NONE:
@@ -210,6 +227,7 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
            mStatusBarWindowManager.setForceDozeBrightness(false);
        }
        mPhoneStatusBar.notifyFpAuthModeChanged();
        Trace.endSection();
    }

    @Override
@@ -219,6 +237,7 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {

    @Override
    public void onFinishedGoingToSleep(int why) {
        Trace.beginSection("FingerprintUnlockController#onFinishedGoingToSleep");
        if (mPendingAuthenticatedUserId != -1) {

            // Post this to make sure it's executed after the device is fully locked.
@@ -230,6 +249,7 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
            });
        }
        mPendingAuthenticatedUserId = -1;
        Trace.endSection();
    }

    public int getMode() {
+22 −2

File changed.

Preview size limit exceeded, changes collapsed.

Loading