Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c7773d8 authored by P.Y. Laligand's avatar P.Y. Laligand
Browse files

Display mode switches.

Knowledge of the various modes of a display is now available to apps, and they can request a specific mode for their windows.

b/18241736

Change-Id: I8eb16ff713e878512faca3ca6662254f08a9be7f
parent 5cde38ce
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -525,10 +525,11 @@ aidl_files := \
	frameworks/base/core/java/android/net/Uri.aidl \
	frameworks/base/core/java/android/net/NetworkRequest.aidl \
	frameworks/base/core/java/android/net/LinkAddress.aidl \
	frameworks/base/core/java/android/view/Surface.aidl \
	frameworks/base/core/java/android/view/WindowContentFrameStats.aidl \
	frameworks/base/core/java/android/view/Display.aidl \
	frameworks/base/core/java/android/view/InputDevice.aidl \
	frameworks/base/core/java/android/view/InputEvent.aidl \
	frameworks/base/core/java/android/view/Surface.aidl \
	frameworks/base/core/java/android/view/WindowContentFrameStats.aidl \
	frameworks/base/core/java/android/view/inputmethod/InputMethodSubtype.aidl \
	frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.aidl \
	frameworks/base/core/java/android/view/inputmethod/CompletionInfo.aidl \
+15 −2
Original line number Diff line number Diff line
@@ -34784,6 +34784,7 @@ package android.view {
    method public int getFlags();
    method public deprecated int getHeight();
    method public void getMetrics(android.util.DisplayMetrics);
    method public android.view.Display.Mode getMode();
    method public java.lang.String getName();
    method public deprecated int getOrientation();
    method public deprecated int getPixelFormat();
@@ -34795,7 +34796,8 @@ package android.view {
    method public int getRotation();
    method public void getSize(android.graphics.Point);
    method public int getState();
    method public float[] getSupportedRefreshRates();
    method public android.view.Display.Mode[] getSupportedModes();
    method public deprecated float[] getSupportedRefreshRates();
    method public deprecated int getWidth();
    method public boolean isValid();
    field public static final int DEFAULT_DISPLAY = 0; // 0x0
@@ -34810,6 +34812,16 @@ package android.view {
    field public static final int STATE_UNKNOWN = 0; // 0x0
  }
  public static final class Display.Mode implements android.os.Parcelable {
    method public int describeContents();
    method public int getModeId();
    method public int getPhysicalHeight();
    method public int getPhysicalWidth();
    method public float getRefreshRate();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.Display.Mode> CREATOR;
  }
  public class DragEvent implements android.os.Parcelable {
    method public int describeContents();
    method public int getAction();
@@ -37589,7 +37601,8 @@ package android.view {
    field public float horizontalWeight;
    field public deprecated int memoryType;
    field public java.lang.String packageName;
    field public float preferredRefreshRate;
    field public int preferredDisplayModeId;
    field public deprecated float preferredRefreshRate;
    field public int rotationAnimation;
    field public float screenBrightness;
    field public int screenOrientation;
+15 −2
Original line number Diff line number Diff line
@@ -36994,6 +36994,7 @@ package android.view {
    method public int getFlags();
    method public deprecated int getHeight();
    method public void getMetrics(android.util.DisplayMetrics);
    method public android.view.Display.Mode getMode();
    method public java.lang.String getName();
    method public deprecated int getOrientation();
    method public deprecated int getPixelFormat();
@@ -37005,7 +37006,8 @@ package android.view {
    method public int getRotation();
    method public void getSize(android.graphics.Point);
    method public int getState();
    method public float[] getSupportedRefreshRates();
    method public android.view.Display.Mode[] getSupportedModes();
    method public deprecated float[] getSupportedRefreshRates();
    method public deprecated int getWidth();
    method public boolean isValid();
    field public static final int DEFAULT_DISPLAY = 0; // 0x0
@@ -37020,6 +37022,16 @@ package android.view {
    field public static final int STATE_UNKNOWN = 0; // 0x0
  }
  public static final class Display.Mode implements android.os.Parcelable {
    method public int describeContents();
    method public int getModeId();
    method public int getPhysicalHeight();
    method public int getPhysicalWidth();
    method public float getRefreshRate();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.Display.Mode> CREATOR;
  }
  public class DragEvent implements android.os.Parcelable {
    method public int describeContents();
    method public int getAction();
@@ -39802,7 +39814,8 @@ package android.view {
    field public float horizontalWeight;
    field public deprecated int memoryType;
    field public java.lang.String packageName;
    field public float preferredRefreshRate;
    field public int preferredDisplayModeId;
    field public deprecated float preferredRefreshRate;
    field public int rotationAnimation;
    field public float screenBrightness;
    field public int screenOrientation;
+3 −1
Original line number Diff line number Diff line
@@ -125,11 +125,13 @@ public abstract class DisplayManagerInternal {
     * mirroring.
     * @param requestedRefreshRate The preferred refresh rate for the top-most visible window that
     * has a preference.
     * @param requestedModeId The preferred mode id for the top-most visible window that has a
     * preference.
     * @param inTraversal True if called from WindowManagerService during a window traversal
     * prior to call to performTraversalInTransactionFromWindowManager.
     */
    public abstract void setDisplayProperties(int displayId, boolean hasContent,
            float requestedRefreshRate, boolean inTraversal);
            float requestedRefreshRate, int requestedModeId, boolean inTraversal);

    /**
     * Applies an offset to the contents of a display, for example to avoid burn-in.
+1 −1
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ public final class Choreographer {
    private static float getRefreshRate() {
        DisplayInfo di = DisplayManagerGlobal.getInstance().getDisplayInfo(
                Display.DEFAULT_DISPLAY);
        return di.refreshRate;
        return di.getMode().getRefreshRate();
    }

    /**
Loading