@@ -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)
@@ -880,7 +874,7 @@ protected void updateNotificationIcons() {
880874 }
881875
882876 protected void updateCarrierLabelVisibility (boolean force ) {
883- if (!SHOW_CARRIER_LABEL ) return ;
877+ if (!mShowCarrierInPanel ) return ;
884878 // The idea here is to only show the carrier label when there is enough room to see it,
885879 // i.e. when there aren't enough notifications to fill the panel.
886880 if (DEBUG ) {
@@ -891,7 +885,7 @@ protected void updateCarrierLabelVisibility(boolean force) {
891885 final boolean emergencyCallsShownElsewhere = mEmergencyCallLabel != null ;
892886 final boolean makeVisible =
893887 !(emergencyCallsShownElsewhere && mNetworkController .isEmergencyOnly ())
894- && mPile .getHeight () < (mScrollView .getHeight () - mCarrierLabelHeight );
888+ && mPile .getHeight () < (mNotificationPanel .getHeight () - mCarrierLabelHeight - mNotificationHeaderHeight );
895889
896890 if (force || mCarrierLabelVisible != makeVisible ) {
897891 mCarrierLabelVisible = makeVisible ;
@@ -1644,6 +1638,8 @@ public void updateExpandedViewPos(int thingy) {
16441638 lp .gravity = mSettingsPanelGravity ;
16451639 lp .rightMargin = mNotificationPanelMarginPx ;
16461640 mSettingsPanel .setLayoutParams (lp );
1641+
1642+ updateCarrierLabelVisibility (false );
16471643 }
16481644
16491645 // called by makeStatusbar and also by PhoneStatusBarView
@@ -1918,6 +1914,7 @@ protected void loadDimens() {
19181914 + res .getDimensionPixelSize (R .dimen .close_handle_underlap );
19191915
19201916 mCarrierLabelHeight = res .getDimensionPixelSize (R .dimen .carrier_label_height );
1917+ mNotificationHeaderHeight = res .getDimensionPixelSize (R .dimen .notification_panel_header_height );
19211918
19221919 if (false ) Slog .v (TAG , "updateResources" );
19231920 }
0 commit comments