Loading core/java/android/hardware/display/DisplayViewport.java +8 −1 Original line number Diff line number Diff line Loading @@ -81,6 +81,9 @@ public final class DisplayViewport { public @ViewportType int type; // The logical display density which is the basis for density-independent pixels. public int densityDpi; public void copyFrom(DisplayViewport viewport) { valid = viewport.valid; isActive = viewport.isActive; Loading @@ -93,6 +96,7 @@ public final class DisplayViewport { uniqueId = viewport.uniqueId; physicalPort = viewport.physicalPort; type = viewport.type; densityDpi = viewport.densityDpi; } /** Loading Loading @@ -125,7 +129,8 @@ public final class DisplayViewport { && deviceHeight == other.deviceHeight && TextUtils.equals(uniqueId, other.uniqueId) && Objects.equals(physicalPort, other.physicalPort) && type == other.type; && type == other.type && densityDpi == other.densityDpi; } @Override Loading @@ -145,6 +150,7 @@ public final class DisplayViewport { result += prime * result + physicalPort.hashCode(); } result += prime * result + type; result += prime * result + densityDpi; return result; } Loading @@ -158,6 +164,7 @@ public final class DisplayViewport { + ", uniqueId='" + uniqueId + "'" + ", physicalPort=" + physicalPort + ", orientation=" + orientation + ", densityDpi=" + densityDpi + ", logicalFrame=" + logicalFrame + ", physicalFrame=" + physicalFrame + ", deviceWidth=" + deviceWidth Loading core/jni/android_hardware_display_DisplayViewport.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ static struct { jfieldID uniqueId; jfieldID physicalPort; jfieldID type; jfieldID densityDpi; } gDisplayViewportClassInfo; static struct { Loading Loading @@ -82,6 +83,8 @@ status_t android_hardware_display_DisplayViewport_toNative(JNIEnv* env, jobject viewport->type = static_cast<ViewportType>(env->GetIntField(viewportObj, gDisplayViewportClassInfo.type)); viewport->densityDpi = env->GetIntField(viewportObj, gDisplayViewportClassInfo.densityDpi); jobject logicalFrameObj = env->GetObjectField(viewportObj, gDisplayViewportClassInfo.logicalFrame); viewport->logicalLeft = env->GetIntField(logicalFrameObj, gRectClassInfo.left); Loading Loading @@ -135,6 +138,9 @@ int register_android_hardware_display_DisplayViewport(JNIEnv* env) { gDisplayViewportClassInfo.type = GetFieldIDOrDie(env, gDisplayViewportClassInfo.clazz, "type", "I"); gDisplayViewportClassInfo.densityDpi = GetFieldIDOrDie(env, gDisplayViewportClassInfo.clazz, "densityDpi", "I"); clazz = FindClassOrDie(env, "android/graphics/Rect"); gRectClassInfo.left = GetFieldIDOrDie(env, clazz, "left", "I"); gRectClassInfo.top = GetFieldIDOrDie(env, clazz, "top", "I"); Loading services/core/java/com/android/server/display/DisplayManagerService.java +1 −0 Original line number Diff line number Diff line Loading @@ -3510,6 +3510,7 @@ public final class DisplayManagerService extends SystemService { viewport.valid = true; viewport.displayId = displayId; viewport.isActive = Display.isActiveState(info.state); viewport.densityDpi = info.densityDpi; } private void updateViewportPowerStateLocked(LogicalDisplay display) { Loading Loading
core/java/android/hardware/display/DisplayViewport.java +8 −1 Original line number Diff line number Diff line Loading @@ -81,6 +81,9 @@ public final class DisplayViewport { public @ViewportType int type; // The logical display density which is the basis for density-independent pixels. public int densityDpi; public void copyFrom(DisplayViewport viewport) { valid = viewport.valid; isActive = viewport.isActive; Loading @@ -93,6 +96,7 @@ public final class DisplayViewport { uniqueId = viewport.uniqueId; physicalPort = viewport.physicalPort; type = viewport.type; densityDpi = viewport.densityDpi; } /** Loading Loading @@ -125,7 +129,8 @@ public final class DisplayViewport { && deviceHeight == other.deviceHeight && TextUtils.equals(uniqueId, other.uniqueId) && Objects.equals(physicalPort, other.physicalPort) && type == other.type; && type == other.type && densityDpi == other.densityDpi; } @Override Loading @@ -145,6 +150,7 @@ public final class DisplayViewport { result += prime * result + physicalPort.hashCode(); } result += prime * result + type; result += prime * result + densityDpi; return result; } Loading @@ -158,6 +164,7 @@ public final class DisplayViewport { + ", uniqueId='" + uniqueId + "'" + ", physicalPort=" + physicalPort + ", orientation=" + orientation + ", densityDpi=" + densityDpi + ", logicalFrame=" + logicalFrame + ", physicalFrame=" + physicalFrame + ", deviceWidth=" + deviceWidth Loading
core/jni/android_hardware_display_DisplayViewport.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ static struct { jfieldID uniqueId; jfieldID physicalPort; jfieldID type; jfieldID densityDpi; } gDisplayViewportClassInfo; static struct { Loading Loading @@ -82,6 +83,8 @@ status_t android_hardware_display_DisplayViewport_toNative(JNIEnv* env, jobject viewport->type = static_cast<ViewportType>(env->GetIntField(viewportObj, gDisplayViewportClassInfo.type)); viewport->densityDpi = env->GetIntField(viewportObj, gDisplayViewportClassInfo.densityDpi); jobject logicalFrameObj = env->GetObjectField(viewportObj, gDisplayViewportClassInfo.logicalFrame); viewport->logicalLeft = env->GetIntField(logicalFrameObj, gRectClassInfo.left); Loading Loading @@ -135,6 +138,9 @@ int register_android_hardware_display_DisplayViewport(JNIEnv* env) { gDisplayViewportClassInfo.type = GetFieldIDOrDie(env, gDisplayViewportClassInfo.clazz, "type", "I"); gDisplayViewportClassInfo.densityDpi = GetFieldIDOrDie(env, gDisplayViewportClassInfo.clazz, "densityDpi", "I"); clazz = FindClassOrDie(env, "android/graphics/Rect"); gRectClassInfo.left = GetFieldIDOrDie(env, clazz, "left", "I"); gRectClassInfo.top = GetFieldIDOrDie(env, clazz, "top", "I"); Loading
services/core/java/com/android/server/display/DisplayManagerService.java +1 −0 Original line number Diff line number Diff line Loading @@ -3510,6 +3510,7 @@ public final class DisplayManagerService extends SystemService { viewport.valid = true; viewport.displayId = displayId; viewport.isActive = Display.isActiveState(info.state); viewport.densityDpi = info.densityDpi; } private void updateViewportPowerStateLocked(LogicalDisplay display) { Loading