Ignore empty locale list when diffing Configuration objects

b46fdd4 introduced the concept of locale list to Configuration objects.
However, the change alway returned a locale difference when the delta
object locale list is set to the defualt (empty). We now don't return
a difference if the delta object as an empty locale list which is
consistent with what we did before the change and in line with how we
diff other configuration fields.

Bug: 23744091
Change-Id: I8c2c39d9a7e91e6a3a283312b745c4fdf6874396
This commit is contained in:
Wale Ogunwale
2015-09-03 15:08:51 -07:00
parent 4501d23ced
commit b1a4bf2c4b

View File

@@ -1049,7 +1049,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
}
fixUpLocaleList();
delta.fixUpLocaleList();
if (!mLocaleList.equals(delta.mLocaleList)) {
if (!delta.mLocaleList.isEmpty() && !mLocaleList.equals(delta.mLocaleList)) {
changed |= ActivityInfo.CONFIG_LOCALE;
changed |= ActivityInfo.CONFIG_LAYOUT_DIRECTION;
}