Loading core/java/android/view/DisplayInfo.java +13 −1 Original line number Diff line number Diff line Loading @@ -318,6 +318,12 @@ public final class DisplayInfo implements Parcelable { @Nullable public RoundedCorners roundedCorners; /** * Install orientation of the display relative to its natural orientation. */ @Surface.Rotation public int installOrientation; public static final @android.annotation.NonNull Creator<DisplayInfo> CREATOR = new Creator<DisplayInfo>() { @Override public DisplayInfo createFromParcel(Parcel source) { Loading Loading @@ -389,7 +395,8 @@ public final class DisplayInfo implements Parcelable { && brightnessMaximum == other.brightnessMaximum && brightnessDefault == other.brightnessDefault && Objects.equals(roundedCorners, other.roundedCorners) && shouldConstrainMetricsForLauncher == other.shouldConstrainMetricsForLauncher; && shouldConstrainMetricsForLauncher == other.shouldConstrainMetricsForLauncher && installOrientation == other.installOrientation; } @Override Loading Loading @@ -441,6 +448,7 @@ public final class DisplayInfo implements Parcelable { brightnessDefault = other.brightnessDefault; roundedCorners = other.roundedCorners; shouldConstrainMetricsForLauncher = other.shouldConstrainMetricsForLauncher; installOrientation = other.installOrientation; } public void readFromParcel(Parcel source) { Loading Loading @@ -498,6 +506,7 @@ public final class DisplayInfo implements Parcelable { userDisabledHdrTypes[i] = source.readInt(); } shouldConstrainMetricsForLauncher = source.readBoolean(); installOrientation = source.readInt(); } @Override Loading Loading @@ -553,6 +562,7 @@ public final class DisplayInfo implements Parcelable { dest.writeInt(userDisabledHdrTypes[i]); } dest.writeBoolean(shouldConstrainMetricsForLauncher); dest.writeInt(installOrientation); } @Override Loading Loading @@ -809,6 +819,8 @@ public final class DisplayInfo implements Parcelable { sb.append(brightnessDefault); sb.append(", shouldConstrainMetricsForLauncher "); sb.append(shouldConstrainMetricsForLauncher); sb.append(", installOrientation "); sb.append(Surface.rotationToString(installOrientation)); sb.append("}"); return sb.toString(); } Loading core/java/android/view/SurfaceControl.java +6 −3 Original line number Diff line number Diff line Loading @@ -1831,13 +1831,15 @@ public final class SurfaceControl implements Parcelable { public float density; public boolean secure; public DeviceProductInfo deviceProductInfo; public @Surface.Rotation int installOrientation; @Override public String toString() { return "StaticDisplayInfo{isInternal=" + isInternal + ", density=" + density + ", secure=" + secure + ", deviceProductInfo=" + deviceProductInfo + "}"; + ", deviceProductInfo=" + deviceProductInfo + ", installOrientation=" + installOrientation + "}"; } @Override Loading @@ -1848,12 +1850,13 @@ public final class SurfaceControl implements Parcelable { return isInternal == that.isInternal && density == that.density && secure == that.secure && Objects.equals(deviceProductInfo, that.deviceProductInfo); && Objects.equals(deviceProductInfo, that.deviceProductInfo) && installOrientation == that.installOrientation; } @Override public int hashCode() { return Objects.hash(isInternal, density, secure, deviceProductInfo); return Objects.hash(isInternal, density, secure, deviceProductInfo, installOrientation); } } Loading core/jni/android_view_SurfaceControl.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ static struct { jfieldID density; jfieldID secure; jfieldID deviceProductInfo; jfieldID installOrientation; } gStaticDisplayInfoClassInfo; static struct { Loading Loading @@ -1210,6 +1211,8 @@ static jobject nativeGetStaticDisplayInfo(JNIEnv* env, jclass clazz, jobject tok env->SetBooleanField(object, gStaticDisplayInfoClassInfo.secure, info.secure); env->SetObjectField(object, gStaticDisplayInfoClassInfo.deviceProductInfo, convertDeviceProductInfoToJavaObject(env, info.deviceProductInfo)); env->SetIntField(object, gStaticDisplayInfoClassInfo.installOrientation, static_cast<uint32_t>(info.installOrientation)); return object; } Loading Loading @@ -2152,6 +2155,8 @@ int register_android_view_SurfaceControl(JNIEnv* env) gStaticDisplayInfoClassInfo.deviceProductInfo = GetFieldIDOrDie(env, infoClazz, "deviceProductInfo", "Landroid/hardware/display/DeviceProductInfo;"); gStaticDisplayInfoClassInfo.installOrientation = GetFieldIDOrDie(env, infoClazz, "installOrientation", "I"); jclass dynamicInfoClazz = FindClassOrDie(env, "android/view/SurfaceControl$DynamicDisplayInfo"); gDynamicDisplayInfoClassInfo.clazz = MakeGlobalRefOrDie(env, dynamicInfoClazz); Loading data/etc/services.core.protolog.json +6 −6 Original line number Diff line number Diff line Loading @@ -493,12 +493,6 @@ "group": "WM_DEBUG_STATES", "at": "com\/android\/server\/wm\/ActivityRecord.java" }, "-1556507536": { "message": "Passing transform hint %d for window %s%s", "level": "VERBOSE", "group": "WM_DEBUG_ORIENTATION", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "-1554521902": { "message": "showInsets(ime) was requested by different window: %s ", "level": "WARN", Loading Loading @@ -817,6 +811,12 @@ "group": "WM_DEBUG_REMOTE_ANIMATIONS", "at": "com\/android\/server\/wm\/RemoteAnimationController.java" }, "-1248290210": { "message": "Passing transform hint %d for window %s", "level": "VERBOSE", "group": "WM_DEBUG_ORIENTATION", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "-1228653755": { "message": "Launch on display check: displayId=%d callingPid=%d callingUid=%d", "level": "DEBUG", Loading services/core/java/com/android/server/display/DisplayDeviceInfo.java +10 −1 Original line number Diff line number Diff line Loading @@ -358,6 +358,12 @@ final class DisplayDeviceInfo { public float brightnessMaximum; public float brightnessDefault; /** * Install orientation of display panel relative to its natural orientation. */ @Surface.Rotation public int installOrientation = Surface.ROTATION_0; public void setAssumedDensityForExternalDisplay(int width, int height) { densityDpi = Math.min(width, height) * DisplayMetrics.DENSITY_XHIGH / 1080; // Technically, these values should be smaller than the apparent density Loading Loading @@ -417,7 +423,8 @@ final class DisplayDeviceInfo { || !BrightnessSynchronizer.floatEquals(brightnessMaximum, other.brightnessMaximum) || !BrightnessSynchronizer.floatEquals(brightnessDefault, other.brightnessDefault) || !Objects.equals(roundedCorners, other.roundedCorners)) { || !Objects.equals(roundedCorners, other.roundedCorners) || installOrientation != other.installOrientation) { diff |= DIFF_OTHER; } return diff; Loading Loading @@ -461,6 +468,7 @@ final class DisplayDeviceInfo { brightnessMaximum = other.brightnessMaximum; brightnessDefault = other.brightnessDefault; roundedCorners = other.roundedCorners; installOrientation = other.installOrientation; } // For debugging purposes Loading Loading @@ -508,6 +516,7 @@ final class DisplayDeviceInfo { sb.append(", roundedCorners ").append(roundedCorners); } sb.append(flagsToString(flags)); sb.append(", installOrientation ").append(installOrientation); sb.append("}"); return sb.toString(); } Loading Loading
core/java/android/view/DisplayInfo.java +13 −1 Original line number Diff line number Diff line Loading @@ -318,6 +318,12 @@ public final class DisplayInfo implements Parcelable { @Nullable public RoundedCorners roundedCorners; /** * Install orientation of the display relative to its natural orientation. */ @Surface.Rotation public int installOrientation; public static final @android.annotation.NonNull Creator<DisplayInfo> CREATOR = new Creator<DisplayInfo>() { @Override public DisplayInfo createFromParcel(Parcel source) { Loading Loading @@ -389,7 +395,8 @@ public final class DisplayInfo implements Parcelable { && brightnessMaximum == other.brightnessMaximum && brightnessDefault == other.brightnessDefault && Objects.equals(roundedCorners, other.roundedCorners) && shouldConstrainMetricsForLauncher == other.shouldConstrainMetricsForLauncher; && shouldConstrainMetricsForLauncher == other.shouldConstrainMetricsForLauncher && installOrientation == other.installOrientation; } @Override Loading Loading @@ -441,6 +448,7 @@ public final class DisplayInfo implements Parcelable { brightnessDefault = other.brightnessDefault; roundedCorners = other.roundedCorners; shouldConstrainMetricsForLauncher = other.shouldConstrainMetricsForLauncher; installOrientation = other.installOrientation; } public void readFromParcel(Parcel source) { Loading Loading @@ -498,6 +506,7 @@ public final class DisplayInfo implements Parcelable { userDisabledHdrTypes[i] = source.readInt(); } shouldConstrainMetricsForLauncher = source.readBoolean(); installOrientation = source.readInt(); } @Override Loading Loading @@ -553,6 +562,7 @@ public final class DisplayInfo implements Parcelable { dest.writeInt(userDisabledHdrTypes[i]); } dest.writeBoolean(shouldConstrainMetricsForLauncher); dest.writeInt(installOrientation); } @Override Loading Loading @@ -809,6 +819,8 @@ public final class DisplayInfo implements Parcelable { sb.append(brightnessDefault); sb.append(", shouldConstrainMetricsForLauncher "); sb.append(shouldConstrainMetricsForLauncher); sb.append(", installOrientation "); sb.append(Surface.rotationToString(installOrientation)); sb.append("}"); return sb.toString(); } Loading
core/java/android/view/SurfaceControl.java +6 −3 Original line number Diff line number Diff line Loading @@ -1831,13 +1831,15 @@ public final class SurfaceControl implements Parcelable { public float density; public boolean secure; public DeviceProductInfo deviceProductInfo; public @Surface.Rotation int installOrientation; @Override public String toString() { return "StaticDisplayInfo{isInternal=" + isInternal + ", density=" + density + ", secure=" + secure + ", deviceProductInfo=" + deviceProductInfo + "}"; + ", deviceProductInfo=" + deviceProductInfo + ", installOrientation=" + installOrientation + "}"; } @Override Loading @@ -1848,12 +1850,13 @@ public final class SurfaceControl implements Parcelable { return isInternal == that.isInternal && density == that.density && secure == that.secure && Objects.equals(deviceProductInfo, that.deviceProductInfo); && Objects.equals(deviceProductInfo, that.deviceProductInfo) && installOrientation == that.installOrientation; } @Override public int hashCode() { return Objects.hash(isInternal, density, secure, deviceProductInfo); return Objects.hash(isInternal, density, secure, deviceProductInfo, installOrientation); } } Loading
core/jni/android_view_SurfaceControl.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ static struct { jfieldID density; jfieldID secure; jfieldID deviceProductInfo; jfieldID installOrientation; } gStaticDisplayInfoClassInfo; static struct { Loading Loading @@ -1210,6 +1211,8 @@ static jobject nativeGetStaticDisplayInfo(JNIEnv* env, jclass clazz, jobject tok env->SetBooleanField(object, gStaticDisplayInfoClassInfo.secure, info.secure); env->SetObjectField(object, gStaticDisplayInfoClassInfo.deviceProductInfo, convertDeviceProductInfoToJavaObject(env, info.deviceProductInfo)); env->SetIntField(object, gStaticDisplayInfoClassInfo.installOrientation, static_cast<uint32_t>(info.installOrientation)); return object; } Loading Loading @@ -2152,6 +2155,8 @@ int register_android_view_SurfaceControl(JNIEnv* env) gStaticDisplayInfoClassInfo.deviceProductInfo = GetFieldIDOrDie(env, infoClazz, "deviceProductInfo", "Landroid/hardware/display/DeviceProductInfo;"); gStaticDisplayInfoClassInfo.installOrientation = GetFieldIDOrDie(env, infoClazz, "installOrientation", "I"); jclass dynamicInfoClazz = FindClassOrDie(env, "android/view/SurfaceControl$DynamicDisplayInfo"); gDynamicDisplayInfoClassInfo.clazz = MakeGlobalRefOrDie(env, dynamicInfoClazz); Loading
data/etc/services.core.protolog.json +6 −6 Original line number Diff line number Diff line Loading @@ -493,12 +493,6 @@ "group": "WM_DEBUG_STATES", "at": "com\/android\/server\/wm\/ActivityRecord.java" }, "-1556507536": { "message": "Passing transform hint %d for window %s%s", "level": "VERBOSE", "group": "WM_DEBUG_ORIENTATION", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "-1554521902": { "message": "showInsets(ime) was requested by different window: %s ", "level": "WARN", Loading Loading @@ -817,6 +811,12 @@ "group": "WM_DEBUG_REMOTE_ANIMATIONS", "at": "com\/android\/server\/wm\/RemoteAnimationController.java" }, "-1248290210": { "message": "Passing transform hint %d for window %s", "level": "VERBOSE", "group": "WM_DEBUG_ORIENTATION", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "-1228653755": { "message": "Launch on display check: displayId=%d callingPid=%d callingUid=%d", "level": "DEBUG", Loading
services/core/java/com/android/server/display/DisplayDeviceInfo.java +10 −1 Original line number Diff line number Diff line Loading @@ -358,6 +358,12 @@ final class DisplayDeviceInfo { public float brightnessMaximum; public float brightnessDefault; /** * Install orientation of display panel relative to its natural orientation. */ @Surface.Rotation public int installOrientation = Surface.ROTATION_0; public void setAssumedDensityForExternalDisplay(int width, int height) { densityDpi = Math.min(width, height) * DisplayMetrics.DENSITY_XHIGH / 1080; // Technically, these values should be smaller than the apparent density Loading Loading @@ -417,7 +423,8 @@ final class DisplayDeviceInfo { || !BrightnessSynchronizer.floatEquals(brightnessMaximum, other.brightnessMaximum) || !BrightnessSynchronizer.floatEquals(brightnessDefault, other.brightnessDefault) || !Objects.equals(roundedCorners, other.roundedCorners)) { || !Objects.equals(roundedCorners, other.roundedCorners) || installOrientation != other.installOrientation) { diff |= DIFF_OTHER; } return diff; Loading Loading @@ -461,6 +468,7 @@ final class DisplayDeviceInfo { brightnessMaximum = other.brightnessMaximum; brightnessDefault = other.brightnessDefault; roundedCorners = other.roundedCorners; installOrientation = other.installOrientation; } // For debugging purposes Loading Loading @@ -508,6 +516,7 @@ final class DisplayDeviceInfo { sb.append(", roundedCorners ").append(roundedCorners); } sb.append(flagsToString(flags)); sb.append(", installOrientation ").append(installOrientation); sb.append("}"); return sb.toString(); } Loading