mOverlayDirs = overlayDirs;
mLibDirs = libDirs;
mDisplayId = displayId;
- mOverrideConfiguration = overrideConfig != null ? overrideConfig : Configuration.EMPTY;
+ mOverrideConfiguration = new Configuration(overrideConfig != null
+ ? overrideConfig : Configuration.EMPTY);
mCompatInfo = compatInfo != null ? compatInfo : CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO;
int hash = 17;
public static final DisplayAdjustments DEFAULT_DISPLAY_ADJUSTMENTS = new DisplayAdjustments();
private volatile CompatibilityInfo mCompatInfo = CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO;
- private Configuration mConfiguration = Configuration.EMPTY;
+ private Configuration mConfiguration;
public DisplayAdjustments() {
}
public DisplayAdjustments(Configuration configuration) {
- mConfiguration = configuration;
+ mConfiguration = new Configuration(configuration != null
+ ? configuration : Configuration.EMPTY);
}
public DisplayAdjustments(DisplayAdjustments daj) {
setCompatibilityInfo(daj.mCompatInfo);
- mConfiguration = daj.mConfiguration;
+ mConfiguration = new Configuration(daj.mConfiguration != null
+ ? daj.mConfiguration : Configuration.EMPTY);
}
public void setCompatibilityInfo(CompatibilityInfo compatInfo) {
throw new IllegalArgumentException(
"setConfiguration: Cannot modify DEFAULT_DISPLAY_ADJUSTMENTS");
}
- mConfiguration = configuration != null ? configuration : Configuration.EMPTY;
+ mConfiguration.setTo(configuration != null ? configuration : Configuration.EMPTY);
}
public Configuration getConfiguration() {
}
/** Clears passed config and fills it with new override values. */
- private Configuration calculateOverrideConfig(Configuration config, Rect bounds,
- Rect insetBounds, boolean overrideWidth, boolean overrideHeight) {
+ private void calculateOverrideConfig(Configuration config, Rect bounds, Rect insetBounds,
+ boolean overrideWidth, boolean overrideHeight) {
mTmpNonDecorBounds.set(bounds);
mTmpStableBounds.set(bounds);
subtractNonDecorInsets(
config.smallestScreenWidthDp = mService.mWindowManager.getSmallestWidthForTaskBounds(
insetBounds != null ? insetBounds : bounds);
- return config;
}
/**
}
}
- if (overrideConfig != null && overrideConfig != EMPTY) {
+ if (overrideConfig != null && !overrideConfig.equals(EMPTY)) {
if (DEBUG_STARTING_WINDOW) Slog.d(TAG, "addStartingWindow: creating context based"
+ " on overrideConfig" + overrideConfig + " for starting window");
final Context overrideContext = context.createConfigurationContext(overrideConfig);