Program: 183040
Project: 183040
Buggy source:
/** 
 * Create the global actions dialog.
 * @return A new dialog.
 */
private AlertDialog createDialog(){
  mSilentModeToggle=new ToggleAction(R.drawable.ic_lock_silent_mode,R.drawable.ic_lock_silent_mode_off,R.string.global_action_toggle_silent_mode,R.string.global_action_silent_mode_on_status,R.string.global_action_silent_mode_off_status){
    void onToggle(    boolean on){
      mAudioManager.setRingerMode(on ? AudioManager.RINGER_MODE_SILENT : AudioManager.RINGER_MODE_NORMAL);
    }
    public boolean showDuringKeyguard(){
      return true;
    }
    public boolean showBeforeProvisioning(){
      return false;
    }
  }
;
  mAirplaneModeOn=new ToggleAction(R.drawable.ic_lock_airplane_mode,R.drawable.ic_lock_airplane_mode_off,R.string.global_actions_toggle_airplane_mode,R.string.global_actions_airplane_mode_on_status,R.string.global_actions_airplane_mode_off_status){
    void onToggle(    boolean on){
      if (Boolean.parseBoolean(SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE))) {
        mIsWaitingForEcmExit=true;
        Intent ecmDialogIntent=new Intent(TelephonyIntents.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS,null);
        ecmDialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mContext.startActivity(ecmDialogIntent);
      }
 else {
        changeAirplaneModeSystemSetting(on);
      }
    }
    @Override protected void changeStateFromPress(    boolean buttonOn){
      if (!(Boolean.parseBoolean(SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE)))) {
        mState=buttonOn ? State.TurningOn : State.TurningOff;
        mAirplaneState=mState;
      }
    }
    public boolean showDuringKeyguard(){
      return true;
    }
    public boolean showBeforeProvisioning(){
      return false;
    }
  }
;
  mItems=Lists.newArrayList(mSilentModeToggle,mAirplaneModeOn,new SinglePressAction(com.android.internal.R.drawable.ic_lock_power_off,R.string.global_action_power_off){
    public void onPress(){
      ShutdownThread.shutdown(mContext,true);
    }
    public boolean showDuringKeyguard(){
      return true;
    }
    public boolean showBeforeProvisioning(){
      return true;
    }
  }
);
  mAdapter=new MyAdapter();
  final AlertDialog.Builder ab=new AlertDialog.Builder(mContext);
  ab.setAdapter(mAdapter,this).setInverseBackgroundForced(true).setTitle(R.string.global_actions);
  final AlertDialog dialog=ab.create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
  dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  dialog.setOnDismissListener(this);
  return dialog;
}

Fixed version (ground truth):
/** 
 * Create the global actions dialog.
 * @return A new dialog.
 */
private AlertDialog createDialog(){
  mSilentModeToggle=new ToggleAction(R.drawable.ic_lock_silent_mode,R.drawable.ic_lock_silent_mode_off,R.string.global_action_toggle_silent_mode,R.string.global_action_silent_mode_on_status,R.string.global_action_silent_mode_off_status){
    void onToggle(    boolean on){
      mAudioManager.setRingerMode(on ? AudioManager.RINGER_MODE_SILENT : AudioManager.RINGER_MODE_NORMAL);
    }
    public boolean showDuringKeyguard(){
      return true;
    }
    public boolean showBeforeProvisioning(){
      return false;
    }
  }
;
  mAirplaneModeOn=new ToggleAction(R.drawable.ic_lock_airplane_mode,R.drawable.ic_lock_airplane_mode_off,R.string.global_actions_toggle_airplane_mode,R.string.global_actions_airplane_mode_on_status,R.string.global_actions_airplane_mode_off_status){
    void onToggle(    boolean on){
      if (Boolean.parseBoolean(SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE))) {
        mIsWaitingForEcmExit=true;
        Intent ecmDialogIntent=new Intent(TelephonyIntents.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS,null);
        ecmDialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mContext.startActivity(ecmDialogIntent);
      }
 else {
        changeAirplaneModeSystemSetting(on);
      }
    }
    @Override protected void changeStateFromPress(    boolean buttonOn){
      if (!(Boolean.parseBoolean(SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE)))) {
        mState=buttonOn ? State.TurningOn : State.TurningOff;
        mAirplaneState=mState;
      }
    }
    public boolean showDuringKeyguard(){
      return true;
    }
    public boolean showBeforeProvisioning(){
      return false;
    }
  }
;
  mItems=Lists.newArrayList(mSilentModeToggle,mAirplaneModeOn,new SinglePressAction(com.android.internal.R.drawable.ic_lock_power_off,R.string.global_action_power_off){
    public void onPress(){
      ShutdownThread.shutdown(mContext,true);
    }
    public boolean showDuringKeyguard(){
      return true;
    }
    public boolean showBeforeProvisioning(){
      return true;
    }
  }
);
  mAdapter=new MyAdapter();
  final AlertDialog.Builder ab=new AlertDialog.Builder(mContext);
  ab.setAdapter(mAdapter,this).setInverseBackgroundForced(true).setTitle(R.string.global_actions);
  final AlertDialog dialog=ab.create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
  if (!mContext.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
    dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  dialog.setOnDismissListener(this);
  return dialog;
}