Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +25 −4 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.phone; import android.content.Context; import android.view.Choreographer; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; Loading @@ -43,7 +44,8 @@ public class KeyguardBouncer { private StatusBarWindowManager mWindowManager; private KeyguardViewBase mKeyguardView; private ViewGroup mRoot; private boolean mFadingOut; private boolean mShowingSoon; private Choreographer mChoreographer = Choreographer.getInstance(); public KeyguardBouncer(Context context, ViewMediatorCallback callback, LockPatternUtils lockPatternUtils, StatusBarWindowManager windowManager, Loading @@ -57,7 +59,7 @@ public class KeyguardBouncer { public void show() { ensureView(); if (mRoot.getVisibility() == View.VISIBLE) { if (mRoot.getVisibility() == View.VISIBLE || mShowingSoon) { // show() updates the current security method. This is needed in case we are already // showing and the current security method changed. Loading @@ -68,10 +70,27 @@ public class KeyguardBouncer { // Try to dismiss the Keyguard. If no security pattern is set, this will dismiss the whole // Keyguard. If we need to authenticate, show the bouncer. if (!mKeyguardView.dismiss()) { mShowingSoon = true; // Split up the work over multiple frames. mChoreographer.postCallbackDelayed(Choreographer.CALLBACK_ANIMATION, mShowRunnable, null, 48); } } private final Runnable mShowRunnable = new Runnable() { @Override public void run() { mRoot.setVisibility(View.VISIBLE); mKeyguardView.onResume(); mKeyguardView.startAppearAnimation(); mShowingSoon = false; } }; private void cancelShowRunnable() { mChoreographer.removeCallbacks(Choreographer.CALLBACK_ANIMATION, mShowRunnable, null); mShowingSoon = false; } public void showWithDismissAction(OnDismissAction r) { Loading @@ -81,6 +100,7 @@ public class KeyguardBouncer { } public void hide(boolean destroyView) { cancelShowRunnable(); if (mKeyguardView != null) { mKeyguardView.setOnDismissAction(null); mKeyguardView.cleanUp(); Loading @@ -107,6 +127,7 @@ public class KeyguardBouncer { * Reset the state of the view. */ public void reset() { cancelShowRunnable(); inflateView(); } Loading @@ -127,7 +148,7 @@ public class KeyguardBouncer { } public boolean isShowing() { return mRoot != null && mRoot.getVisibility() == View.VISIBLE && !mFadingOut; return mShowingSoon || (mRoot != null && mRoot.getVisibility() == View.VISIBLE); } public void prepare() { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +10 −1 Original line number Diff line number Diff line Loading @@ -507,7 +507,16 @@ public class NavigationBarView extends LinearLayout { } } @Override public void setVisibility(int visibility) { super.setVisibility(visibility); boolean visible = visibility == View.VISIBLE; getBackButton().getBackground().setVisible(visible, false /* restart */); getHomeButton().getBackground().setVisible(visible, false /* restart */); getRecentsButton().getBackground().setVisible(visible, false /* restart */); getMenuButton().getBackground().setVisible(visible, false /* restart */); getImeSwitchButton().getBackground().setVisible(visible, false /* restart */); } /* @Override Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +4 −2 Original line number Diff line number Diff line Loading @@ -2364,8 +2364,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mStackScroller.setVisibility(View.VISIBLE); mNotificationPanel.setVisibility(View.GONE); setAreThereNotifications(); // show the clear button mNotificationPanel.closeQs(); mExpandedVisible = false; Loading Loading @@ -3580,6 +3578,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, disable(mDisabledUnmodified, true /* animate */); } public boolean isKeyguardFadingAway() { return mKeyguardFadingAway; } /** * Notifies that the Keyguard fading away animation is done. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +26 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,10 @@ public class StatusBarKeyguardViewManager { // When hiding the Keyguard with timing supplied from WindowManager, better be early than late. private static final long HIDE_TIMING_CORRECTION_MS = -3 * 16; // Delay for showing the navigation bar when the bouncer appears. This should be kept in sync // with the appear animations of the PIN/pattern/password views. private static final long NAV_BAR_SHOW_DELAY_BOUNCER = 320; private static String TAG = "StatusBarKeyguardViewManager"; private final Context mContext; Loading Loading @@ -323,12 +327,30 @@ public class StatusBarKeyguardViewManager { return mBouncer.isShowing(); } private long getNavBarShowDelay() { if (mPhoneStatusBar.isKeyguardFadingAway()) { return mPhoneStatusBar.getKeyguardFadingAwayDelay(); } else { // Keyguard is not going away, thus we are showing the navigation bar because the // bouncer is appearing. return NAV_BAR_SHOW_DELAY_BOUNCER; } } private Runnable mMakeNavigationBarVisibleRunnable = new Runnable() { @Override public void run() { mPhoneStatusBar.getNavigationBarView().setVisibility(View.VISIBLE); } }; private void updateStates() { int vis = mContainer.getSystemUiVisibility(); boolean showing = mShowing; boolean occluded = mOccluded; boolean bouncerShowing = mBouncer.isShowing(); boolean bouncerDismissible = bouncerShowing && !mBouncer.needsFullscreenBouncer(); boolean bouncerDismissible = !mBouncer.needsFullscreenBouncer(); if ((bouncerDismissible || !showing) != (mLastBouncerDismissible || !mLastShowing) || mFirstUpdate) { Loading @@ -342,8 +364,10 @@ public class StatusBarKeyguardViewManager { != (!(mLastShowing && !mLastOccluded) || mLastBouncerShowing) || mFirstUpdate) { if (mPhoneStatusBar.getNavigationBarView() != null) { if (!(showing && !occluded) || bouncerShowing) { mPhoneStatusBar.getNavigationBarView().setVisibility(View.VISIBLE); mContainer.postOnAnimationDelayed(mMakeNavigationBarVisibleRunnable, getNavBarShowDelay()); } else { mContainer.removeCallbacks(mMakeNavigationBarVisibleRunnable); mPhoneStatusBar.getNavigationBarView().setVisibility(View.GONE); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +14 −2 Original line number Diff line number Diff line Loading @@ -55,13 +55,25 @@ public class StatusBarWindowView extends FrameLayout { @Override protected boolean fitSystemWindows(Rect insets) { if (getFitsSystemWindows()) { boolean changed = insets.left != getPaddingLeft() || insets.top != getPaddingTop() || insets.right != getPaddingRight() || insets.bottom != getPaddingBottom(); if (changed) { setPadding(insets.left, insets.top, insets.right, 0); } insets.left = 0; insets.top = 0; insets.right = 0; } else { boolean changed = getPaddingLeft() != 0 || getPaddingRight() != 0 || getPaddingTop() != 0 || getPaddingBottom() != 0; if (changed) { setPadding(0, 0, 0, 0); } } return false; } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +25 −4 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.phone; import android.content.Context; import android.view.Choreographer; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; Loading @@ -43,7 +44,8 @@ public class KeyguardBouncer { private StatusBarWindowManager mWindowManager; private KeyguardViewBase mKeyguardView; private ViewGroup mRoot; private boolean mFadingOut; private boolean mShowingSoon; private Choreographer mChoreographer = Choreographer.getInstance(); public KeyguardBouncer(Context context, ViewMediatorCallback callback, LockPatternUtils lockPatternUtils, StatusBarWindowManager windowManager, Loading @@ -57,7 +59,7 @@ public class KeyguardBouncer { public void show() { ensureView(); if (mRoot.getVisibility() == View.VISIBLE) { if (mRoot.getVisibility() == View.VISIBLE || mShowingSoon) { // show() updates the current security method. This is needed in case we are already // showing and the current security method changed. Loading @@ -68,10 +70,27 @@ public class KeyguardBouncer { // Try to dismiss the Keyguard. If no security pattern is set, this will dismiss the whole // Keyguard. If we need to authenticate, show the bouncer. if (!mKeyguardView.dismiss()) { mShowingSoon = true; // Split up the work over multiple frames. mChoreographer.postCallbackDelayed(Choreographer.CALLBACK_ANIMATION, mShowRunnable, null, 48); } } private final Runnable mShowRunnable = new Runnable() { @Override public void run() { mRoot.setVisibility(View.VISIBLE); mKeyguardView.onResume(); mKeyguardView.startAppearAnimation(); mShowingSoon = false; } }; private void cancelShowRunnable() { mChoreographer.removeCallbacks(Choreographer.CALLBACK_ANIMATION, mShowRunnable, null); mShowingSoon = false; } public void showWithDismissAction(OnDismissAction r) { Loading @@ -81,6 +100,7 @@ public class KeyguardBouncer { } public void hide(boolean destroyView) { cancelShowRunnable(); if (mKeyguardView != null) { mKeyguardView.setOnDismissAction(null); mKeyguardView.cleanUp(); Loading @@ -107,6 +127,7 @@ public class KeyguardBouncer { * Reset the state of the view. */ public void reset() { cancelShowRunnable(); inflateView(); } Loading @@ -127,7 +148,7 @@ public class KeyguardBouncer { } public boolean isShowing() { return mRoot != null && mRoot.getVisibility() == View.VISIBLE && !mFadingOut; return mShowingSoon || (mRoot != null && mRoot.getVisibility() == View.VISIBLE); } public void prepare() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +10 −1 Original line number Diff line number Diff line Loading @@ -507,7 +507,16 @@ public class NavigationBarView extends LinearLayout { } } @Override public void setVisibility(int visibility) { super.setVisibility(visibility); boolean visible = visibility == View.VISIBLE; getBackButton().getBackground().setVisible(visible, false /* restart */); getHomeButton().getBackground().setVisible(visible, false /* restart */); getRecentsButton().getBackground().setVisible(visible, false /* restart */); getMenuButton().getBackground().setVisible(visible, false /* restart */); getImeSwitchButton().getBackground().setVisible(visible, false /* restart */); } /* @Override Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +4 −2 Original line number Diff line number Diff line Loading @@ -2364,8 +2364,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mStackScroller.setVisibility(View.VISIBLE); mNotificationPanel.setVisibility(View.GONE); setAreThereNotifications(); // show the clear button mNotificationPanel.closeQs(); mExpandedVisible = false; Loading Loading @@ -3580,6 +3578,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, disable(mDisabledUnmodified, true /* animate */); } public boolean isKeyguardFadingAway() { return mKeyguardFadingAway; } /** * Notifies that the Keyguard fading away animation is done. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +26 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,10 @@ public class StatusBarKeyguardViewManager { // When hiding the Keyguard with timing supplied from WindowManager, better be early than late. private static final long HIDE_TIMING_CORRECTION_MS = -3 * 16; // Delay for showing the navigation bar when the bouncer appears. This should be kept in sync // with the appear animations of the PIN/pattern/password views. private static final long NAV_BAR_SHOW_DELAY_BOUNCER = 320; private static String TAG = "StatusBarKeyguardViewManager"; private final Context mContext; Loading Loading @@ -323,12 +327,30 @@ public class StatusBarKeyguardViewManager { return mBouncer.isShowing(); } private long getNavBarShowDelay() { if (mPhoneStatusBar.isKeyguardFadingAway()) { return mPhoneStatusBar.getKeyguardFadingAwayDelay(); } else { // Keyguard is not going away, thus we are showing the navigation bar because the // bouncer is appearing. return NAV_BAR_SHOW_DELAY_BOUNCER; } } private Runnable mMakeNavigationBarVisibleRunnable = new Runnable() { @Override public void run() { mPhoneStatusBar.getNavigationBarView().setVisibility(View.VISIBLE); } }; private void updateStates() { int vis = mContainer.getSystemUiVisibility(); boolean showing = mShowing; boolean occluded = mOccluded; boolean bouncerShowing = mBouncer.isShowing(); boolean bouncerDismissible = bouncerShowing && !mBouncer.needsFullscreenBouncer(); boolean bouncerDismissible = !mBouncer.needsFullscreenBouncer(); if ((bouncerDismissible || !showing) != (mLastBouncerDismissible || !mLastShowing) || mFirstUpdate) { Loading @@ -342,8 +364,10 @@ public class StatusBarKeyguardViewManager { != (!(mLastShowing && !mLastOccluded) || mLastBouncerShowing) || mFirstUpdate) { if (mPhoneStatusBar.getNavigationBarView() != null) { if (!(showing && !occluded) || bouncerShowing) { mPhoneStatusBar.getNavigationBarView().setVisibility(View.VISIBLE); mContainer.postOnAnimationDelayed(mMakeNavigationBarVisibleRunnable, getNavBarShowDelay()); } else { mContainer.removeCallbacks(mMakeNavigationBarVisibleRunnable); mPhoneStatusBar.getNavigationBarView().setVisibility(View.GONE); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +14 −2 Original line number Diff line number Diff line Loading @@ -55,13 +55,25 @@ public class StatusBarWindowView extends FrameLayout { @Override protected boolean fitSystemWindows(Rect insets) { if (getFitsSystemWindows()) { boolean changed = insets.left != getPaddingLeft() || insets.top != getPaddingTop() || insets.right != getPaddingRight() || insets.bottom != getPaddingBottom(); if (changed) { setPadding(insets.left, insets.top, insets.right, 0); } insets.left = 0; insets.top = 0; insets.right = 0; } else { boolean changed = getPaddingLeft() != 0 || getPaddingRight() != 0 || getPaddingTop() != 0 || getPaddingBottom() != 0; if (changed) { setPadding(0, 0, 0, 0); } } return false; } Loading