Program: 41116
Project: 41116
Buggy source:
/** 
 * Do either or both things: (1) change the current configuration, and (2) make sure the given activity is running with the (now) current configuration.  Returns true if the activity has been left running, or false if <var>starting</var> is being destroyed to match the new configuration.
 */
public boolean updateConfigurationLocked(Configuration values,ActivityRecord starting){
  int changes=0;
  boolean kept=true;
  if (values != null) {
    Configuration newConfig=new Configuration(mConfiguration);
    changes=newConfig.updateFrom(values);
    if (changes != 0) {
      if (DEBUG_SWITCH || DEBUG_CONFIGURATION) {
        Slog.i(TAG,"String_Node_Str" + values);
      }
      EventLog.writeEvent(EventLogTags.CONFIGURATION_CHANGED,changes);
      if (values.locale != null) {
        saveLocaleLocked(values.locale,!values.locale.equals(mConfiguration.locale),values.userSetLocale);
      }
      if (values.customTheme != null) {
        saveThemeResourceLocked(values.customTheme,(!values.customTheme.equals(mConfiguration.customTheme)));
      }
 else       if (mConfiguration.customTheme != null) {
        saveThemeResourceLocked(null,true);
      }
      mConfigurationSeq++;
      if (mConfigurationSeq <= 0) {
        mConfigurationSeq=1;
      }
      newConfig.seq=mConfigurationSeq;
      mConfiguration=newConfig;
      Slog.i(TAG,"String_Node_Str" + newConfig);
      AttributeCache ac=AttributeCache.instance();
      if (ac != null) {
        ac.updateConfiguration(mConfiguration);
      }
      if (Settings.System.hasInterestingConfigurationChanges(changes)) {
        Message msg=mHandler.obtainMessage(UPDATE_CONFIGURATION_MSG);
        msg.obj=new Configuration(mConfiguration);
        mHandler.sendMessage(msg);
      }
      for (int i=mLruProcesses.size() - 1; i >= 0; i--) {
        ProcessRecord app=mLruProcesses.get(i);
        try {
          if (app.thread != null) {
            if (DEBUG_CONFIGURATION)             Slog.v(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ mConfiguration);
            app.thread.scheduleConfigurationChanged(mConfiguration);
          }
        }
 catch (        Exception e) {
        }
      }
      Intent intent=new Intent(Intent.ACTION_CONFIGURATION_CHANGED);
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_REPLACE_PENDING);
      broadcastIntentLocked(null,null,intent,null,null,0,null,null,null,false,false,MY_PID,Process.SYSTEM_UID);
      if ((changes & ActivityInfo.CONFIG_LOCALE) != 0) {
        broadcastIntentLocked(null,null,new Intent(Intent.ACTION_LOCALE_CHANGED),null,null,0,null,null,null,false,false,MY_PID,Process.SYSTEM_UID);
      }
    }
  }
  if (changes != 0 && starting == null) {
    starting=mMainStack.topRunningActivityLocked(null);
  }
  if (starting != null) {
    kept=mMainStack.ensureActivityConfigurationLocked(starting,changes);
    if (kept) {
      if (DEBUG_SWITCH)       Slog.i(TAG,"String_Node_Str" + starting + "String_Node_Str");
      mMainStack.ensureActivitiesVisibleLocked(starting,changes);
    }
  }
  if (values != null && mWindowManager != null) {
    mWindowManager.setNewConfiguration(mConfiguration);
  }
  return kept;
}

Fixed version (ground truth):
/** 
 * Do either or both things: (1) change the current configuration, and (2) make sure the given activity is running with the (now) current configuration.  Returns true if the activity has been left running, or false if <var>starting</var> is being destroyed to match the new configuration.
 */
public boolean updateConfigurationLocked(Configuration values,ActivityRecord starting){
  int changes=0;
  boolean kept=true;
  if (values != null) {
    Configuration newConfig=new Configuration(mConfiguration);
    changes=newConfig.updateFrom(values);
    if (changes != 0) {
      if (DEBUG_SWITCH || DEBUG_CONFIGURATION) {
        Slog.i(TAG,"String_Node_Str" + values);
      }
      EventLog.writeEvent(EventLogTags.CONFIGURATION_CHANGED,changes);
      if (values.locale != null) {
        saveLocaleLocked(values.locale,!values.locale.equals(mConfiguration.locale),values.userSetLocale);
      }
      if (values.customTheme != null) {
        saveThemeResourceLocked(values.customTheme,!values.customTheme.equals(mConfiguration.customTheme));
      }
      mConfigurationSeq++;
      if (mConfigurationSeq <= 0) {
        mConfigurationSeq=1;
      }
      newConfig.seq=mConfigurationSeq;
      mConfiguration=newConfig;
      Slog.i(TAG,"String_Node_Str" + newConfig);
      AttributeCache ac=AttributeCache.instance();
      if (ac != null) {
        ac.updateConfiguration(mConfiguration);
      }
      if (Settings.System.hasInterestingConfigurationChanges(changes)) {
        Message msg=mHandler.obtainMessage(UPDATE_CONFIGURATION_MSG);
        msg.obj=new Configuration(mConfiguration);
        mHandler.sendMessage(msg);
      }
      for (int i=mLruProcesses.size() - 1; i >= 0; i--) {
        ProcessRecord app=mLruProcesses.get(i);
        try {
          if (app.thread != null) {
            if (DEBUG_CONFIGURATION)             Slog.v(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ mConfiguration);
            app.thread.scheduleConfigurationChanged(mConfiguration);
          }
        }
 catch (        Exception e) {
        }
      }
      Intent intent=new Intent(Intent.ACTION_CONFIGURATION_CHANGED);
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_REPLACE_PENDING);
      broadcastIntentLocked(null,null,intent,null,null,0,null,null,null,false,false,MY_PID,Process.SYSTEM_UID);
      if ((changes & ActivityInfo.CONFIG_LOCALE) != 0) {
        broadcastIntentLocked(null,null,new Intent(Intent.ACTION_LOCALE_CHANGED),null,null,0,null,null,null,false,false,MY_PID,Process.SYSTEM_UID);
      }
    }
  }
  if (changes != 0 && starting == null) {
    starting=mMainStack.topRunningActivityLocked(null);
  }
  if (starting != null) {
    kept=mMainStack.ensureActivityConfigurationLocked(starting,changes);
    if (kept) {
      if (DEBUG_SWITCH)       Slog.i(TAG,"String_Node_Str" + starting + "String_Node_Str");
      mMainStack.ensureActivitiesVisibleLocked(starting,changes);
    }
  }
  if (values != null && mWindowManager != null) {
    mWindowManager.setNewConfiguration(mConfiguration);
  }
  return kept;
}