@@ -109,8 +109,6 @@ public class PhoneStatusBar extends BaseStatusBar {
109109 public static final String ACTION_STATUSBAR_START
110110 = "com.android.internal.policy.statusbar.START" ;
111111
112- private static final boolean SHOW_CARRIER_LABEL = false ; // XXX: doesn't work with rubberband panels right now
113-
114112 private static final int MSG_OPEN_NOTIFICATION_PANEL = 1000 ;
115113 private static final int MSG_CLOSE_NOTIFICATION_PANEL = 1001 ;
116114 // 1020-1030 reserved for BaseStatusBar
@@ -189,6 +187,9 @@ public class PhoneStatusBar extends BaseStatusBar {
189187 private boolean mCarrierLabelVisible = false ;
190188 private int mCarrierLabelHeight ;
191189 private TextView mEmergencyCallLabel ;
190+ private int mNotificationHeaderHeight ;
191+
192+ private boolean mShowCarrierInPanel = false ;
192193
193194 // position
194195 int [] mPositionTmp = new int [2 ];
@@ -310,14 +311,6 @@ public boolean onTouch(View v, MotionEvent event) {
310311 mStatusBarView .setPanelHolder (holder );
311312
312313 mNotificationPanel = (PanelView ) mStatusBarWindow .findViewById (R .id .notification_panel );
313- // don't allow clicks on the panel to pass through to the background where they will cause the panel to close
314- View .OnTouchListener clickStopper = new View .OnTouchListener () {
315- @ Override
316- public boolean onTouch (View v , MotionEvent event ) {
317- return true ;
318- }
319- };
320- mNotificationPanel .setOnTouchListener (clickStopper );
321314 mNotificationPanelIsFullScreenWidth =
322315 (mNotificationPanel .getLayoutParams ().width == ViewGroup .LayoutParams .MATCH_PARENT );
323316 mNotificationPanel .setSystemUiVisibility (
@@ -326,7 +319,6 @@ public boolean onTouch(View v, MotionEvent event) {
326319
327320 // quick settings (WIP)
328321 mSettingsPanel = (PanelView ) mStatusBarWindow .findViewById (R .id .settings_panel );
329- mSettingsPanel .setOnTouchListener (clickStopper );
330322
331323 if (!ActivityManager .isHighEndGfx ()) {
332324 mStatusBarWindow .setBackground (null );
@@ -419,8 +411,10 @@ public void onLayoutChange(View v, int left, int top, int right, int bottom,
419411 }});
420412 }
421413
422- if (SHOW_CARRIER_LABEL ) {
423- mCarrierLabel = (TextView )mStatusBarWindow .findViewById (R .id .carrier_label );
414+ mCarrierLabel = (TextView )mStatusBarWindow .findViewById (R .id .carrier_label );
415+ mShowCarrierInPanel = (mCarrierLabel != null );
416+ Slog .v (TAG , "carrierlabel=" + mCarrierLabel + " show=" + mShowCarrierInPanel );
417+ if (mShowCarrierInPanel ) {
424418 mCarrierLabel .setVisibility (mCarrierLabelVisible ? View .VISIBLE : View .INVISIBLE );
425419
426420 // for mobile devices, we always show mobile connection info here (SPN/PLMN)
@@ -867,7 +861,7 @@ protected void updateNotificationIcons() {
867861 }
868862
869863 protected void updateCarrierLabelVisibility (boolean force ) {
870- if (!SHOW_CARRIER_LABEL ) return ;
864+ if (!mShowCarrierInPanel ) return ;
871865 // The idea here is to only show the carrier label when there is enough room to see it,
872866 // i.e. when there aren't enough notifications to fill the panel.
873867 if (DEBUG ) {
@@ -878,7 +872,7 @@ protected void updateCarrierLabelVisibility(boolean force) {
878872 final boolean emergencyCallsShownElsewhere = mEmergencyCallLabel != null ;
879873 final boolean makeVisible =
880874 !(emergencyCallsShownElsewhere && mNetworkController .isEmergencyOnly ())
881- && mPile .getHeight () < (mScrollView .getHeight () - mCarrierLabelHeight );
875+ && mPile .getHeight () < (mNotificationPanel .getHeight () - mCarrierLabelHeight - mNotificationHeaderHeight );
882876
883877 if (force || mCarrierLabelVisible != makeVisible ) {
884878 mCarrierLabelVisible = makeVisible ;
@@ -1631,6 +1625,8 @@ public void updateExpandedViewPos(int thingy) {
16311625 lp .gravity = mSettingsPanelGravity ;
16321626 lp .rightMargin = mNotificationPanelMarginPx ;
16331627 mSettingsPanel .setLayoutParams (lp );
1628+
1629+ updateCarrierLabelVisibility (false );
16341630 }
16351631
16361632 // called by makeStatusbar and also by PhoneStatusBarView
@@ -1905,6 +1901,7 @@ protected void loadDimens() {
19051901 + res .getDimensionPixelSize (R .dimen .close_handle_underlap );
19061902
19071903 mCarrierLabelHeight = res .getDimensionPixelSize (R .dimen .carrier_label_height );
1904+ mNotificationHeaderHeight = res .getDimensionPixelSize (R .dimen .notification_panel_header_height );
19081905
19091906 if (false ) Slog .v (TAG , "updateResources" );
19101907 }
0 commit comments