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

Commit e0fa592a authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Show enter PIN/PUK before notifications on Keyguard."

parents 69e7ff3a a005f1b6
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -22,10 +22,8 @@ import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.keyguard.KeyguardUpdateMonitor.DisplayClientState;

import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityOptions;
import android.app.SearchManager;
import android.app.admin.DevicePolicyManager;
import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetHostView;
@@ -36,7 +34,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.graphics.Rect;
import android.media.RemoteControlClient;
@@ -44,7 +41,6 @@ import android.os.Bundle;
import android.os.Looper;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemClock;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
@@ -55,9 +51,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.widget.RemoteViews.OnClickHandler;

import java.io.File;
import java.lang.ref.WeakReference;
import java.util.List;

public class KeyguardHostView extends KeyguardViewBase {
    private static final String TAG = "KeyguardHostView";
@@ -595,16 +589,16 @@ public class KeyguardHostView extends KeyguardViewBase {
    };

    @Override
    public void onScreenTurnedOn() {
        super.onScreenTurnedOn();
    public void onResume() {
        super.onResume();
        if (mViewStateManager != null) {
            mViewStateManager.showUsabilityHints();
        }
    }

    @Override
    public void onScreenTurnedOff() {
        super.onScreenTurnedOff();
    public void onPause() {
        super.onPause();
        // We use mAppWidgetToShow to show a particular widget after you add it-- once the screen
        // turns off we reset that behavior
        clearAppWidgetToShow();
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ public class KeyguardSecurityModel {
     * The different types of security available for {@link Mode#UnlockScreen}.
     * @see com.android.internal.policy.impl.LockPatternKeyguardView#getUnlockMode()
     */
    enum SecurityMode {
    public enum SecurityMode {
        Invalid, // NULL state
        None, // No security enabled
        Pattern, // Unlock by drawing a pattern.
+8 −4
Original line number Diff line number Diff line
@@ -217,9 +217,9 @@ public abstract class KeyguardViewBase extends FrameLayout implements SecurityCa
    }

    /**
     * Called when the screen turned off.
     * Called when the Keyguard is not actively shown anymore on the screen.
     */
    public void onScreenTurnedOff() {
    public void onPause() {
        if (DEBUG) Log.d(TAG, String.format("screen off, instance %s at %s",
                Integer.toHexString(hashCode()), SystemClock.uptimeMillis()));
        // Once the screen turns off, we no longer consider this to be first boot and we want the
@@ -231,9 +231,9 @@ public abstract class KeyguardViewBase extends FrameLayout implements SecurityCa
    }

    /**
     * Called when the screen turned on.
     * Called when the Keyguard is actively shown on the screen.
     */
    public void onScreenTurnedOn() {
    public void onResume() {
        if (DEBUG) Log.d(TAG, "screen on, instance " + Integer.toHexString(hashCode()));
        mSecurityContainer.showPrimarySecurityScreen(false);
        mSecurityContainer.onResume(KeyguardSecurityView.SCREEN_ON);
@@ -476,6 +476,10 @@ public abstract class KeyguardViewBase extends FrameLayout implements SecurityCa
        mSecurityContainer.setLockPatternUtils(utils);
    }

    public SecurityMode getSecurityMode() {
        return mSecurityContainer.getSecurityMode();
    }

    protected abstract void onUserSwitching(boolean switching);

    protected abstract void onCreateOptions(Bundle options);
+3 −0
Original line number Diff line number Diff line
@@ -1285,6 +1285,9 @@ public class KeyguardViewMediator extends SystemUI {
                    flags |= StatusBarManager.DISABLE_SEARCH;
                }
            }
            if (isShowingAndNotOccluded()) {
                flags |= StatusBarManager.DISABLE_HOME;
            }

            if (DEBUG) {
                Log.d(TAG, "adjustStatusBarLocked: mShowing=" + mShowing + " mOccluded=" + mOccluded
+18 −12
Original line number Diff line number Diff line
@@ -17,20 +17,18 @@
package com.android.systemui.statusbar.phone;

import android.content.Context;
import android.os.RemoteException;
import android.util.Slog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.android.internal.policy.IKeyguardShowCallback;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardHostView;
import com.android.keyguard.KeyguardViewBase;
import com.android.keyguard.R;
import com.android.keyguard.ViewMediatorCallback;
import com.android.systemui.keyguard.KeyguardViewMediator;

import static com.android.keyguard.KeyguardSecurityModel.*;

/**
 * A class which manages the bouncer on the lockscreen.
 */
@@ -66,6 +64,7 @@ public class KeyguardBouncer {
        if (!mKeyguardView.dismiss()) {
            mRoot.setVisibility(View.VISIBLE);
            mKeyguardView.requestFocus();
            mKeyguardView.onResume();
        }
    }

@@ -84,14 +83,8 @@ public class KeyguardBouncer {
    }

    public void onScreenTurnedOff() {
        if (mKeyguardView != null) {
            mKeyguardView.onScreenTurnedOff();
        }
    }

    public void onScreenTurnedOn() {
        if (mKeyguardView != null) {
            mKeyguardView.onScreenTurnedOn();
        if (mKeyguardView != null && mRoot.getVisibility() == View.VISIBLE) {
            mKeyguardView.onPause();
        }
    }

@@ -136,4 +129,17 @@ public class KeyguardBouncer {
    public boolean onBackPressed() {
        return mKeyguardView != null && mKeyguardView.handleBackKey();
    }

    /**
     * @return True if and only if the current security method should be shown before showing
     *         the notifications on Keyguard, like SIM PIN/PUK.
     */
    public boolean needsFullscreenBouncer() {
        if (mKeyguardView != null) {
            SecurityMode mode = mKeyguardView.getSecurityMode();
            return mode == SecurityMode.SimPin
                    || mode == SecurityMode.SimPuk;
        }
        return false;
    }
}
Loading