Program: 41098
Project: 41098
Buggy source:
/** 
 * Store the newly updated configuration.
 */
public void updateConfiguration(Configuration config,DisplayMetrics metrics){
synchronized (mTmpValue) {
    int configChanges=0xfffffff;
    if (config != null) {
      configChanges=mConfiguration.updateFrom(config);
    }
    if (mConfiguration.locale == null) {
      mConfiguration.locale=Locale.getDefault();
    }
    if (metrics != null) {
      mMetrics.setTo(metrics);
      mMetrics.updateMetrics(mCompatibilityInfo,mConfiguration.orientation,mConfiguration.screenLayout);
    }
    mMetrics.scaledDensity=mMetrics.density * mConfiguration.fontScale;
    String locale=null;
    if (mConfiguration.locale != null) {
      locale=mConfiguration.locale.getLanguage();
      if (mConfiguration.locale.getCountry() != null) {
        locale+="String_Node_Str" + mConfiguration.locale.getCountry();
      }
    }
    int width, height;
    if (mMetrics.widthPixels >= mMetrics.heightPixels) {
      width=mMetrics.widthPixels;
      height=mMetrics.heightPixels;
    }
 else {
      width=mMetrics.heightPixels;
      height=mMetrics.widthPixels;
    }
    int keyboardHidden=mConfiguration.keyboardHidden;
    if (keyboardHidden == Configuration.KEYBOARDHIDDEN_NO && mConfiguration.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES) {
      keyboardHidden=Configuration.KEYBOARDHIDDEN_SOFT;
    }
    mAssets.setConfiguration(mConfiguration.mcc,mConfiguration.mnc,locale,mConfiguration.orientation,mConfiguration.touchscreen,(int)(mMetrics.density * 160),mConfiguration.keyboard,keyboardHidden,mConfiguration.navigation,width,height,mConfiguration.screenLayout,mConfiguration.uiMode,sSdkVersion);
    int N=mDrawableCache.size();
    if (DEBUG_CONFIG) {
      Log.d(TAG,"String_Node_Str" + Integer.toHexString(configChanges));
    }
    for (int i=0; i < N; i++) {
      WeakReference<Drawable.ConstantState> ref=mDrawableCache.valueAt(i);
      if (ref != null) {
        Drawable.ConstantState cs=ref.get();
        if (cs != null) {
          if (Configuration.needNewResources(configChanges,cs.getChangingConfigurations())) {
            if (DEBUG_CONFIG) {
              Log.d(TAG,"String_Node_Str" + Long.toHexString(mDrawableCache.keyAt(i)) + "String_Node_Str"+ cs+ "String_Node_Str"+ Integer.toHexString(cs.getChangingConfigurations()));
            }
            mDrawableCache.setValueAt(i,null);
          }
 else           if (DEBUG_CONFIG) {
            Log.d(TAG,"String_Node_Str" + Long.toHexString(mDrawableCache.keyAt(i)) + "String_Node_Str"+ cs+ "String_Node_Str"+ Integer.toHexString(cs.getChangingConfigurations())+ "String_Node_Str");
          }
        }
      }
    }
    mDrawableCache.clear();
    mColorStateListCache.clear();
    flushLayoutCache();
  }
synchronized (mSync) {
    if (mPluralRule != null) {
      mPluralRule=PluralRules.ruleForLocale(config.locale);
    }
  }
}

Fixed version (ground truth):
/** 
 * Store the newly updated configuration.
 */
public void updateConfiguration(Configuration config,DisplayMetrics metrics){
synchronized (mTmpValue) {
    int configChanges=0xfffffff;
    if (config != null) {
      configChanges=mConfiguration.updateFrom(config);
    }
    if (mConfiguration.locale == null) {
      mConfiguration.locale=Locale.getDefault();
    }
    if (metrics != null) {
      mMetrics.setTo(metrics);
      mMetrics.updateMetrics(mCompatibilityInfo,mConfiguration.orientation,mConfiguration.screenLayout);
    }
    mMetrics.scaledDensity=mMetrics.density * mConfiguration.fontScale;
    String locale=null;
    if (mConfiguration.locale != null) {
      locale=mConfiguration.locale.getLanguage();
      if (mConfiguration.locale.getCountry() != null) {
        locale+="String_Node_Str" + mConfiguration.locale.getCountry();
      }
    }
    int width, height;
    if (mMetrics.widthPixels >= mMetrics.heightPixels) {
      width=mMetrics.widthPixels;
      height=mMetrics.heightPixels;
    }
 else {
      width=mMetrics.heightPixels;
      height=mMetrics.widthPixels;
    }
    int keyboardHidden=mConfiguration.keyboardHidden;
    if (keyboardHidden == Configuration.KEYBOARDHIDDEN_NO && mConfiguration.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES) {
      keyboardHidden=Configuration.KEYBOARDHIDDEN_SOFT;
    }
    mAssets.setConfiguration(mConfiguration.mcc,mConfiguration.mnc,locale,mConfiguration.orientation,mConfiguration.touchscreen,(int)(mMetrics.density * 160),mConfiguration.keyboard,keyboardHidden,mConfiguration.navigation,width,height,mConfiguration.screenLayout,mConfiguration.uiMode,sSdkVersion);
    drawableCacheClear(mDrawableCache,configChanges);
    drawableCacheClear(mColorDrawableCache,configChanges);
    mColorStateListCache.clear();
    flushLayoutCache();
  }
synchronized (mSync) {
    if (mPluralRule != null) {
      mPluralRule=PluralRules.ruleForLocale(config.locale);
    }
  }
}