Merge "Fix stuck status bars." into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0038ec1107
@@ -203,7 +203,6 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
|
||||
// the tracker view
|
||||
int mTrackingPosition; // the position of the top of the tracking view.
|
||||
private boolean mPanelSlightlyVisible;
|
||||
|
||||
// ticker
|
||||
private Ticker mTicker;
|
||||
@@ -1235,6 +1234,7 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
+ " mExpandedVisible=" + mExpandedVisible
|
||||
+ " mExpanded=" + mExpanded
|
||||
+ " mAnimating=" + mAnimating
|
||||
+ " mAnimatingReveal=" + mAnimatingReveal
|
||||
+ " mAnimY=" + mAnimY
|
||||
+ " mAnimVel=" + mAnimVel
|
||||
+ " flags=" + flags);
|
||||
@@ -1255,7 +1255,7 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
}
|
||||
|
||||
int y;
|
||||
if (mAnimating) {
|
||||
if (mAnimating || mAnimatingReveal) {
|
||||
y = (int)mAnimY;
|
||||
} else {
|
||||
y = getExpandedViewMaxHeight()-1;
|
||||
@@ -1290,6 +1290,10 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
if (!mExpandedVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure the panel is fully collapsed (just in case; bug 6765842)
|
||||
updateExpandedViewPos(0);
|
||||
|
||||
mExpandedVisible = false;
|
||||
mPile.setLayoutTransitionsEnabled(false);
|
||||
if (mNavigationBarView != null)
|
||||
@@ -2050,9 +2054,14 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
@Override
|
||||
protected void updateExpandedViewPos(int expandedPosition) {
|
||||
if (SPEW) {
|
||||
Slog.d(TAG, "updateExpandedViewPos before expandedPosition=" + expandedPosition
|
||||
Slog.d(TAG, "updateExpandedViewPos: expandedPosition=" + expandedPosition
|
||||
//+ " mTrackingParams.y=" + ((mTrackingParams == null) ? "?" : mTrackingParams.y)
|
||||
+ " mTracking=" + mTracking
|
||||
+ " mTrackingPosition=" + mTrackingPosition
|
||||
+ " mExpandedVisible=" + mExpandedVisible
|
||||
+ " mAnimating=" + mAnimating
|
||||
+ " mAnimatingReveal=" + mAnimatingReveal
|
||||
+ " mClosing=" + mClosing
|
||||
+ " gravity=" + mNotificationPanelGravity);
|
||||
}
|
||||
int panelh = 0;
|
||||
@@ -2061,6 +2070,7 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
// If the expanded view is not visible, make sure they're still off screen.
|
||||
// Maybe the view was resized.
|
||||
if (!mExpandedVisible) {
|
||||
if (SPEW) Slog.d(TAG, "updateExpandedViewPos: view not visible, bailing");
|
||||
updateExpandedInvisiblePosition();
|
||||
return;
|
||||
}
|
||||
@@ -2082,13 +2092,21 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
}
|
||||
|
||||
// catch orientation changes and other peculiar cases
|
||||
if (panelh > disph || (panelh < disph && !mTracking && !mAnimating)) {
|
||||
if (panelh > 0 &&
|
||||
((panelh > disph) ||
|
||||
(panelh < disph && !mTracking && !mAnimating))) {
|
||||
if (SPEW) Slog.d(TAG, "updateExpandedViewPos: orientation change?");
|
||||
panelh = disph;
|
||||
} else if (panelh < 0) {
|
||||
panelh = 0;
|
||||
}
|
||||
|
||||
if (panelh == mTrackingPosition) return;
|
||||
if (SPEW) Slog.d(TAG, "updateExpandedViewPos: adjusting size to panelh=" + panelh);
|
||||
|
||||
if (panelh == mTrackingPosition) {
|
||||
if (SPEW) Slog.d(TAG, "updateExpandedViewPos: panelh == mTrackingPosition, bailing");
|
||||
return;
|
||||
}
|
||||
|
||||
mTrackingPosition = panelh;
|
||||
|
||||
@@ -2248,8 +2266,7 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)
|
||||
|| Intent.ACTION_SCREEN_OFF.equals(action)) {
|
||||
if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {
|
||||
int flags = CommandQueue.FLAG_EXCLUDE_NONE;
|
||||
if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {
|
||||
String reason = intent.getStringExtra("reason");
|
||||
@@ -2259,6 +2276,10 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
}
|
||||
animateCollapse(flags);
|
||||
}
|
||||
else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
|
||||
// no waiting!
|
||||
performCollapse();
|
||||
}
|
||||
else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
|
||||
updateResources();
|
||||
repositionNavigationBar();
|
||||
|
||||
Reference in New Issue
Block a user