Loading core/java/android/view/Display.java +3 −3 Original line number Diff line number Diff line Loading @@ -1585,10 +1585,10 @@ public final class Display { return false; } final Configuration config = mResources.getConfiguration(); // TODO(b/179308296) Temporarily - never report max bounds to only Launcher if the feature // is disabled. // TODO(b/179308296) Temporarily exclude Launcher from being given max bounds, by checking // if the caller is the recents component. return config != null && !config.windowConfiguration.getMaxBounds().isEmpty() && (mDisplayInfo.shouldConstrainMetricsForLauncher || !isRecentsComponent()); && !isRecentsComponent(); } /** Loading core/java/android/view/DisplayInfo.java +0 −13 Original line number Diff line number Diff line Loading @@ -311,13 +311,6 @@ 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}. */ Loading Loading @@ -402,7 +395,6 @@ public final class DisplayInfo implements Parcelable { && brightnessMaximum == other.brightnessMaximum && brightnessDefault == other.brightnessDefault && Objects.equals(roundedCorners, other.roundedCorners) && shouldConstrainMetricsForLauncher == other.shouldConstrainMetricsForLauncher && installOrientation == other.installOrientation; } Loading Loading @@ -455,7 +447,6 @@ public final class DisplayInfo implements Parcelable { brightnessMaximum = other.brightnessMaximum; brightnessDefault = other.brightnessDefault; roundedCorners = other.roundedCorners; shouldConstrainMetricsForLauncher = other.shouldConstrainMetricsForLauncher; installOrientation = other.installOrientation; } Loading Loading @@ -514,7 +505,6 @@ public final class DisplayInfo implements Parcelable { for (int i = 0; i < numUserDisabledFormats; i++) { userDisabledHdrTypes[i] = source.readInt(); } shouldConstrainMetricsForLauncher = source.readBoolean(); installOrientation = source.readInt(); } Loading Loading @@ -571,7 +561,6 @@ public final class DisplayInfo implements Parcelable { for (int i = 0; i < userDisabledHdrTypes.length; i++) { dest.writeInt(userDisabledHdrTypes[i]); } dest.writeBoolean(shouldConstrainMetricsForLauncher); dest.writeInt(installOrientation); } Loading Loading @@ -829,8 +818,6 @@ public final class DisplayInfo implements Parcelable { sb.append(brightnessMaximum); sb.append(", brightnessDefault "); sb.append(brightnessDefault); sb.append(", shouldConstrainMetricsForLauncher "); sb.append(shouldConstrainMetricsForLauncher); sb.append(", installOrientation "); sb.append(Surface.rotationToString(installOrientation)); sb.append("}"); Loading services/core/java/com/android/server/display/DisplayManagerService.java +2 −18 Original line number Diff line number Diff line Loading @@ -70,6 +70,8 @@ import android.hardware.display.DisplayManagerGlobal; import android.hardware.display.DisplayManagerInternal; import android.hardware.display.DisplayManagerInternal.DisplayGroupListener; import android.hardware.display.DisplayManagerInternal.DisplayTransactionListener; import android.hardware.display.DisplayManagerInternal.RefreshRateLimitation; import android.hardware.display.DisplayManagerInternal.RefreshRateRange; import android.hardware.display.DisplayViewport; import android.hardware.display.DisplayedContentSample; import android.hardware.display.DisplayedContentSamplingAttributes; Loading Loading @@ -708,9 +710,6 @@ public final class DisplayManagerService extends SystemService { synchronized (mSyncRoot) { final LogicalDisplay display = mLogicalDisplayMapper.getDisplayLocked(displayId); if (display != null) { // Do not let constrain be overwritten by override from WindowManager. info.shouldConstrainMetricsForLauncher = display.getDisplayInfoLocked().shouldConstrainMetricsForLauncher; if (display.setDisplayInfoOverrideFromWindowManagerLocked(info)) { handleLogicalDisplayChangedLocked(display); } Loading Loading @@ -2212,21 +2211,6 @@ public final class DisplayManagerService extends SystemService { } } void setShouldConstrainMetricsForLauncher(boolean constrain) { // Apply constrain for every display. synchronized (mSyncRoot) { int[] displayIds = mLogicalDisplayMapper.getDisplayIdsLocked(Process.myUid()); for (int i : displayIds) { final LogicalDisplay display = mLogicalDisplayMapper.getDisplayLocked(i); if (display == null) { return; } display.getDisplayInfoLocked().shouldConstrainMetricsForLauncher = constrain; setDisplayInfoOverrideFromWindowManagerInternal(i, display.getDisplayInfoLocked()); } } } void setDockedAndIdleEnabled(boolean enabled, int displayId) { synchronized (mSyncRoot) { final DisplayPowerController displayPowerController = mDisplayPowerControllers.get( Loading services/core/java/com/android/server/display/DisplayManagerShellCommand.java +0 −16 Original line number Diff line number Diff line Loading @@ -60,8 +60,6 @@ class DisplayManagerShellCommand extends ShellCommand { return setDisplayModeDirectorLoggingEnabled(false); case "dwb-set-cct": return setAmbientColorTemperatureOverride(); case "constrain-launcher-metrics": return setConstrainLauncherMetrics(); case "set-user-preferred-display-mode": return setUserPreferredDisplayMode(); case "clear-user-preferred-display-mode": Loading Loading @@ -112,9 +110,6 @@ class DisplayManagerShellCommand extends ShellCommand { pw.println(" Disable display mode director logging."); pw.println(" dwb-set-cct CCT"); pw.println(" Sets the ambient color temperature override to CCT (use -1 to disable)."); pw.println(" constrain-launcher-metrics [true|false]"); pw.println(" Sets if Display#getRealSize and getRealMetrics should be constrained for "); pw.println(" Launcher."); pw.println(" set-user-preferred-display-mode WIDTH HEIGHT REFRESH-RATE " + "DISPLAY_ID (optional)"); pw.println(" Sets the user preferred display mode which has fields WIDTH, HEIGHT and " Loading Loading @@ -205,17 +200,6 @@ class DisplayManagerShellCommand extends ShellCommand { return 0; } private int setConstrainLauncherMetrics() { String constrainText = getNextArg(); if (constrainText == null) { getErrPrintWriter().println("Error: no value specified"); return 1; } boolean constrain = Boolean.parseBoolean(constrainText); mService.setShouldConstrainMetricsForLauncher(constrain); return 0; } private int setUserPreferredDisplayMode() { final String widthText = getNextArg(); if (widthText == null) { Loading services/core/java/com/android/server/display/LogicalDisplay.java +0 −2 Original line number Diff line number Diff line Loading @@ -233,8 +233,6 @@ final class LogicalDisplay { info.displayCutout = mOverrideDisplayInfo.displayCutout; info.logicalDensityDpi = mOverrideDisplayInfo.logicalDensityDpi; info.roundedCorners = mOverrideDisplayInfo.roundedCorners; info.shouldConstrainMetricsForLauncher = mOverrideDisplayInfo.shouldConstrainMetricsForLauncher; } mInfo.set(info); } Loading Loading
core/java/android/view/Display.java +3 −3 Original line number Diff line number Diff line Loading @@ -1585,10 +1585,10 @@ public final class Display { return false; } final Configuration config = mResources.getConfiguration(); // TODO(b/179308296) Temporarily - never report max bounds to only Launcher if the feature // is disabled. // TODO(b/179308296) Temporarily exclude Launcher from being given max bounds, by checking // if the caller is the recents component. return config != null && !config.windowConfiguration.getMaxBounds().isEmpty() && (mDisplayInfo.shouldConstrainMetricsForLauncher || !isRecentsComponent()); && !isRecentsComponent(); } /** Loading
core/java/android/view/DisplayInfo.java +0 −13 Original line number Diff line number Diff line Loading @@ -311,13 +311,6 @@ 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}. */ Loading Loading @@ -402,7 +395,6 @@ public final class DisplayInfo implements Parcelable { && brightnessMaximum == other.brightnessMaximum && brightnessDefault == other.brightnessDefault && Objects.equals(roundedCorners, other.roundedCorners) && shouldConstrainMetricsForLauncher == other.shouldConstrainMetricsForLauncher && installOrientation == other.installOrientation; } Loading Loading @@ -455,7 +447,6 @@ public final class DisplayInfo implements Parcelable { brightnessMaximum = other.brightnessMaximum; brightnessDefault = other.brightnessDefault; roundedCorners = other.roundedCorners; shouldConstrainMetricsForLauncher = other.shouldConstrainMetricsForLauncher; installOrientation = other.installOrientation; } Loading Loading @@ -514,7 +505,6 @@ public final class DisplayInfo implements Parcelable { for (int i = 0; i < numUserDisabledFormats; i++) { userDisabledHdrTypes[i] = source.readInt(); } shouldConstrainMetricsForLauncher = source.readBoolean(); installOrientation = source.readInt(); } Loading Loading @@ -571,7 +561,6 @@ public final class DisplayInfo implements Parcelable { for (int i = 0; i < userDisabledHdrTypes.length; i++) { dest.writeInt(userDisabledHdrTypes[i]); } dest.writeBoolean(shouldConstrainMetricsForLauncher); dest.writeInt(installOrientation); } Loading Loading @@ -829,8 +818,6 @@ public final class DisplayInfo implements Parcelable { sb.append(brightnessMaximum); sb.append(", brightnessDefault "); sb.append(brightnessDefault); sb.append(", shouldConstrainMetricsForLauncher "); sb.append(shouldConstrainMetricsForLauncher); sb.append(", installOrientation "); sb.append(Surface.rotationToString(installOrientation)); sb.append("}"); Loading
services/core/java/com/android/server/display/DisplayManagerService.java +2 −18 Original line number Diff line number Diff line Loading @@ -70,6 +70,8 @@ import android.hardware.display.DisplayManagerGlobal; import android.hardware.display.DisplayManagerInternal; import android.hardware.display.DisplayManagerInternal.DisplayGroupListener; import android.hardware.display.DisplayManagerInternal.DisplayTransactionListener; import android.hardware.display.DisplayManagerInternal.RefreshRateLimitation; import android.hardware.display.DisplayManagerInternal.RefreshRateRange; import android.hardware.display.DisplayViewport; import android.hardware.display.DisplayedContentSample; import android.hardware.display.DisplayedContentSamplingAttributes; Loading Loading @@ -708,9 +710,6 @@ public final class DisplayManagerService extends SystemService { synchronized (mSyncRoot) { final LogicalDisplay display = mLogicalDisplayMapper.getDisplayLocked(displayId); if (display != null) { // Do not let constrain be overwritten by override from WindowManager. info.shouldConstrainMetricsForLauncher = display.getDisplayInfoLocked().shouldConstrainMetricsForLauncher; if (display.setDisplayInfoOverrideFromWindowManagerLocked(info)) { handleLogicalDisplayChangedLocked(display); } Loading Loading @@ -2212,21 +2211,6 @@ public final class DisplayManagerService extends SystemService { } } void setShouldConstrainMetricsForLauncher(boolean constrain) { // Apply constrain for every display. synchronized (mSyncRoot) { int[] displayIds = mLogicalDisplayMapper.getDisplayIdsLocked(Process.myUid()); for (int i : displayIds) { final LogicalDisplay display = mLogicalDisplayMapper.getDisplayLocked(i); if (display == null) { return; } display.getDisplayInfoLocked().shouldConstrainMetricsForLauncher = constrain; setDisplayInfoOverrideFromWindowManagerInternal(i, display.getDisplayInfoLocked()); } } } void setDockedAndIdleEnabled(boolean enabled, int displayId) { synchronized (mSyncRoot) { final DisplayPowerController displayPowerController = mDisplayPowerControllers.get( Loading
services/core/java/com/android/server/display/DisplayManagerShellCommand.java +0 −16 Original line number Diff line number Diff line Loading @@ -60,8 +60,6 @@ class DisplayManagerShellCommand extends ShellCommand { return setDisplayModeDirectorLoggingEnabled(false); case "dwb-set-cct": return setAmbientColorTemperatureOverride(); case "constrain-launcher-metrics": return setConstrainLauncherMetrics(); case "set-user-preferred-display-mode": return setUserPreferredDisplayMode(); case "clear-user-preferred-display-mode": Loading Loading @@ -112,9 +110,6 @@ class DisplayManagerShellCommand extends ShellCommand { pw.println(" Disable display mode director logging."); pw.println(" dwb-set-cct CCT"); pw.println(" Sets the ambient color temperature override to CCT (use -1 to disable)."); pw.println(" constrain-launcher-metrics [true|false]"); pw.println(" Sets if Display#getRealSize and getRealMetrics should be constrained for "); pw.println(" Launcher."); pw.println(" set-user-preferred-display-mode WIDTH HEIGHT REFRESH-RATE " + "DISPLAY_ID (optional)"); pw.println(" Sets the user preferred display mode which has fields WIDTH, HEIGHT and " Loading Loading @@ -205,17 +200,6 @@ class DisplayManagerShellCommand extends ShellCommand { return 0; } private int setConstrainLauncherMetrics() { String constrainText = getNextArg(); if (constrainText == null) { getErrPrintWriter().println("Error: no value specified"); return 1; } boolean constrain = Boolean.parseBoolean(constrainText); mService.setShouldConstrainMetricsForLauncher(constrain); return 0; } private int setUserPreferredDisplayMode() { final String widthText = getNextArg(); if (widthText == null) { Loading
services/core/java/com/android/server/display/LogicalDisplay.java +0 −2 Original line number Diff line number Diff line Loading @@ -233,8 +233,6 @@ final class LogicalDisplay { info.displayCutout = mOverrideDisplayInfo.displayCutout; info.logicalDensityDpi = mOverrideDisplayInfo.logicalDensityDpi; info.roundedCorners = mOverrideDisplayInfo.roundedCorners; info.shouldConstrainMetricsForLauncher = mOverrideDisplayInfo.shouldConstrainMetricsForLauncher; } mInfo.set(info); } Loading