Merge "Make VIRTUAL_DISPLAY_FLAG_ROTATES_WITH_CONTENT a SytemApi." into main
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index ad65806..c3c3882 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -4529,6 +4529,7 @@
method @RequiresPermission(android.Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS) public void setBrightnessConfiguration(android.hardware.display.BrightnessConfiguration);
method @RequiresPermission(android.Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS) public void setBrightnessConfigurationForDisplay(@NonNull android.hardware.display.BrightnessConfiguration, @NonNull String);
method @Deprecated @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_SATURATION) public void setSaturationLevel(float);
+ field public static final int VIRTUAL_DISPLAY_FLAG_ROTATES_WITH_CONTENT = 128; // 0x80
field public static final int VIRTUAL_DISPLAY_FLAG_STEAL_TOP_FOCUS_DISABLED = 65536; // 0x10000
field public static final int VIRTUAL_DISPLAY_FLAG_TRUSTED = 1024; // 0x400
}
diff --git a/core/java/android/hardware/display/DisplayManager.java b/core/java/android/hardware/display/DisplayManager.java
index f0c87a1..990ebc5 100644
--- a/core/java/android/hardware/display/DisplayManager.java
+++ b/core/java/android/hardware/display/DisplayManager.java
@@ -27,6 +27,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
+import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
@@ -364,11 +365,20 @@
/**
* Virtual display flag: Indicates that the orientation of this display device is coupled to
- * the rotation of its associated logical display.
+ * the orientation of its associated logical display.
+ * <p>
+ * The flag should not be set when the physical display is mounted in a fixed orientation
+ * such as on a desk. Without this flag, display manager will apply a coordinate transformation
+ * such as a scale and translation to letterbox or pillarbox format under the assumption that
+ * the physical orientation of the display is invariant. With this flag set, the content will
+ * rotate to fill in the space of the display, as it does on the internal device display.
+ * </p>
*
* @see #createVirtualDisplay
* @hide
*/
+ @SuppressLint("UnflaggedApi")
+ @SystemApi
public static final int VIRTUAL_DISPLAY_FLAG_ROTATES_WITH_CONTENT = 1 << 7;
/**