Program: 184724
Project: 184724
Buggy source:
@Override public void onCreate(){
  if (Config.LOGV)   Log.v(LOG_TAG,"String_Node_Str");
  ContentResolver resolver=getContentResolver();
  if (phone == null) {
    PhoneFactory.makeDefaultPhones(this);
    phone=PhoneFactory.getDefaultPhone();
    NotificationMgr.init(this);
    phoneMgr=new PhoneInterfaceManager(this,phone);
    int phoneType=phone.getPhoneType();
    if (phoneType == Phone.PHONE_TYPE_CDMA) {
      cdmaPhoneCallState=new CdmaPhoneCallState();
      cdmaPhoneCallState.CdmaPhoneCallStateInit();
    }
    if (BluetoothAdapter.getDefaultAdapter() != null) {
      mBtHandsfree=new BluetoothHandsfree(this,phone);
      startService(new Intent(this,BluetoothHeadsetService.class));
    }
 else {
      mBtHandsfree=null;
    }
    ringer=new Ringer(phone);
    PowerManager pm=(PowerManager)getSystemService(Context.POWER_SERVICE);
    mWakeLock=pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE,LOG_TAG);
    mPartialWakeLock=pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE,LOG_TAG);
    if ((pm.getSupportedWakeLockFlags() & PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK) != 0x0) {
      mProximityWakeLock=pm.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK,LOG_TAG);
    }
    if (DBG)     Log.d(LOG_TAG,"String_Node_Str" + mProximityWakeLock);
    mKeyguardManager=(KeyguardManager)getSystemService(Context.KEYGUARD_SERVICE);
    mStatusBarManager=(StatusBarManager)getSystemService(Context.STATUS_BAR_SERVICE);
    mPowerManagerService=IPowerManager.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
    notifier=new CallNotifier(this,phone,ringer,mBtHandsfree);
    IccCard sim=phone.getIccCard();
    if (sim != null) {
      if (Config.LOGV)       Log.v(LOG_TAG,"String_Node_Str");
      sim.registerForAbsent(mHandler,EVENT_SIM_ABSENT,null);
      sim.registerForLocked(mHandler,EVENT_SIM_LOCKED,null);
      sim.registerForNetworkLocked(mHandler,EVENT_SIM_NETWORK_LOCKED,null);
    }
    if (phoneType == Phone.PHONE_TYPE_GSM) {
      phone.registerForMmiComplete(mHandler,MMI_COMPLETE,null);
    }
    PhoneUtils.initializeConnectionHandler(phone);
    IntentFilter intentFilter=new IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED);
    intentFilter.addAction(BluetoothHeadset.ACTION_STATE_CHANGED);
    intentFilter.addAction(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED);
    intentFilter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
    intentFilter.addAction(Intent.ACTION_HEADSET_PLUG);
    intentFilter.addAction(Intent.ACTION_BATTERY_LOW);
    intentFilter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
    intentFilter.addAction(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED);
    intentFilter.addAction(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED);
    intentFilter.addAction(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
    registerReceiver(mReceiver,intentFilter);
    IntentFilter mediaButtonIntentFilter=new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
    mediaButtonIntentFilter.setPriority(1);
    registerReceiver(mMediaButtonReceiver,mediaButtonIntentFilter);
    PreferenceManager.setDefaultValues(this,R.xml.network_setting,false);
    PreferenceManager.setDefaultValues(this,R.xml.call_feature_setting,false);
switch (phone.getState()) {
case IDLE:
      if (DBG)       Log.d(LOG_TAG,"String_Node_Str");
    PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
  PhoneUtils.setAudioMode(this,AudioManager.MODE_NORMAL);
break;
case RINGING:
if (DBG) Log.d(LOG_TAG,"String_Node_Str");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
PhoneUtils.setAudioMode(this,AudioManager.MODE_RINGTONE);
break;
case OFFHOOK:
if (DBG) Log.d(LOG_TAG,"String_Node_Str");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
PhoneUtils.setAudioMode(this,AudioManager.MODE_IN_CALL);
break;
}
}
boolean phoneIsCdma=(phone.getPhoneType() == Phone.PHONE_TYPE_CDMA);
if (phoneIsCdma) {
cdmaOtaProvisionData=new OtaUtils.CdmaOtaProvisionData();
cdmaOtaConfigData=new OtaUtils.CdmaOtaConfigData();
cdmaOtaScreenState=new OtaUtils.CdmaOtaScreenState();
cdmaOtaInCallScreenUiState=new OtaUtils.CdmaOtaInCallScreenUiState();
}
resolver.getType(Uri.parse("String_Node_Str"));
mShouldRestoreMuteOnInCallResume=false;
if (phoneIsCdma) {
int settingsTtyMode=android.provider.Settings.Secure.getInt(phone.getContext().getContentResolver(),android.provider.Settings.Secure.PREFERRED_TTY_MODE,Phone.TTY_MODE_OFF);
phone.setTTYMode(settingsTtyMode,null);
}
}

