Loading core/java/android/content/res/Configuration.java +11 −3 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; import android.app.UiModeManager; import android.app.WindowConfiguration; import android.compat.annotation.UnsupportedAppUsage; import android.content.LocaleProto; Loading Loading @@ -928,7 +927,13 @@ public final class Configuration implements Parcelable, Comparable<Configuration fontScale = o.fontScale; mcc = o.mcc; mnc = o.mnc; locale = o.locale == null ? null : (Locale) o.locale.clone(); if (o.locale == null) { locale = null; } else if (!o.locale.equals(locale)) { // Only clone a new Locale instance if we need to: the clone() is // both CPU and GC intensive. locale = (Locale) o.locale.clone(); } o.fixUpLocaleList(); mLocaleList = o.mLocaleList; userSetLocale = o.userSetLocale; Loading Loading @@ -1624,9 +1629,12 @@ public final class Configuration implements Parcelable, Comparable<Configuration if ((mask & ActivityInfo.CONFIG_LOCALE) != 0) { mLocaleList = delta.mLocaleList; if (!mLocaleList.isEmpty()) { if (!delta.locale.equals(locale)) { // Don't churn a new Locale clone unless we're actually changing it locale = (Locale) delta.locale.clone(); } } } if ((mask & ActivityInfo.CONFIG_LAYOUT_DIRECTION) != 0) { final int deltaScreenLayoutDir = delta.screenLayout & SCREENLAYOUT_LAYOUTDIR_MASK; screenLayout = (screenLayout & ~SCREENLAYOUT_LAYOUTDIR_MASK) | deltaScreenLayoutDir; Loading Loading
core/java/android/content/res/Configuration.java +11 −3 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; import android.app.UiModeManager; import android.app.WindowConfiguration; import android.compat.annotation.UnsupportedAppUsage; import android.content.LocaleProto; Loading Loading @@ -928,7 +927,13 @@ public final class Configuration implements Parcelable, Comparable<Configuration fontScale = o.fontScale; mcc = o.mcc; mnc = o.mnc; locale = o.locale == null ? null : (Locale) o.locale.clone(); if (o.locale == null) { locale = null; } else if (!o.locale.equals(locale)) { // Only clone a new Locale instance if we need to: the clone() is // both CPU and GC intensive. locale = (Locale) o.locale.clone(); } o.fixUpLocaleList(); mLocaleList = o.mLocaleList; userSetLocale = o.userSetLocale; Loading Loading @@ -1624,9 +1629,12 @@ public final class Configuration implements Parcelable, Comparable<Configuration if ((mask & ActivityInfo.CONFIG_LOCALE) != 0) { mLocaleList = delta.mLocaleList; if (!mLocaleList.isEmpty()) { if (!delta.locale.equals(locale)) { // Don't churn a new Locale clone unless we're actually changing it locale = (Locale) delta.locale.clone(); } } } if ((mask & ActivityInfo.CONFIG_LAYOUT_DIRECTION) != 0) { final int deltaScreenLayoutDir = delta.screenLayout & SCREENLAYOUT_LAYOUTDIR_MASK; screenLayout = (screenLayout & ~SCREENLAYOUT_LAYOUTDIR_MASK) | deltaScreenLayoutDir; Loading