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

Commit bb69f73a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Atoms: Keygaurd and Bouncer"

parents 6e0f8e26 dd7bd35f
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
@@ -101,6 +101,9 @@ message Atom {
        OverlayStateChanged overlay_state_changed = 59;
        ForegroundServiceStateChanged foreground_service_state_changed = 60;
        CallStateChanged call_state_changed = 61;
        KeyguardStateChanged keyguard_state_changed = 62;
        KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
        KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
        // TODO: Reorder the numbering so that the most frequent occur events occur in the first 15.
    }

@@ -749,6 +752,63 @@ message CallStateChanged {
    optional bool external_call = 4;
}

/**
 * Logs keyguard state. The keyguard is the lock screen.
 *
 * Logged from:
 *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
 */
message KeyguardStateChanged {
    enum State {
        UNKNOWN = 0;
        // The keyguard is hidden when the phone is unlocked.
        HIDDEN = 1;
        // The keyguard is shown when the phone is locked (screen turns off).
        SHOWN= 2;
        // The keyguard is occluded when something is overlaying the keyguard.
        // Eg. Opening the camera while on the lock screen.
        OCCLUDED = 3;
    }
    optional State state = 1;
}

/**
 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
 * prompts the user to enter a password (pattern, pin, etc).
 *
 * Logged from:
 *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
 */

message KeyguardBouncerStateChanged {
    enum State {
        UNKNOWN = 0;
        // Bouncer is hidden, either as a result of successfully entering the
        // password, screen timing out, or user going back to lock screen.
        HIDDEN = 1;
        // This is when the user is being prompted to enter the password.
        SHOWN = 2;
    }
    optional State state = 1;
}

/**
 * Logs the result of entering a password into the keyguard bouncer.
 *
 * Logged from:
 *   frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
 */
message KeyguardBouncerPasswordEntered {
    enum BouncerResult {
        UNKNOWN = 0;
        // The password entered was incorrect.
        FAILURE = 1;
        // The password entered was correct.
        SUCCESS = 2;
    }
    optional BouncerResult result = 1;
}

/**
 * Logs the duration of a davey (jank of >=700ms) when it occurs
 *
+5 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.support.annotation.VisibleForTesting;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Slog;
import android.util.StatsLog;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
@@ -430,9 +431,13 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
        public void reportUnlockAttempt(int userId, boolean success, int timeoutMs) {
            KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext);
            if (success) {
                StatsLog.write(StatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED,
                    StatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED__RESULT__SUCCESS);
                monitor.clearFailedUnlockAttempts();
                mLockPatternUtils.reportSuccessfulPasswordAttempt(userId);
            } else {
                StatsLog.write(StatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED,
                    StatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED__RESULT__FAILURE);
                KeyguardSecurityContainer.this.reportFailedUnlockAttempt(userId, timeoutMs);
            }
        }
+5 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.os.Handler;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.Slog;
import android.util.StatsLog;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
@@ -152,6 +153,8 @@ public class KeyguardBouncer {
                mKeyguardView.requestLayout();
            }
            mShowingSoon = false;
            StatsLog.write(StatsLog.KEYGUARD_BOUNCER_STATE_CHANGED,
                StatsLog.KEYGUARD_BOUNCER_STATE_CHANGED__STATE__SHOWN);
        }
    };

@@ -183,6 +186,8 @@ public class KeyguardBouncer {

    public void hide(boolean destroyView) {
        if (isShowing()) {
            StatsLog.write(StatsLog.KEYGUARD_BOUNCER_STATE_CHANGED,
                StatsLog.KEYGUARD_BOUNCER_STATE_CHANGED__STATE__HIDDEN);
            mDismissCallbackRegistry.notifyDismissCancelled();
        }
        mFalsingManager.onBouncerHidden();
+10 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.ComponentCallbacks2;
import android.content.Context;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.StatsLog;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
@@ -140,6 +141,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        mShowing = true;
        mStatusBarWindowManager.setKeyguardShowing(true);
        reset(true /* hideBouncerWhenShowing */);
        StatsLog.write(StatsLog.KEYGUARD_STATE_CHANGED,
            StatsLog.KEYGUARD_STATE_CHANGED__STATE__SHOWN);
    }

    /**
@@ -289,6 +292,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    public void setOccluded(boolean occluded, boolean animate) {
        mStatusBar.setOccluded(occluded);
        if (occluded && !mOccluded && mShowing) {
            StatsLog.write(StatsLog.KEYGUARD_STATE_CHANGED,
                StatsLog.KEYGUARD_STATE_CHANGED__STATE__OCCLUDED);
            if (mStatusBar.isInLaunchTransition()) {
                mOccluded = true;
                mStatusBar.fadeKeyguardAfterLaunchTransition(null /* beforeFading */,
@@ -301,6 +306,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
                        });
                return;
            }
        } else if (!occluded && mOccluded && mShowing) {
            StatsLog.write(StatsLog.KEYGUARD_STATE_CHANGED,
                StatsLog.KEYGUARD_STATE_CHANGED__STATE__SHOWN);
        }
        boolean isOccluding = !mOccluded && occluded;
        mOccluded = occluded;
@@ -398,6 +406,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
            mStatusBarWindowManager.setKeyguardShowing(false);
            mViewMediatorCallback.keyguardGone();
        }
        StatsLog.write(StatsLog.KEYGUARD_STATE_CHANGED,
            StatsLog.KEYGUARD_STATE_CHANGED__STATE__HIDDEN);
    }

    public void onDensityOrFontScaleChanged() {