Fixed version (ground truth):
@Override public void onCreate(){
  if (Config.LOGV)   Log.v(LOG_TAG,"String_Node_Str");
  ContentResolver resolver=getContentResolver();
  if (phone == null) {
    PhoneFactory.makeDefaultPhones(this);
    phone=PhoneFactory.getDefaultPhone();
    NotificationMgr.init(this);
    phoneMgr=new PhoneInterfaceManager(this,phone);
    int phoneType=phone.getPhoneType();
    if (phoneType == Phone.PHONE_TYPE_CDMA) {
      cdmaPhoneCallState=new CdmaPhoneCallState();
      cdmaPhoneCallState.CdmaPhoneCallStateInit();
    }
    if (BluetoothAdapter.getDefaultAdapter() != null) {
      mBtHandsfree=new BluetoothHandsfree(this,phone);
      startService(new Intent(this,BluetoothHeadsetService.class));
    }
 else {
      mBtHandsfree=null;
    }
    ringer=new Ringer(phone);
    PowerManager pm=(PowerManager)getSystemService(Context.POWER_SERVICE);
    mWakeLock=pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE,LOG_TAG);
    mPartialWakeLock=pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE,LOG_TAG);
    if ((pm.getSupportedWakeLockFlags() & PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK) != 0x0) {
      mProximityWakeLock=pm.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK,LOG_TAG);
    }
    if (DBG)     Log.d(LOG_TAG,"String_Node_Str" + mProximityWakeLock);
    mKeyguardManager=(KeyguardManager)getSystemService(Context.KEYGUARD_SERVICE);
    mStatusBarManager=(StatusBarManager)getSystemService(Context.STATUS_BAR_SERVICE);
    mPowerManagerService=IPowerManager.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
    notifier=new CallNotifier(this,phone,ringer,mBtHandsfree);
    IccCard sim=phone.getIccCard();
    if (sim != null) {
      if (Config.LOGV)       Log.v(LOG_TAG,"String_Node_Str");
      sim.registerForAbsent(mHandler,EVENT_SIM_ABSENT,null);
      sim.registerForLocked(mHandler,EVENT_SIM_LOCKED,null);
      sim.registerForNetworkLocked(mHandler,EVENT_SIM_NETWORK_LOCKED,null);
    }
    if (phoneType == Phone.PHONE_TYPE_GSM) {
      phone.registerForMmiComplete(mHandler,MMI_COMPLETE,null);
    }
    PhoneUtils.initializeConnectionHandler(phone);
    IntentFilter intentFilter=new IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED);
    intentFilter.addAction(BluetoothHeadset.ACTION_STATE_CHANGED);
    intentFilter.addAction(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED);
    intentFilter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
    intentFilter.addAction(Intent.ACTION_HEADSET_PLUG);
    intentFilter.addAction(Intent.ACTION_BATTERY_LOW);
    intentFilter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
    intentFilter.addAction(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED);
    intentFilter.addAction(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED);
    intentFilter.addAction(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
    registerReceiver(mReceiver,intentFilter);
    IntentFilter mediaButtonIntentFilter=new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
    mediaButtonIntentFilter.setPriority(1);
    registerReceiver(mMediaButtonReceiver,mediaButtonIntentFilter);
    PreferenceManager.setDefaultValues(this,R.xml.network_setting,false);
    PreferenceManager.setDefaultValues(this,R.xml.call_feature_setting,false);
switch (phone.getState()) {
case IDLE:
      if (DBG)       Log.d(LOG_TAG,"String_Node_Str");
    PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
  PhoneUtils.setAudioMode(this,AudioManager.MODE_NORMAL);
break;
case RINGING:
if (DBG) Log.d(LOG_TAG,"String_Node_Str");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
PhoneUtils.setAudioMode(this,AudioManager.MODE_RINGTONE);
break;
case OFFHOOK:
if (DBG) Log.d(LOG_TAG,"String_Node_Str");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
PhoneUtils.setAudioMode(this,AudioManager.MODE_IN_CALL);
break;
}
}
boolean phoneIsCdma=(phone.getPhoneType() == Phone.PHONE_TYPE_CDMA);
if (phoneIsCdma) {
cdmaOtaProvisionData=new OtaUtils.CdmaOtaProvisionData();
cdmaOtaConfigData=new OtaUtils.CdmaOtaConfigData();
cdmaOtaScreenState=new OtaUtils.CdmaOtaScreenState();
cdmaOtaInCallScreenUiState=new OtaUtils.CdmaOtaInCallScreenUiState();
}
resolver.getType(Uri.parse("String_Node_Str"));
mShouldRestoreMuteOnInCallResume=false;
if (phoneIsCdma) {
int settingsTtyMode=android.provider.Settings.Secure.getInt(phone.getContext().getContentResolver(),android.provider.Settings.Secure.PREFERRED_TTY_MODE,Phone.TTY_MODE_OFF);
phone.setTTYMode(settingsTtyMode,null);
int hac=android.provider.Settings.System.getInt(phone.getContext().getContentResolver(),android.provider.Settings.System.HEARING_AID,0);
AudioManager audioManager=(AudioManager)phone.getContext().getSystemService(Context.AUDIO_SERVICE);
audioManager.setParameter(CallFeaturesSetting.HAC_KEY,hac != 0 ? CallFeaturesSetting.HAC_VAL_ON : CallFeaturesSetting.HAC_VAL_OFF);
}
}