Program: 198528
Project: 198528
Buggy source:
protected PhoneStatusBarView makeStatusBarView(){
  final Context context=mContext;
  Resources res=context.getResources();
  updateDisplaySize();
  updateResources();
  mIconSize=res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size);
  mStatusBarWindow=(StatusBarWindowView)View.inflate(context,R.layout.super_status_bar,null);
  mStatusBarWindow.mService=this;
  mStatusBarWindow.setOnTouchListener(new View.OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      checkUserAutohide(v,event);
      if (event.getAction() == MotionEvent.ACTION_DOWN) {
        if (mExpandedVisible) {
          animateCollapsePanels();
        }
      }
      return mStatusBarWindow.onTouchEvent(event);
    }
  }
);
  mStatusBarView=(PhoneStatusBarView)mStatusBarWindow.findViewById(R.id.status_bar);
  mStatusBarView.setBar(this);
  PanelHolder holder=(PanelHolder)mStatusBarWindow.findViewById(R.id.panel_holder);
  mStatusBarView.setPanelHolder(holder);
  mNotificationPanel=(NotificationPanelView)mStatusBarWindow.findViewById(R.id.notification_panel);
  mNotificationPanel.setStatusBar(this);
  if (!ActivityManager.isHighEndGfx()) {
    mStatusBarWindow.setBackground(null);
    mNotificationPanel.setBackground(new FastColorDrawable(context.getResources().getColor(R.color.notification_panel_solid_background)));
  }
  if (ENABLE_HEADS_UP) {
    mHeadsUpNotificationView=(HeadsUpNotificationView)View.inflate(context,R.layout.heads_up,null);
    mHeadsUpNotificationView.setVisibility(View.GONE);
    mHeadsUpNotificationView.setBar(this);
  }
  if (MULTIUSER_DEBUG) {
    mNotificationPanelDebugText=(TextView)mNotificationPanel.findViewById(R.id.header_debug_info);
    mNotificationPanelDebugText.setVisibility(View.VISIBLE);
  }
  updateShowSearchHoldoff();
  try {
    boolean showNav=mWindowManagerService.hasNavigationBar();
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showNav);
    if (showNav) {
      mNavigationBarView=(NavigationBarView)View.inflate(context,R.layout.navigation_bar,null);
      mNavigationBarView.setDisabledFlags(mDisabled);
      mNavigationBarView.setBar(this);
      mNavigationBarView.setOnVerticalChangedListener(new NavigationBarView.OnVerticalChangedListener(){
        @Override public void onVerticalChanged(        boolean isVertical){
          if (mSearchPanelView != null) {
            mSearchPanelView.setHorizontal(isVertical);
          }
          mNotificationPanel.setQsScrimEnabled(!isVertical);
        }
      }
);
      mNavigationBarView.setOnTouchListener(new View.OnTouchListener(){
        @Override public boolean onTouch(        View v,        MotionEvent event){
          checkUserAutohide(v,event);
          return false;
        }
      }
);
    }
  }
 catch (  RemoteException ex) {
  }
  mPixelFormat=PixelFormat.OPAQUE;
  mSystemIconArea=(LinearLayout)mStatusBarView.findViewById(R.id.system_icon_area);
  mSystemIcons=(LinearLayout)mStatusBarView.findViewById(R.id.system_icons);
  mStatusIcons=(LinearLayout)mStatusBarView.findViewById(R.id.statusIcons);
  mNotificationIconArea=mStatusBarView.findViewById(R.id.notification_icon_area_inner);
  mNotificationIcons=(IconMerger)mStatusBarView.findViewById(R.id.notificationIcons);
  mMoreIcon=mStatusBarView.findViewById(R.id.moreIcon);
  mNotificationIcons.setOverflowIndicator(mMoreIcon);
  mStatusBarContents=(LinearLayout)mStatusBarView.findViewById(R.id.status_bar_contents);
  mStackScroller=(NotificationStackScrollLayout)mStatusBarWindow.findViewById(R.id.notification_stack_scroller);
  mStackScroller.setLongPressListener(getNotificationLongClicker());
  mKeyguardIconOverflowContainer=(NotificationOverflowContainer)LayoutInflater.from(mContext).inflate(R.layout.status_bar_notification_keyguard_overflow,mStackScroller,false);
  mKeyguardIconOverflowContainer.setOnActivatedListener(this);
  mKeyguardIconOverflowContainer.setOnClickListener(mOverflowClickListener);
  mStackScroller.addView(mKeyguardIconOverflowContainer);
  SpeedBumpView speedBump=(SpeedBumpView)LayoutInflater.from(mContext).inflate(R.layout.status_bar_notification_speed_bump,mStackScroller,false);
  mStackScroller.setSpeedBumpView(speedBump);
  mDismissView=(DismissView)LayoutInflater.from(mContext).inflate(R.layout.status_bar_notification_dismiss_all,mStackScroller,false);
  mDismissView.setOnButtonClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      clearAllNotifications();
    }
  }
);
  mStackScroller.setDismissView(mDismissView);
  mEmptyShadeView=(EmptyShadeView)LayoutInflater.from(mContext).inflate(R.layout.status_bar_no_notifications,mStackScroller,false);
  mStackScroller.setEmptyShadeView(mEmptyShadeView);
  mExpandedContents=mStackScroller;
  mScrimController=new ScrimController(mStatusBarWindow.findViewById(R.id.scrim_behind),mStatusBarWindow.findViewById(R.id.scrim_in_front));
  mStatusBarView.setScrimController(mScrimController);
  mHeader=(StatusBarHeaderView)mStatusBarWindow.findViewById(R.id.header);
  mHeader.setActivityStarter(this);
  mKeyguardStatusBar=(KeyguardStatusBarView)mStatusBarWindow.findViewById(R.id.keyguard_header);
  mStatusIconsKeyguard=(LinearLayout)mKeyguardStatusBar.findViewById(R.id.statusIcons);
  mKeyguardStatusView=mStatusBarWindow.findViewById(R.id.keyguard_status_view);
  mKeyguardBottomArea=(KeyguardBottomAreaView)mStatusBarWindow.findViewById(R.id.keyguard_bottom_area);
  mKeyguardBottomArea.setActivityStarter(this);
  mKeyguardIndicationController=new KeyguardIndicationController(mContext,(KeyguardIndicationTextView)mStatusBarWindow.findViewById(R.id.keyguard_indication_text));
  mTickerEnabled=res.getBoolean(R.bool.enable_ticker);
  if (mTickerEnabled) {
    final ViewStub tickerStub=(ViewStub)mStatusBarView.findViewById(R.id.ticker_stub);
    if (tickerStub != null) {
      mTickerView=tickerStub.inflate();
      mTicker=new MyTicker(context,mStatusBarView);
      TickerView tickerView=(TickerView)mStatusBarView.findViewById(R.id.tickerText);
      tickerView.mTicker=mTicker;
    }
  }
  mEdgeBorder=res.getDimensionPixelSize(R.dimen.status_bar_edge_ignore);
  setAreThereNotifications();
  mLocationController=new LocationControllerImpl(mContext);
  mBatteryController=new BatteryController(mContext);
  mBatteryController.addStateChangedCallback(new BatteryStateChangeCallback(){
    @Override public void onPowerSaveChanged(){
      mHandler.post(mCheckBarModes);
    }
    @Override public void onBatteryLevelChanged(    int level,    boolean pluggedIn,    boolean charging){
    }
  }
);
  mNetworkController=new NetworkControllerImpl(mContext);
  mHotspotController=new HotspotControllerImpl(mContext);
  mBluetoothController=new BluetoothControllerImpl(mContext);
  mSecurityController=new SecurityControllerImpl(mContext);
  if (mContext.getResources().getBoolean(R.bool.config_showRotationLock)) {
    mRotationLockController=new RotationLockControllerImpl(mContext);
  }
  mUserInfoController=new UserInfoController(mContext);
  mVolumeComponent=getComponent(VolumeComponent.class);
  mZenModeController=mVolumeComponent.getZenController();
  mCastController=new CastControllerImpl(mContext);
  final SignalClusterView signalCluster=(SignalClusterView)mStatusBarView.findViewById(R.id.signal_cluster);
  final SignalClusterView signalClusterKeyguard=(SignalClusterView)mKeyguardStatusBar.findViewById(R.id.signal_cluster);
  mNetworkController.addSignalCluster(signalCluster);
  mNetworkController.addSignalCluster(signalClusterKeyguard);
  signalCluster.setNetworkController(mNetworkController);
  signalClusterKeyguard.setNetworkController(mNetworkController);
  final boolean isAPhone=mNetworkController.hasVoiceCallingFeature();
  if (isAPhone) {
    mNetworkController.addEmergencyLabelView(mHeader);
  }
  mCarrierLabel=(TextView)mStatusBarWindow.findViewById(R.id.carrier_label);
  mShowCarrierInPanel=(mCarrierLabel != null);
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mCarrierLabel + "String_Node_Str"+ mShowCarrierInPanel);
  if (mShowCarrierInPanel) {
    mCarrierLabel.setVisibility(mCarrierLabelVisible ? View.VISIBLE : View.INVISIBLE);
    if (mNetworkController.hasMobileDataFeature()) {
      mNetworkController.addMobileLabelView(mCarrierLabel);
    }
 else {
      mNetworkController.addCombinedLabelView(mCarrierLabel);
    }
  }
  mFlashlightController=new FlashlightController(mContext);
  mKeyguardBottomArea.setFlashlightController(mFlashlightController);
  mNextAlarmController=new NextAlarmController(mContext);
  mKeyguardMonitor=new KeyguardMonitor();
  mUserSwitcherController=new UserSwitcherController(mContext,mKeyguardMonitor);
  mKeyguardUserSwitcher=new KeyguardUserSwitcher(mContext,(ViewStub)mStatusBarWindow.findViewById(R.id.keyguard_user_switcher),mKeyguardStatusBar,mNotificationPanel,mUserSwitcherController);
  mQSPanel=(QSPanel)mStatusBarWindow.findViewById(R.id.quick_settings_panel);
  if (mQSPanel != null) {
    final QSTileHost qsh=new QSTileHost(mContext,this,mBluetoothController,mLocationController,mRotationLockController,mNetworkController,mZenModeController,mHotspotController,mCastController,mFlashlightController,mUserSwitcherController,mKeyguardMonitor,mSecurityController);
    mQSPanel.setHost(qsh);
    mQSPanel.setTiles(qsh.getTiles());
    mHeader.setQSPanel(mQSPanel);
    qsh.setCallback(new QSTileHost.Callback(){
      @Override public void onTilesChanged(){
        mQSPanel.setTiles(qsh.getTiles());
      }
    }
);
  }
  mBackdrop=(FrameLayout)mStatusBarWindow.findViewById(R.id.backdrop);
  mBackdropFront=(ImageView)mBackdrop.findViewById(R.id.backdrop_front);
  mBackdropBack=(ImageView)mBackdrop.findViewById(R.id.backdrop_back);
  mHeader.setUserInfoController(mUserInfoController);
  mKeyguardStatusBar.setUserInfoController(mUserInfoController);
  mUserInfoController.reloadUserInfo();
  mHeader.setBatteryController(mBatteryController);
  mKeyguardStatusBar.setBatteryController(mBatteryController);
  mHeader.setNextAlarmController(mNextAlarmController);
  PowerManager pm=(PowerManager)mContext.getSystemService(Context.POWER_SERVICE);
  mBroadcastReceiver.onReceive(mContext,new Intent(pm.isScreenOn() ? Intent.ACTION_SCREEN_ON : Intent.ACTION_SCREEN_OFF));
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  filter.addAction(Intent.ACTION_SCREEN_ON);
  if (DEBUG_MEDIA_FAKE_ARTWORK) {
    filter.addAction("String_Node_Str");
  }
  filter.addAction(ACTION_DEMO);
  context.registerReceiver(mBroadcastReceiver,filter);
  resetUserSetupObserver();
  startGlyphRasterizeHack();
  return mStatusBarView;
}

