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

Commit 37ef0259 authored by Huihong Luo's avatar Huihong Luo
Browse files

Remove getPrimaryPhysicalDisplayId

SurfaceFlinger marks the first connected display as primary, which is
not really useful, and surfaceflinger should not care about this.

The display manager can decide whether a display is primary when needed.

Bug: 240703637
Test: atest surfaceflinger_test
Change-Id: Ia5368a137c689989fcac7b355d1c6dddf3a8cf26
parent 85f572ce
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1085,16 +1085,6 @@ std::vector<PhysicalDisplayId> SurfaceComposerClient::getPhysicalDisplayIds() {
    return physicalDisplayIds;
}

status_t SurfaceComposerClient::getPrimaryPhysicalDisplayId(PhysicalDisplayId* id) {
    int64_t displayId;
    binder::Status status =
            ComposerServiceAIDL::getComposerService()->getPrimaryPhysicalDisplayId(&displayId);
    if (status.isOk()) {
        *id = *DisplayId::fromValue<PhysicalDisplayId>(static_cast<uint64_t>(displayId));
    }
    return statusTFromBinderStatus(status);
}

std::optional<PhysicalDisplayId> SurfaceComposerClient::getInternalDisplayId() {
    ComposerServiceAIDL& instance = ComposerServiceAIDL::getInstance();
    return instance.getInternalDisplayId();
+0 −2
Original line number Diff line number Diff line
@@ -94,8 +94,6 @@ interface ISurfaceComposer {
     */
    long[] getPhysicalDisplayIds();

    long getPrimaryPhysicalDisplayId();

    /**
     * Get token for a physical display given its stable ID obtained via getPhysicalDisplayIds or
     * a DisplayEventReceiver hotplug event.
+0 −1
Original line number Diff line number Diff line
@@ -71,7 +71,6 @@ public:
                (override));
    MOCK_METHOD(binder::Status, destroyDisplay, (const sp<IBinder>&), (override));
    MOCK_METHOD(binder::Status, getPhysicalDisplayIds, (std::vector<int64_t>*), (override));
    MOCK_METHOD(binder::Status, getPrimaryPhysicalDisplayId, (int64_t*), (override));
    MOCK_METHOD(binder::Status, getPhysicalDisplayToken, (int64_t, sp<IBinder>*), (override));
    MOCK_METHOD(binder::Status, setPowerMode, (const sp<IBinder>&, int), (override));
    MOCK_METHOD(binder::Status, getSupportedFrameTimestamps, (std::vector<FrameEvent>*),
+0 −1
Original line number Diff line number Diff line
@@ -349,7 +349,6 @@ public:

    //! Get stable IDs for connected physical displays
    static std::vector<PhysicalDisplayId> getPhysicalDisplayIds();
    static status_t getPrimaryPhysicalDisplayId(PhysicalDisplayId*);
    static std::optional<PhysicalDisplayId> getInternalDisplayId();

    //! Get token for a physical display given its stable ID
+0 −4
Original line number Diff line number Diff line
@@ -745,10 +745,6 @@ public:
        return binder::Status::ok();
    }

    binder::Status getPrimaryPhysicalDisplayId(int64_t* /*outDisplayId*/) override {
        return binder::Status::ok();
    }

    binder::Status getPhysicalDisplayToken(int64_t /*displayId*/,
                                           sp<IBinder>* /*outDisplay*/) override {
        return binder::Status::ok();
Loading