Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c4e4345 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Reduce unnecessary config change when setting locale" into main

parents 7a782e0b f881d267
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -5032,6 +5032,13 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                // Window configuration is unrelated to persistent configuration (e.g. font scale,
                // locale). Unset it to avoid affecting the current display configuration.
                values.windowConfiguration.setToDefaults();
                // A locale change may set layout direction (Configuration#setLocales()) without
                // including other screen layout bits, so preserve it to avoid extra config change.
                if (values.userSetLocale && values.screenLayout
                        == (values.screenLayout & Configuration.SCREENLAYOUT_LAYOUTDIR_MASK)) {
                    values.screenLayout |= (getGlobalConfiguration().screenLayout
                            & ~Configuration.SCREENLAYOUT_LAYOUTDIR_MASK);
                }
                updateConfigurationLocked(values, false /* initLocale */, true /* persistent */,
                        userId);
            }