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

Commit c7216d9b authored by Gil Dekel's avatar Gil Dekel Committed by Android (Google) Code Review
Browse files

Merge "SurfaceControl: Pipe port to StaticDisplayInfo" into main

parents 3e23cea1 71820034
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1958,6 +1958,7 @@ public final class SurfaceControl implements Parcelable {
     */
    public static final class StaticDisplayInfo {
        public boolean isInternal;
        public int port;
        public float density;
        public boolean secure;
        public DeviceProductInfo deviceProductInfo;
@@ -1967,6 +1968,7 @@ public final class SurfaceControl implements Parcelable {
        @Override
        public String toString() {
            return "StaticDisplayInfo{isInternal=" + isInternal
                    + ", port=" + port
                    + ", density=" + density
                    + ", secure=" + secure
                    + ", deviceProductInfo=" + deviceProductInfo
@@ -1980,6 +1982,7 @@ public final class SurfaceControl implements Parcelable {
            if (o == null || getClass() != o.getClass()) return false;
            StaticDisplayInfo that = (StaticDisplayInfo) o;
            return isInternal == that.isInternal
                    && port == that.port
                    && density == that.density
                    && secure == that.secure
                    && Objects.equals(deviceProductInfo, that.deviceProductInfo)
@@ -1989,7 +1992,7 @@ public final class SurfaceControl implements Parcelable {

        @Override
        public int hashCode() {
            return Objects.hash(isInternal, density, secure, deviceProductInfo,
            return Objects.hash(isInternal, port, density, secure, deviceProductInfo,
                installOrientation, screenPartStatus);
        }
    }
+3 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ static struct {
    jclass clazz;
    jmethodID ctor;
    jfieldID isInternal;
    jfieldID port;
    jfieldID density;
    jfieldID secure;
    jfieldID deviceProductInfo;
@@ -1548,6 +1549,7 @@ static jobject nativeGetStaticDisplayInfo(JNIEnv* env, jclass clazz, jlong id) {

    const bool isInternal = info.connectionType == ui::DisplayConnectionType::Internal;
    env->SetBooleanField(object, gStaticDisplayInfoClassInfo.isInternal, isInternal);
    env->SetIntField(object, gStaticDisplayInfoClassInfo.port, info.port);
    env->SetFloatField(object, gStaticDisplayInfoClassInfo.density, info.density);
    env->SetBooleanField(object, gStaticDisplayInfoClassInfo.secure, info.secure);
    env->SetObjectField(object, gStaticDisplayInfoClassInfo.deviceProductInfo,
@@ -2906,6 +2908,7 @@ int register_android_view_SurfaceControl(JNIEnv* env)
    gStaticDisplayInfoClassInfo.clazz = MakeGlobalRefOrDie(env, infoClazz);
    gStaticDisplayInfoClassInfo.ctor = GetMethodIDOrDie(env, infoClazz, "<init>", "()V");
    gStaticDisplayInfoClassInfo.isInternal = GetFieldIDOrDie(env, infoClazz, "isInternal", "Z");
    gStaticDisplayInfoClassInfo.port = GetFieldIDOrDie(env, infoClazz, "port", "I");
    gStaticDisplayInfoClassInfo.density = GetFieldIDOrDie(env, infoClazz, "density", "F");
    gStaticDisplayInfoClassInfo.secure = GetFieldIDOrDie(env, infoClazz, "secure", "Z");
    gStaticDisplayInfoClassInfo.deviceProductInfo =