Loading packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java +4 −10 Original line number Original line Diff line number Diff line Loading @@ -22,10 +22,8 @@ import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.keyguard.KeyguardUpdateMonitor.DisplayClientState; import com.android.keyguard.KeyguardUpdateMonitor.DisplayClientState; import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.ActivityOptions; import android.app.SearchManager; import android.app.admin.DevicePolicyManager; import android.app.admin.DevicePolicyManager; import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetHostView; import android.appwidget.AppWidgetHostView; Loading @@ -36,7 +34,6 @@ import android.content.Context; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.UserInfo; import android.content.res.Resources; import android.content.res.Resources; import android.graphics.Rect; import android.graphics.Rect; import android.media.RemoteControlClient; import android.media.RemoteControlClient; Loading @@ -44,7 +41,6 @@ import android.os.Bundle; import android.os.Looper; import android.os.Looper; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserHandle; import android.os.UserManager; import android.os.UserManager; import android.provider.Settings; import android.provider.Settings; Loading @@ -55,9 +51,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.View; import android.widget.RemoteViews.OnClickHandler; import android.widget.RemoteViews.OnClickHandler; import java.io.File; import java.lang.ref.WeakReference; import java.lang.ref.WeakReference; import java.util.List; public class KeyguardHostView extends KeyguardViewBase { public class KeyguardHostView extends KeyguardViewBase { private static final String TAG = "KeyguardHostView"; private static final String TAG = "KeyguardHostView"; Loading Loading @@ -595,16 +589,16 @@ public class KeyguardHostView extends KeyguardViewBase { }; }; @Override @Override public void onScreenTurnedOn() { public void onResume() { super.onScreenTurnedOn(); super.onResume(); if (mViewStateManager != null) { if (mViewStateManager != null) { mViewStateManager.showUsabilityHints(); mViewStateManager.showUsabilityHints(); } } } } @Override @Override public void onScreenTurnedOff() { public void onPause() { super.onScreenTurnedOff(); super.onPause(); // We use mAppWidgetToShow to show a particular widget after you add it-- once the screen // We use mAppWidgetToShow to show a particular widget after you add it-- once the screen // turns off we reset that behavior // turns off we reset that behavior clearAppWidgetToShow(); clearAppWidgetToShow(); Loading packages/Keyguard/src/com/android/keyguard/KeyguardSecurityModel.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ public class KeyguardSecurityModel { * The different types of security available for {@link Mode#UnlockScreen}. * The different types of security available for {@link Mode#UnlockScreen}. * @see com.android.internal.policy.impl.LockPatternKeyguardView#getUnlockMode() * @see com.android.internal.policy.impl.LockPatternKeyguardView#getUnlockMode() */ */ enum SecurityMode { public enum SecurityMode { Invalid, // NULL state Invalid, // NULL state None, // No security enabled None, // No security enabled Pattern, // Unlock by drawing a pattern. Pattern, // Unlock by drawing a pattern. Loading packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java +8 −4 Original line number Original line Diff line number Diff line Loading @@ -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", if (DEBUG) Log.d(TAG, String.format("screen off, instance %s at %s", Integer.toHexString(hashCode()), SystemClock.uptimeMillis())); Integer.toHexString(hashCode()), SystemClock.uptimeMillis())); // Once the screen turns off, we no longer consider this to be first boot and we want the // Once the screen turns off, we no longer consider this to be first boot and we want the Loading @@ -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())); if (DEBUG) Log.d(TAG, "screen on, instance " + Integer.toHexString(hashCode())); mSecurityContainer.showPrimarySecurityScreen(false); mSecurityContainer.showPrimarySecurityScreen(false); mSecurityContainer.onResume(KeyguardSecurityView.SCREEN_ON); mSecurityContainer.onResume(KeyguardSecurityView.SCREEN_ON); Loading Loading @@ -476,6 +476,10 @@ public abstract class KeyguardViewBase extends FrameLayout implements SecurityCa mSecurityContainer.setLockPatternUtils(utils); mSecurityContainer.setLockPatternUtils(utils); } } public SecurityMode getSecurityMode() { return mSecurityContainer.getSecurityMode(); } protected abstract void onUserSwitching(boolean switching); protected abstract void onUserSwitching(boolean switching); protected abstract void onCreateOptions(Bundle options); protected abstract void onCreateOptions(Bundle options); Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1285,6 +1285,9 @@ public class KeyguardViewMediator extends SystemUI { flags |= StatusBarManager.DISABLE_SEARCH; flags |= StatusBarManager.DISABLE_SEARCH; } } } } if (isShowingAndNotOccluded()) { flags |= StatusBarManager.DISABLE_HOME; } if (DEBUG) { if (DEBUG) { Log.d(TAG, "adjustStatusBarLocked: mShowing=" + mShowing + " mOccluded=" + mOccluded Log.d(TAG, "adjustStatusBarLocked: mShowing=" + mShowing + " mOccluded=" + mOccluded Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +18 −12 Original line number Original line Diff line number Diff line Loading @@ -17,20 +17,18 @@ package com.android.systemui.statusbar.phone; package com.android.systemui.statusbar.phone; import android.content.Context; import android.content.Context; import android.os.RemoteException; import android.util.Slog; import android.view.LayoutInflater; import android.view.LayoutInflater; import android.view.View; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup; import com.android.internal.policy.IKeyguardShowCallback; import com.android.internal.widget.LockPatternUtils; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardHostView; import com.android.keyguard.KeyguardViewBase; import com.android.keyguard.KeyguardViewBase; import com.android.keyguard.R; import com.android.keyguard.R; import com.android.keyguard.ViewMediatorCallback; import com.android.keyguard.ViewMediatorCallback; import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.keyguard.KeyguardViewMediator; import static com.android.keyguard.KeyguardSecurityModel.*; /** /** * A class which manages the bouncer on the lockscreen. * A class which manages the bouncer on the lockscreen. */ */ Loading Loading @@ -66,6 +64,7 @@ public class KeyguardBouncer { if (!mKeyguardView.dismiss()) { if (!mKeyguardView.dismiss()) { mRoot.setVisibility(View.VISIBLE); mRoot.setVisibility(View.VISIBLE); mKeyguardView.requestFocus(); mKeyguardView.requestFocus(); mKeyguardView.onResume(); } } } } Loading @@ -84,14 +83,8 @@ public class KeyguardBouncer { } } public void onScreenTurnedOff() { public void onScreenTurnedOff() { if (mKeyguardView != null) { if (mKeyguardView != null && mRoot.getVisibility() == View.VISIBLE) { mKeyguardView.onScreenTurnedOff(); mKeyguardView.onPause(); } } public void onScreenTurnedOn() { if (mKeyguardView != null) { mKeyguardView.onScreenTurnedOn(); } } } } Loading Loading @@ -136,4 +129,17 @@ public class KeyguardBouncer { public boolean onBackPressed() { public boolean onBackPressed() { return mKeyguardView != null && mKeyguardView.handleBackKey(); 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
packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java +4 −10 Original line number Original line Diff line number Diff line Loading @@ -22,10 +22,8 @@ import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.keyguard.KeyguardUpdateMonitor.DisplayClientState; import com.android.keyguard.KeyguardUpdateMonitor.DisplayClientState; import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.ActivityOptions; import android.app.SearchManager; import android.app.admin.DevicePolicyManager; import android.app.admin.DevicePolicyManager; import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetHostView; import android.appwidget.AppWidgetHostView; Loading @@ -36,7 +34,6 @@ import android.content.Context; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.UserInfo; import android.content.res.Resources; import android.content.res.Resources; import android.graphics.Rect; import android.graphics.Rect; import android.media.RemoteControlClient; import android.media.RemoteControlClient; Loading @@ -44,7 +41,6 @@ import android.os.Bundle; import android.os.Looper; import android.os.Looper; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserHandle; import android.os.UserManager; import android.os.UserManager; import android.provider.Settings; import android.provider.Settings; Loading @@ -55,9 +51,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.View; import android.widget.RemoteViews.OnClickHandler; import android.widget.RemoteViews.OnClickHandler; import java.io.File; import java.lang.ref.WeakReference; import java.lang.ref.WeakReference; import java.util.List; public class KeyguardHostView extends KeyguardViewBase { public class KeyguardHostView extends KeyguardViewBase { private static final String TAG = "KeyguardHostView"; private static final String TAG = "KeyguardHostView"; Loading Loading @@ -595,16 +589,16 @@ public class KeyguardHostView extends KeyguardViewBase { }; }; @Override @Override public void onScreenTurnedOn() { public void onResume() { super.onScreenTurnedOn(); super.onResume(); if (mViewStateManager != null) { if (mViewStateManager != null) { mViewStateManager.showUsabilityHints(); mViewStateManager.showUsabilityHints(); } } } } @Override @Override public void onScreenTurnedOff() { public void onPause() { super.onScreenTurnedOff(); super.onPause(); // We use mAppWidgetToShow to show a particular widget after you add it-- once the screen // We use mAppWidgetToShow to show a particular widget after you add it-- once the screen // turns off we reset that behavior // turns off we reset that behavior clearAppWidgetToShow(); clearAppWidgetToShow(); Loading
packages/Keyguard/src/com/android/keyguard/KeyguardSecurityModel.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ public class KeyguardSecurityModel { * The different types of security available for {@link Mode#UnlockScreen}. * The different types of security available for {@link Mode#UnlockScreen}. * @see com.android.internal.policy.impl.LockPatternKeyguardView#getUnlockMode() * @see com.android.internal.policy.impl.LockPatternKeyguardView#getUnlockMode() */ */ enum SecurityMode { public enum SecurityMode { Invalid, // NULL state Invalid, // NULL state None, // No security enabled None, // No security enabled Pattern, // Unlock by drawing a pattern. Pattern, // Unlock by drawing a pattern. Loading
packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java +8 −4 Original line number Original line Diff line number Diff line Loading @@ -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", if (DEBUG) Log.d(TAG, String.format("screen off, instance %s at %s", Integer.toHexString(hashCode()), SystemClock.uptimeMillis())); Integer.toHexString(hashCode()), SystemClock.uptimeMillis())); // Once the screen turns off, we no longer consider this to be first boot and we want the // Once the screen turns off, we no longer consider this to be first boot and we want the Loading @@ -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())); if (DEBUG) Log.d(TAG, "screen on, instance " + Integer.toHexString(hashCode())); mSecurityContainer.showPrimarySecurityScreen(false); mSecurityContainer.showPrimarySecurityScreen(false); mSecurityContainer.onResume(KeyguardSecurityView.SCREEN_ON); mSecurityContainer.onResume(KeyguardSecurityView.SCREEN_ON); Loading Loading @@ -476,6 +476,10 @@ public abstract class KeyguardViewBase extends FrameLayout implements SecurityCa mSecurityContainer.setLockPatternUtils(utils); mSecurityContainer.setLockPatternUtils(utils); } } public SecurityMode getSecurityMode() { return mSecurityContainer.getSecurityMode(); } protected abstract void onUserSwitching(boolean switching); protected abstract void onUserSwitching(boolean switching); protected abstract void onCreateOptions(Bundle options); protected abstract void onCreateOptions(Bundle options); Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1285,6 +1285,9 @@ public class KeyguardViewMediator extends SystemUI { flags |= StatusBarManager.DISABLE_SEARCH; flags |= StatusBarManager.DISABLE_SEARCH; } } } } if (isShowingAndNotOccluded()) { flags |= StatusBarManager.DISABLE_HOME; } if (DEBUG) { if (DEBUG) { Log.d(TAG, "adjustStatusBarLocked: mShowing=" + mShowing + " mOccluded=" + mOccluded Log.d(TAG, "adjustStatusBarLocked: mShowing=" + mShowing + " mOccluded=" + mOccluded Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +18 −12 Original line number Original line Diff line number Diff line Loading @@ -17,20 +17,18 @@ package com.android.systemui.statusbar.phone; package com.android.systemui.statusbar.phone; import android.content.Context; import android.content.Context; import android.os.RemoteException; import android.util.Slog; import android.view.LayoutInflater; import android.view.LayoutInflater; import android.view.View; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup; import com.android.internal.policy.IKeyguardShowCallback; import com.android.internal.widget.LockPatternUtils; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardHostView; import com.android.keyguard.KeyguardViewBase; import com.android.keyguard.KeyguardViewBase; import com.android.keyguard.R; import com.android.keyguard.R; import com.android.keyguard.ViewMediatorCallback; import com.android.keyguard.ViewMediatorCallback; import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.keyguard.KeyguardViewMediator; import static com.android.keyguard.KeyguardSecurityModel.*; /** /** * A class which manages the bouncer on the lockscreen. * A class which manages the bouncer on the lockscreen. */ */ Loading Loading @@ -66,6 +64,7 @@ public class KeyguardBouncer { if (!mKeyguardView.dismiss()) { if (!mKeyguardView.dismiss()) { mRoot.setVisibility(View.VISIBLE); mRoot.setVisibility(View.VISIBLE); mKeyguardView.requestFocus(); mKeyguardView.requestFocus(); mKeyguardView.onResume(); } } } } Loading @@ -84,14 +83,8 @@ public class KeyguardBouncer { } } public void onScreenTurnedOff() { public void onScreenTurnedOff() { if (mKeyguardView != null) { if (mKeyguardView != null && mRoot.getVisibility() == View.VISIBLE) { mKeyguardView.onScreenTurnedOff(); mKeyguardView.onPause(); } } public void onScreenTurnedOn() { if (mKeyguardView != null) { mKeyguardView.onScreenTurnedOn(); } } } } Loading Loading @@ -136,4 +129,17 @@ public class KeyguardBouncer { public boolean onBackPressed() { public boolean onBackPressed() { return mKeyguardView != null && mKeyguardView.handleBackKey(); 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; } } }