diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/Display.java | 6 | ||||
| -rw-r--r-- | core/java/android/view/DisplayInfo.java | 15 |
2 files changed, 17 insertions, 4 deletions
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index 9cb0d1ff2c3f..e7ff978266a2 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -1463,10 +1463,10 @@ public final class Display { return false; } final Configuration config = mResources.getConfiguration(); - // TODO(b/179308296) Temporarily exclude Launcher from being given max bounds, by checking - // if the caller is the recents component. + // TODO(b/179308296) Temporarily - never report max bounds to only Launcher if the feature + // is disabled. return config != null && !config.windowConfiguration.getMaxBounds().isEmpty() - && !isRecentsComponent(); + && (mDisplayInfo.shouldConstrainMetricsForLauncher || !isRecentsComponent()); } /** diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java index 8e5f905e9c74..657251046551 100644 --- a/core/java/android/view/DisplayInfo.java +++ b/core/java/android/view/DisplayInfo.java @@ -306,6 +306,13 @@ public final class DisplayInfo implements Parcelable { public float brightnessDefault; /** + * @hide + * True if Display#getRealSize and getRealMetrics should be constrained for Launcher, false + * otherwise. + */ + public boolean shouldConstrainMetricsForLauncher = false; + + /** * The {@link RoundedCorners} if present, otherwise {@code null}. */ @Nullable @@ -381,7 +388,8 @@ public final class DisplayInfo implements Parcelable { && brightnessMinimum == other.brightnessMinimum && brightnessMaximum == other.brightnessMaximum && brightnessDefault == other.brightnessDefault - && Objects.equals(roundedCorners, other.roundedCorners); + && Objects.equals(roundedCorners, other.roundedCorners) + && shouldConstrainMetricsForLauncher == other.shouldConstrainMetricsForLauncher; } @Override @@ -432,6 +440,7 @@ public final class DisplayInfo implements Parcelable { brightnessMaximum = other.brightnessMaximum; brightnessDefault = other.brightnessDefault; roundedCorners = other.roundedCorners; + shouldConstrainMetricsForLauncher = other.shouldConstrainMetricsForLauncher; } public void readFromParcel(Parcel source) { @@ -488,6 +497,7 @@ public final class DisplayInfo implements Parcelable { for (int i = 0; i < numUserDisabledFormats; i++) { userDisabledHdrTypes[i] = source.readInt(); } + shouldConstrainMetricsForLauncher = source.readBoolean(); } @Override @@ -542,6 +552,7 @@ public final class DisplayInfo implements Parcelable { for (int i = 0; i < userDisabledHdrTypes.length; i++) { dest.writeInt(userDisabledHdrTypes[i]); } + dest.writeBoolean(shouldConstrainMetricsForLauncher); } @Override @@ -796,6 +807,8 @@ public final class DisplayInfo implements Parcelable { sb.append(brightnessMaximum); sb.append(", brightnessDefault "); sb.append(brightnessDefault); + sb.append(", shouldConstrainMetricsForLauncher "); + sb.append(shouldConstrainMetricsForLauncher); sb.append("}"); return sb.toString(); } |
