Program: 43412
Project: 43412
Buggy source:
/** 
 * @see AudioManager#reloadAudioSettings() 
 */
public void reloadAudioSettings(){
  readPersistedSettings();
  int numStreamTypes=AudioSystem.getNumStreamTypes();
  for (int streamType=0; streamType < numStreamTypes; streamType++) {
    VolumeStreamState streamState=mStreamStates[streamType];
    if (streamType != AudioSystem.STREAM_BLUETOOTH_SCO) {
      String settingName=System.VOLUME_SETTINGS[streamType];
      String lastAudibleSettingName=settingName + System.APPEND_FOR_LAST_AUDIBLE;
      int index=Settings.System.getInt(mContentResolver,settingName,AudioManager.DEFAULT_STREAM_VOLUME[streamType]);
      if (STREAM_VOLUME_ALIAS[streamType] != streamType) {
        index=rescaleIndex(index * 10,STREAM_VOLUME_ALIAS[streamType],streamType);
      }
 else {
        index*=10;
      }
      streamState.mIndex=streamState.getValidIndex(index);
      index=(index + 5) / 10;
      index=Settings.System.getInt(mContentResolver,lastAudibleSettingName,(index > 0) ? index : AudioManager.DEFAULT_STREAM_VOLUME[streamType]);
      if (STREAM_VOLUME_ALIAS[streamType] != streamType) {
        index=rescaleIndex(index * 10,STREAM_VOLUME_ALIAS[streamType],streamType);
      }
 else {
        index*=10;
      }
      streamState.mLastAudibleIndex=streamState.getValidIndex(index);
    }
    if (streamState.muteCount() != 0 && !isStreamAffectedByMute(streamType)) {
      int size=streamState.mDeathHandlers.size();
      for (int i=0; i < size; i++) {
        streamState.mDeathHandlers.get(i).mMuteCount=1;
        streamState.mDeathHandlers.get(i).mute(false);
      }
    }
    if (streamState.muteCount() == 0) {
      setStreamVolumeIndex(streamType,streamState.mIndex);
    }
  }
  setRingerModeInt(getRingerMode(),false);
}

Fixed version (ground truth):
/** 
 * @see AudioManager#reloadAudioSettings() 
 */
public void reloadAudioSettings(){
  readPersistedSettings();
  int numStreamTypes=AudioSystem.getNumStreamTypes();
  for (int streamType=0; streamType < numStreamTypes; streamType++) {
    VolumeStreamState streamState=mStreamStates[streamType];
    String settingName=System.VOLUME_SETTINGS[STREAM_VOLUME_ALIAS[streamType]];
    String lastAudibleSettingName=settingName + System.APPEND_FOR_LAST_AUDIBLE;
    int index=Settings.System.getInt(mContentResolver,settingName,AudioManager.DEFAULT_STREAM_VOLUME[streamType]);
    if (STREAM_VOLUME_ALIAS[streamType] != streamType) {
      index=rescaleIndex(index * 10,STREAM_VOLUME_ALIAS[streamType],streamType);
    }
 else {
      index*=10;
    }
    streamState.mIndex=streamState.getValidIndex(index);
    index=(index + 5) / 10;
    index=Settings.System.getInt(mContentResolver,lastAudibleSettingName,(index > 0) ? index : AudioManager.DEFAULT_STREAM_VOLUME[streamType]);
    if (STREAM_VOLUME_ALIAS[streamType] != streamType) {
      index=rescaleIndex(index * 10,STREAM_VOLUME_ALIAS[streamType],streamType);
    }
 else {
      index*=10;
    }
    streamState.mLastAudibleIndex=streamState.getValidIndex(index);
    if (streamState.muteCount() != 0 && !isStreamAffectedByMute(streamType)) {
      int size=streamState.mDeathHandlers.size();
      for (int i=0; i < size; i++) {
        streamState.mDeathHandlers.get(i).mMuteCount=1;
        streamState.mDeathHandlers.get(i).mute(false);
      }
    }
    if (streamState.muteCount() == 0) {
      setStreamVolumeIndex(streamType,streamState.mIndex);
    }
  }
  setRingerModeInt(getRingerMode(),false);
}