From dcdd29781a85c3cdc55d495cd8e77d9628b20010 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Tue, 3 Nov 2009 13:18:03 -0800 Subject: [PATCH] Revert "Revert "fix 2233092 - Notification shade gets stuck half-open"" This reverts commit b96a9d9296925fef6a1c0e5ad4d847d96bf9acb5. --- .../server/status/StatusBarService.java | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/services/java/com/android/server/status/StatusBarService.java b/services/java/com/android/server/status/StatusBarService.java index 59e9832c18fe6..31ee1d3845866 100644 --- a/services/java/com/android/server/status/StatusBarService.java +++ b/services/java/com/android/server/status/StatusBarService.java @@ -692,6 +692,7 @@ public class StatusBarService extends IStatusBar.Stub mTicker.addEntry(n, StatusBarIcon.getIcon(mContext, data), n.tickerText); } } + updateExpandedViewPos(EXPANDED_LEAVE_ALONE); } // icon @@ -1558,15 +1559,24 @@ public class StatusBarService extends IStatusBar.Stub + " mTrackingPosition=" + mTrackingPosition); } - // If the expanded view is not visible, there is no reason to do - // any work. - if (!mExpandedVisible) { - return; - } - - // tracking view... int h = mStatusBarView.getHeight(); int disph = mDisplay.getHeight(); + + // If the expanded view is not visible, make sure they're still off screen. + // Maybe the view was resized. + if (!mExpandedVisible) { + if (mTrackingView != null) { + mTrackingPosition = mTrackingParams.y = -disph; + WindowManagerImpl.getDefault().updateViewLayout(mTrackingView, mTrackingParams); + } + if (mExpandedParams != null) { + mExpandedParams.y = -disph; + mExpandedDialog.getWindow().setAttributes(mExpandedParams); + } + return; + } + + // tracking view... int pos; if (expandedPosition == EXPANDED_FULL_OPEN) { pos = h; @@ -1677,7 +1687,7 @@ public class StatusBarService extends IStatusBar.Stub private View.OnClickListener mClearButtonListener = new View.OnClickListener() { public void onClick(View v) { mNotificationCallbacks.onClearAll(); - performCollapse(); + addPendingOp(OP_EXPAND, null, false); } };