Fixed version (ground truth):
protected PhoneStatusBarView makeStatusBarView(){
  final Context context=mContext;
  Resources res=context.getResources();
  updateDisplaySize();
  updateResources();
  mIconSize=res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size);
  mStatusBarWindow=(StatusBarWindowView)View.inflate(context,R.layout.super_status_bar,null);
  mStatusBarWindow.mService=this;
  mStatusBarWindow.setOnTouchListener(new View.OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      checkUserAutohide(v,event);
      if (event.getAction() == MotionEvent.ACTION_DOWN) {
        if (mExpandedVisible) {
          animateCollapsePanels();
        }
      }
      return mStatusBarWindow.onTouchEvent(event);
    }
  }
);
  mStatusBarView=(PhoneStatusBarView)mStatusBarWindow.findViewById(R.id.status_bar);
  mStatusBarView.setBar(this);
  PanelHolder holder=(PanelHolder)mStatusBarWindow.findViewById(R.id.panel_holder);
  mStatusBarView.setPanelHolder(holder);
  mNotificationPanel=(NotificationPanelView)mStatusBarWindow.findViewById(R.id.notification_panel);
  mNotificationPanel.setStatusBar(this);
  if (!ActivityManager.isHighEndGfx()) {
    mStatusBarWindow.setBackground(null);
    mNotificationPanel.setBackground(new FastColorDrawable(context.getResources().getColor(R.color.notification_panel_solid_background)));
  }
  if (ENABLE_HEADS_UP) {
    mHeadsUpNotificationView=(HeadsUpNotificationView)View.inflate(context,R.layout.heads_up,null);
    mHeadsUpNotificationView.setVisibility(View.GONE);
    mHeadsUpNotificationView.setBar(this);
  }
  if (MULTIUSER_DEBUG) {
    mNotificationPanelDebugText=(TextView)mNotificationPanel.findViewById(R.id.header_debug_info);
    mNotificationPanelDebugText.setVisibility(View.VISIBLE);
  }
  updateShowSearchHoldoff();
  try {
    boolean showNav=mWindowManagerService.hasNavigationBar();
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showNav);
    if (showNav) {
      mNavigationBarView=(NavigationBarView)View.inflate(context,R.layout.navigation_bar,null);
      mNavigationBarView.setDisabledFlags(mDisabled);
      mNavigationBarView.setBar(this);
      mNavigationBarView.setOnVerticalChangedListener(new NavigationBarView.OnVerticalChangedListener(){
        @Override public void onVerticalChanged(        boolean isVertical){
          if (mSearchPanelView != null) {
            mSearchPanelView.setHorizontal(isVertical);
          }
          mNotificationPanel.setQsScrimEnabled(!isVertical);
        }
      }
);
      mNavigationBarView.setOnTouchListener(new View.OnTouchListener(){
        @Override public boolean onTouch(        View v,        MotionEvent event){
          checkUserAutohide(v,event);
          return false;
        }
      }
);
    }
  }
 catch (  RemoteException ex) {
  }
  mPixelFormat=PixelFormat.OPAQUE;
  mSystemIconArea=(LinearLayout)mStatusBarView.findViewById(R.id.system_icon_area);
  mSystemIcons=(LinearLayout)mStatusBarView.findViewById(R.id.system_icons);
  mStatusIcons=(LinearLayout)mStatusBarView.findViewById(R.id.statusIcons);
  mNotificationIconArea=mStatusBarView.findViewById(R.id.notification_icon_area_inner);
  mNotificationIcons=(IconMerger)mStatusBarView.findViewById(R.id.notificationIcons);
  mMoreIcon=mStatusBarView.findViewById(R.id.moreIcon);
  mNotificationIcons.setOverflowIndicator(mMoreIcon);
  mStatusBarContents=(LinearLayout)mStatusBarView.findViewById(R.id.status_bar_contents);
  mStackScroller=(NotificationStackScrollLayout)mStatusBarWindow.findViewById(R.id.notification_stack_scroller);
  mStackScroller.setLongPressListener(getNotificationLongClicker());
  mKeyguardIconOverflowContainer=(NotificationOverflowContainer)LayoutInflater.from(mContext).inflate(R.layout.status_bar_notification_keyguard_overflow,mStackScroller,false);
  mKeyguardIconOverflowContainer.setOnActivatedListener(this);
  mKeyguardIconOverflowContainer.setOnClickListener(mOverflowClickListener);
  mStackScroller.addView(mKeyguardIconOverflowContainer);
  SpeedBumpView speedBump=(SpeedBumpView)LayoutInflater.from(mContext).inflate(R.layout.status_bar_notification_speed_bump,mStackScroller,false);
  mStackScroller.setSpeedBumpView(speedBump);
  mEmptyShadeView=(EmptyShadeView)LayoutInflater.from(mContext).inflate(R.layout.status_bar_no_notifications,mStackScroller,false);
  mStackScroller.setEmptyShadeView(mEmptyShadeView);
  mDismissView=(DismissView)LayoutInflater.from(mContext).inflate(R.layout.status_bar_notification_dismiss_all,mStackScroller,false);
  mDismissView.setOnButtonClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      clearAllNotifications();
    }
  }
);
  mStackScroller.setDismissView(mDismissView);
  mExpandedContents=mStackScroller;
  mScrimController=new ScrimController(mStatusBarWindow.findViewById(R.id.scrim_behind),mStatusBarWindow.findViewById(R.id.scrim_in_front));
  mStatusBarView.setScrimController(mScrimController);
  mHeader=(StatusBarHeaderView)mStatusBarWindow.findViewById(R.id.header);
  mHeader.setActivityStarter(this);
  mKeyguardStatusBar=(KeyguardStatusBarView)mStatusBarWindow.findViewById(R.id.keyguard_header);
  mStatusIconsKeyguard=(LinearLayout)mKeyguardStatusBar.findViewById(R.id.statusIcons);
  mKeyguardStatusView=mStatusBarWindow.findViewById(R.id.keyguard_status_view);
  mKeyguardBottomArea=(KeyguardBottomAreaView)mStatusBarWindow.findViewById(R.id.keyguard_bottom_area);
  mKeyguardBottomArea.setActivityStarter(this);
  mKeyguardIndicationController=new KeyguardIndicationController(mContext,(KeyguardIndicationTextView)mStatusBarWindow.findViewById(R.id.keyguard_indication_text));
  mTickerEnabled=res.getBoolean(R.bool.enable_ticker);
  if (mTickerEnabled) {
    final ViewStub tickerStub=(ViewStub)mStatusBarView.findViewById(R.id.ticker_stub);
    if (tickerStub != null) {
      mTickerView=tickerStub.inflate();
      mTicker=new MyTicker(context,mStatusBarView);
      TickerView tickerView=(TickerView)mStatusBarView.findViewById(R.id.tickerText);
      tickerView.mTicker=mTicker;
    }
  }
  mEdgeBorder=res.getDimensionPixelSize(R.dimen.status_bar_edge_ignore);
  setAreThereNotifications();
  mLocationController=new LocationControllerImpl(mContext);
  mBatteryController=new BatteryController(mContext);
  mBatteryController.addStateChangedCallback(new BatteryStateChangeCallback(){
    @Override public void onPowerSaveChanged(){
      mHandler.post(mCheckBarModes);
    }
    @Override public void onBatteryLevelChanged(    int level,    boolean pluggedIn,    boolean charging){
    }
  }
);
  mNetworkController=new NetworkControllerImpl(mContext);
  mHotspotController=new HotspotControllerImpl(mContext);
  mBluetoothController=new BluetoothControllerImpl(mContext);
  mSecurityController=new SecurityControllerImpl(mContext);
  if (mContext.getResources().getBoolean(R.bool.config_showRotationLock)) {
    mRotationLockController=new RotationLockControllerImpl(mContext);
  }
  mUserInfoController=new UserInfoController(mContext);
  mVolumeComponent=getComponent(VolumeComponent.class);
  mZenModeController=mVolumeComponent.getZenController();
  mCastController=new CastControllerImpl(mContext);
  final SignalClusterView signalCluster=(SignalClusterView)mStatusBarView.findViewById(R.id.signal_cluster);
  final SignalClusterView signalClusterKeyguard=(SignalClusterView)mKeyguardStatusBar.findViewById(R.id.signal_cluster);
  mNetworkController.addSignalCluster(signalCluster);
  mNetworkController.addSignalCluster(signalClusterKeyguard);
  signalCluster.setNetworkController(mNetworkController);
  signalClusterKeyguard.setNetworkController(mNetworkController);
  final boolean isAPhone=mNetworkController.hasVoiceCallingFeature();
  if (isAPhone) {
    mNetworkController.addEmergencyLabelView(mHeader);
  }
  mCarrierLabel=(TextView)mStatusBarWindow.findViewById(R.id.carrier_label);
  mShowCarrierInPanel=(mCarrierLabel != null);
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mCarrierLabel + "String_Node_Str"+ mShowCarrierInPanel);
  if (mShowCarrierInPanel) {
    mCarrierLabel.setVisibility(mCarrierLabelVisible ? View.VISIBLE : View.INVISIBLE);
    if (mNetworkController.hasMobileDataFeature()) {
      mNetworkController.addMobileLabelView(mCarrierLabel);
    }
 else {
      mNetworkController.addCombinedLabelView(mCarrierLabel);
    }
  }
  mFlashlightController=new FlashlightController(mContext);
  mKeyguardBottomArea.setFlashlightController(mFlashlightController);
  mNextAlarmController=new NextAlarmController(mContext);
  mKeyguardMonitor=new KeyguardMonitor();
  mUserSwitcherController=new UserSwitcherController(mContext,mKeyguardMonitor);
  mKeyguardUserSwitcher=new KeyguardUserSwitcher(mContext,(ViewStub)mStatusBarWindow.findViewById(R.id.keyguard_user_switcher),mKeyguardStatusBar,mNotificationPanel,mUserSwitcherController);
  mQSPanel=(QSPanel)mStatusBarWindow.findViewById(R.id.quick_settings_panel);
  if (mQSPanel != null) {
    final QSTileHost qsh=new QSTileHost(mContext,this,mBluetoothController,mLocationController,mRotationLockController,mNetworkController,mZenModeController,mHotspotController,mCastController,mFlashlightController,mUserSwitcherController,mKeyguardMonitor,mSecurityController);
    mQSPanel.setHost(qsh);
    mQSPanel.setTiles(qsh.getTiles());
    mHeader.setQSPanel(mQSPanel);
    qsh.setCallback(new QSTileHost.Callback(){
      @Override public void onTilesChanged(){
        mQSPanel.setTiles(qsh.getTiles());
      }
    }
);
  }
  mBackdrop=(FrameLayout)mStatusBarWindow.findViewById(R.id.backdrop);
  mBackdropFront=(ImageView)mBackdrop.findViewById(R.id.backdrop_front);
  mBackdropBack=(ImageView)mBackdrop.findViewById(R.id.backdrop_back);
  mHeader.setUserInfoController(mUserInfoController);
  mKeyguardStatusBar.setUserInfoController(mUserInfoController);
  mUserInfoController.reloadUserInfo();
  mHeader.setBatteryController(mBatteryController);
  mKeyguardStatusBar.setBatteryController(mBatteryController);
  mHeader.setNextAlarmController(mNextAlarmController);
  PowerManager pm=(PowerManager)mContext.getSystemService(Context.POWER_SERVICE);
  mBroadcastReceiver.onReceive(mContext,new Intent(pm.isScreenOn() ? Intent.ACTION_SCREEN_ON : Intent.ACTION_SCREEN_OFF));
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  filter.addAction(Intent.ACTION_SCREEN_ON);
  if (DEBUG_MEDIA_FAKE_ARTWORK) {
    filter.addAction("String_Node_Str");
  }
  filter.addAction(ACTION_DEMO);
  context.registerReceiver(mBroadcastReceiver,filter);
  resetUserSetupObserver();
  startGlyphRasterizeHack();
  return mStatusBarView;
}