Make sure fontScale in configuration sent to app is equal to global

We don't want the default value 1.0 from empty config to be applied
as an override.

bug: 29367672
Change-Id: Ia9947c24fa9435ba5b208eb9bd05e0b07b574015
This commit is contained in:
Chong Zhang
2016-06-17 16:24:21 -07:00
parent 8e8fb7dda0
commit 6be533ef6c

View File

@@ -444,10 +444,17 @@ final class ActivityRecord {
return;
}
try {
// Make sure fontScale is always equal to global. For fullscreen apps, config is
// the shared EMPTY config, which has default fontScale of 1.0. We don't want it
// to be applied as an override config.
Configuration overrideConfig = new Configuration(config);
overrideConfig.fontScale = service.mConfiguration.fontScale;
if (DEBUG_CONFIGURATION) Slog.v(TAG, "Sending new config to " + this + " " +
"reportToActivity=" + reportToActivity + " and config: " + config);
"reportToActivity=" + reportToActivity + " and config: " + overrideConfig);
app.thread.scheduleActivityConfigurationChanged(
appToken, new Configuration(config), reportToActivity);
appToken, overrideConfig, reportToActivity);
} catch (RemoteException e) {
// If process died, whatever.
}