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

Commit 129a513d authored by Tiger Huang's avatar Tiger Huang Committed by Android (Google) Code Review
Browse files

Merge "Pipe display install orientation 1/2"

parents 51ae9d7e d0a89659
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ size_t StaticDisplayInfo::getFlattenedSize() const {
    return FlattenableHelpers::getFlattenedSize(connectionType) +
            FlattenableHelpers::getFlattenedSize(density) +
            FlattenableHelpers::getFlattenedSize(secure) +
            FlattenableHelpers::getFlattenedSize(deviceProductInfo);
            FlattenableHelpers::getFlattenedSize(deviceProductInfo) +
            FlattenableHelpers::getFlattenedSize(installOrientation);
}

status_t StaticDisplayInfo::flatten(void* buffer, size_t size) const {
@@ -40,6 +41,7 @@ status_t StaticDisplayInfo::flatten(void* buffer, size_t size) const {
    RETURN_IF_ERROR(FlattenableHelpers::flatten(&buffer, &size, density));
    RETURN_IF_ERROR(FlattenableHelpers::flatten(&buffer, &size, secure));
    RETURN_IF_ERROR(FlattenableHelpers::flatten(&buffer, &size, deviceProductInfo));
    RETURN_IF_ERROR(FlattenableHelpers::flatten(&buffer, &size, installOrientation));
    return OK;
}

@@ -48,6 +50,7 @@ status_t StaticDisplayInfo::unflatten(void const* buffer, size_t size) {
    RETURN_IF_ERROR(FlattenableHelpers::unflatten(&buffer, &size, &density));
    RETURN_IF_ERROR(FlattenableHelpers::unflatten(&buffer, &size, &secure));
    RETURN_IF_ERROR(FlattenableHelpers::unflatten(&buffer, &size, &deviceProductInfo));
    RETURN_IF_ERROR(FlattenableHelpers::unflatten(&buffer, &size, &installOrientation));
    return OK;
}

+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <optional>

#include <ui/DeviceProductInfo.h>
#include <ui/Rotation.h>
#include <utils/Flattenable.h>

namespace android::ui {
@@ -31,6 +32,7 @@ struct StaticDisplayInfo : LightFlattenable<StaticDisplayInfo> {
    float density = 0.f;
    bool secure = false;
    std::optional<DeviceProductInfo> deviceProductInfo;
    Rotation installOrientation = ROTATION_0;

    bool isFixedSize() const { return false; }
    size_t getFlattenedSize() const;
+3 −0
Original line number Diff line number Diff line
@@ -1020,6 +1020,9 @@ status_t SurfaceFlinger::getStaticDisplayInfo(const sp<IBinder>& displayToken,
    info->secure = display->isSecure();
    info->deviceProductInfo = display->getDeviceProductInfo();

    // TODO: Scale this to multiple displays.
    info->installOrientation = display->isPrimary() ? internalDisplayOrientation : ui::ROTATION_0;

    return NO_ERROR;
}