From 0d7dc3b800d0489c43ad9071615b2b4ebec80443 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Mon, 2 Nov 2009 16:20:44 -0500 Subject: Fix notification bar performance. Bug 2195678 We had all this stuff there to keep the notification view around so it doesn't need to be reconstructed each time, and we weren't using it. This fixes that, and it looks much better now. --- .../java/com/android/server/status/StatusBarService.java | 14 +++++++++----- .../com/android/server/status/TrackingPatternView.java | 2 -- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/services/java/com/android/server/status/StatusBarService.java b/services/java/com/android/server/status/StatusBarService.java index 59e9832c18fe..8dded1a8a6e8 100644 --- a/services/java/com/android/server/status/StatusBarService.java +++ b/services/java/com/android/server/status/StatusBarService.java @@ -950,7 +950,8 @@ public class StatusBarService extends IStatusBar.Stub panelSlightlyVisible(true); updateExpandedViewPos(EXPANDED_LEAVE_ALONE); - mExpandedDialog.show(); + mExpandedParams.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; + mExpandedDialog.getWindow().setAttributes(mExpandedParams); mExpandedView.requestFocus(View.FOCUS_FORWARD); mTrackingView.setVisibility(View.VISIBLE); @@ -1027,7 +1028,8 @@ public class StatusBarService extends IStatusBar.Stub } mExpandedVisible = false; panelSlightlyVisible(false); - mExpandedDialog.hide(); + mExpandedParams.flags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; + mExpandedDialog.getWindow().setAttributes(mExpandedParams); mTrackingView.setVisibility(View.GONE); if ((mDisabled & StatusBarManager.DISABLE_NOTIFICATION_ICONS) == 0) { @@ -1056,6 +1058,7 @@ public class StatusBarService extends IStatusBar.Stub else if (mAnimY < mStatusBarView.getHeight()) { if (SPEW) Log.d(TAG, "Animation completed to collapsed state."); mAnimating = false; + updateExpandedViewPos(0); performCollapse(); } else { @@ -1508,17 +1511,19 @@ public class StatusBarService extends IStatusBar.Stub } } + final int disph = mDisplay.getHeight(); lp = mExpandedDialog.getWindow().getAttributes(); lp.width = ViewGroup.LayoutParams.FILL_PARENT; lp.height = ViewGroup.LayoutParams.WRAP_CONTENT; lp.x = 0; - lp.y = 0; + mTrackingPosition = lp.y = -disph; // sufficiently large negative lp.type = WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL; lp.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM - | WindowManager.LayoutParams.FLAG_DITHER; + | WindowManager.LayoutParams.FLAG_DITHER + | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; lp.format = pixelFormat; lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL; lp.setTitle("StatusBarExpanded"); @@ -1531,7 +1536,6 @@ public class StatusBarService extends IStatusBar.Stub new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); mExpandedDialog.show(); - mExpandedDialog.hide(); FrameLayout hack = (FrameLayout)mExpandedView.getParent(); hack.setForeground(null); } diff --git a/services/java/com/android/server/status/TrackingPatternView.java b/services/java/com/android/server/status/TrackingPatternView.java index 0ae9984cb348..4cb8eff5043a 100644 --- a/services/java/com/android/server/status/TrackingPatternView.java +++ b/services/java/com/android/server/status/TrackingPatternView.java @@ -55,8 +55,6 @@ public class TrackingPatternView extends View { final int textureWidth = mTextureWidth; final int textureHeight = mTextureHeight; - Log.d("TrackingPatternView", "width=" + width + " textureWidth=" + textureWidth); - int x = 0; int y; -- cgit v1.2.3-59-g8ed1b