Buggy code:
public class StatusBarHeaderView extends RelativeLayout implements View . OnClickListener , StatusBarHeaderMachine . IStatusBarHeaderMachineObserver , EmergencyListener , NextAlarmController . NextAlarmChangeCallback , WeatherController . Callback { static final String TAG = "StatusBarHeaderView" ; private boolean mExpanded ; private boolean mListening ; private ViewGroup mSystemIconsContainer ; private ViewGroup mWeatherContainer ; private View mSystemIconsSuperContainer ; private View mDateGroup ; private View mClock ; private TextView mTime ; private TextView mAmPm ; private MultiUserSwitch mMultiUserSwitch ; private ImageView mMultiUserAvatar ; private TextView mDateCollapsed ; private TextView mDateExpanded ; private LinearLayout mSystemIcons ; private View mSignalCluster ; private SettingsButton mSettingsButton ; private View mSettingsContainer ; private View mTaskManagerButton ; private View mQsDetailHeader ; private TextView mQsDetailHeaderTitle ; private Switch mQsDetailHeaderSwitch ; private ImageView mQsDetailHeaderProgress ; private TextView mEmergencyCallsOnly ; private BatteryLevelTextView mBatteryLevel ; private TextView mAlarmStatus ; private TextView mWeatherLine1 ; private TextView mWeatherLine2 ; private boolean mShowEmergencyCallsOnly ; private boolean mAlarmShowing ; private AlarmClockInfo mNextAlarm ; private int mCollapsedHeight ; private int mExpandedHeight ; private int mMultiUserExpandedMargin ; private int mMultiUserCollapsedMargin ; private int mClockMarginBottomExpanded ; private int mClockMarginBottomCollapsed ; private int mMultiUserSwitchWidthCollapsed ; private int mMultiUserSwitchWidthExpanded ; private int mClockCollapsedSize ; private int mClockExpandedSize ; private float mClockCollapsedScaleFactor ; private float mAvatarCollapsedScaleFactor ; private ActivityStarter mActivityStarter ; private BatteryController mBatteryController ; private NextAlarmController mNextAlarmController ; private WeatherController mWeatherController ; private QSPanel mQSPanel ; private final Rect mClipBounds = new Rect ( ) ; private boolean mCaptureValues ; private boolean mSignalClusterDetached ; private final StatusBarHeaderView . LayoutValues mCollapsedValues = new StatusBarHeaderView . LayoutValues ( ) ; private final StatusBarHeaderView . LayoutValues mExpandedValues = new StatusBarHeaderView . LayoutValues ( ) ; private final StatusBarHeaderView . LayoutValues mCurrentValues = new StatusBarHeaderView . LayoutValues ( ) ; private float mCurrentT ; private boolean mShowingDetail ; private boolean mDetailTransitioning ; private StatusBarHeaderView . SettingsObserver mSettingsObserver ; private boolean mShowWeather ; private boolean mShowBatteryTextExpanded ; private ImageView mBackgroundImage ; private Drawable mCurrentBackground ; private float mLastHeight ; public StatusBarHeaderView ( Context context , AttributeSet attrs ) { } @ Override protected void onFinishInflate ( ) { } @ Override protected void onLayout ( boolean changed , int l , int t , int r , int b ) { } @ Override protected void onConfigurationChanged ( Configuration newConfig ) { } private void updateClockCollapsedMargin ( ) { } private void requestCaptureValues ( ) { } private void loadDimens ( ) { } public void setActivityStarter ( ActivityStarter activityStarter ) { } public void setBatteryController ( BatteryController batteryController ) { } public void setNextAlarmController ( NextAlarmController nextAlarmController ) { } public void setWeatherController ( WeatherController weatherController ) { } public int getCollapsedHeight ( ) { } public int getExpandedHeight ( ) { } public void setListening ( boolean listening ) { } public void setExpanded ( boolean expanded ) { } public void updateEverything ( ) { } private void updateHeights ( ) { } private void updateVisibilities ( ) { mDateCollapsed . setVisibility ( ( ( mExpanded ) && ( mAlarmShowing ) ? View . VISIBLE : View . INVISIBLE ) ) ; mDateExpanded . setVisibility ( ( ( mExpanded ) && ( mAlarmShowing ) ? View . INVISIBLE : View . VISIBLE ) ) ; mAlarmStatus . setVisibility ( ( ( mExpanded ) && ( mAlarmShowing ) ? View . VISIBLE : View . INVISIBLE ) ) ; mSettingsContainer . setVisibility ( ( mExpanded ? View . VISIBLE : View . INVISIBLE ) ) ; mWeatherContainer . setVisibility ( ( ( mExpanded ) && ( mShowWeather ) ? View . VISIBLE : View . GONE ) ) ; if ( ( mTaskManagerButton ) != null ) { mTaskManagerButton . setVisibility ( ( mExpanded ? View . VISIBLE : View . GONE ) ) ; } <START_BUG> mQsDetailHeader . setVisibility ( ( ( mExpanded ) && ( mShowingDetail ) ? View . VISIBLE : View . INVISIBLE ) ) ; <END_BUG> if ( ( mSignalCluster ) != null ) { updateSignalClusterDetachment ( ) ; } mEmergencyCallsOnly . setVisibility ( ( ( mExpanded ) && ( mShowEmergencyCallsOnly ) ? VISIBLE : GONE ) ) ; mBatteryLevel . setForceShown ( ( ( mExpanded ) && ( mShowBatteryTextExpanded ) ) ) ; mBatteryLevel . setVisibility ( VISIBLE ) ; } private void updateSignalClusterDetachment ( ) { } private void reattachSignalCluster ( ) { } private void updateSystemIconsLayoutParams ( ) { } private void updateListeners ( ) { } private void updateAvatarScale ( ) { } private void updateClockScale ( ) { } private void updateAmPmTranslation ( ) { } @ Override public void onNextAlarmChanged ( AlarmManager . AlarmClockInfo nextAlarm ) { } @ Override public void onWeatherChanged ( WeatherController . WeatherInfo info ) { } private void updateClickTargets ( ) { } private void updateClockLp ( ) { } private void updateMultiUserSwitch ( ) { } public void setExpansion ( float t ) { } private void updateLayoutValues ( float t ) { } private void setClipping ( float height ) { } public void setUserInfoController ( UserInfoController userInfoController ) { } @ Override public void onClick ( View v ) { } private void startSettingsActivity ( ) { } private void startBatteryActivity ( ) { } private void startClockActivity ( ) { } private void startDateActivity ( ) { } private void startForecastActivity ( ) { } public void setQSPanel ( QSPanel qsp ) { } @ Override public boolean shouldDelayChildPressedState ( ) { } @ Override public void setEmergencyCallsOnly ( boolean show ) { } @ Override protected void dispatchSetPressed ( boolean pressed ) { } private void captureLayoutValues ( StatusBarHeaderView . LayoutValues target ) { } private float getAlphaForVisibility ( View v ) { } private void applyAlpha ( View v , float alpha ) { } private void applyLayoutValues ( StatusBarHeaderView . LayoutValues values ) { } private static final class LayoutValues { float dateExpandedAlpha ; float dateCollapsedAlpha ; float emergencyCallsOnlyAlpha ; float alarmStatusAlpha ; float timeScale = 1.0F ; float clockY ; float dateY ; float avatarScale ; float avatarX ; float avatarY ; float batteryX ;

Fix:
mQsDetailHeader . setVisibility ( ( ( mExpanded ) && ( mShowingDetail ) ? View . VISIBLE : View . GONE ) ) ;