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

Commit a87ed459 authored by Steven Thomas's avatar Steven Thomas
Browse files

Make setActiveConfig() private, remove plumbing

This is to address leftover code review feedback from ag/9714241. We no
longer use setActiveConfig() except for a call from an internal debug
command, so make it private, and remove the plumbing to support calling
it from other processes.

Bug: 142507213
Test: atest libsurfaceflinger_unittest
Test: atest libgui_test
Test: atest SurfaceFlinger_test
Test: atest sffakehwc_test
Change-Id: I84c55f238b93b40b87219e0d584f1ab270bc3eda
parent 337513b7
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
@@ -397,32 +397,6 @@ public:
        return reply.readInt32();
    }

    virtual status_t setActiveConfig(const sp<IBinder>& display, int id)
    {
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (result != NO_ERROR) {
            ALOGE("setActiveConfig failed to writeInterfaceToken: %d", result);
            return result;
        }
        result = data.writeStrongBinder(display);
        if (result != NO_ERROR) {
            ALOGE("setActiveConfig failed to writeStrongBinder: %d", result);
            return result;
        }
        result = data.writeInt32(id);
        if (result != NO_ERROR) {
            ALOGE("setActiveConfig failed to writeInt32: %d", result);
            return result;
        }
        result = remote()->transact(BnSurfaceComposer::SET_ACTIVE_CONFIG, data, &reply);
        if (result != NO_ERROR) {
            ALOGE("setActiveConfig failed to transact: %d", result);
            return result;
        }
        return reply.readInt32();
    }

    virtual status_t getDisplayColorModes(const sp<IBinder>& display,
            Vector<ColorMode>* outColorModes) {
        Parcel data, reply;
@@ -1358,14 +1332,6 @@ status_t BnSurfaceComposer::onTransact(
            reply->writeInt32(id);
            return NO_ERROR;
        }
        case SET_ACTIVE_CONFIG: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = data.readStrongBinder();
            int id = data.readInt32();
            status_t result = setActiveConfig(display, id);
            reply->writeInt32(result);
            return NO_ERROR;
        }
        case GET_DISPLAY_COLOR_MODES: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            Vector<ColorMode> colorModes;
+0 −4
Original line number Diff line number Diff line
@@ -1601,10 +1601,6 @@ int SurfaceComposerClient::getActiveConfig(const sp<IBinder>& display) {
    return ComposerService::getComposerService()->getActiveConfig(display);
}

status_t SurfaceComposerClient::setActiveConfig(const sp<IBinder>& display, int id) {
    return ComposerService::getComposerService()->setActiveConfig(display, id);
}

status_t SurfaceComposerClient::setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken,
                                                             int32_t defaultConfig,
                                                             float minRefreshRate,
+0 −5
Original line number Diff line number Diff line
@@ -182,10 +182,6 @@ public:
     * currently active */
    virtual int getActiveConfig(const sp<IBinder>& display) = 0;

    /* specifies which configuration (of those returned by getDisplayInfo)
     * should be used */
    virtual status_t setActiveConfig(const sp<IBinder>& display, int id) = 0;

    virtual status_t getDisplayColorModes(const sp<IBinder>& display,
            Vector<ui::ColorMode>* outColorModes) = 0;
    virtual status_t getDisplayNativePrimaries(const sp<IBinder>& display,
@@ -513,7 +509,6 @@ public:
        GET_SUPPORTED_FRAME_TIMESTAMPS,
        GET_DISPLAY_CONFIGS,
        GET_ACTIVE_CONFIG,
        SET_ACTIVE_CONFIG,
        CONNECT_DISPLAY_UNUSED, // unused, fails permissions check
        CAPTURE_SCREEN,
        CAPTURE_LAYERS,
+0 −4
Original line number Diff line number Diff line
@@ -113,10 +113,6 @@ public:
    // returned by getDisplayInfo)
    static int getActiveConfig(const sp<IBinder>& display);

    // Set a new active configuration using an index relative to the list
    // returned by getDisplayInfo
    static status_t setActiveConfig(const sp<IBinder>& display, int id);

    // Sets the refresh rate boundaries for display configuration.
    // For all other parameters, default configuration is used. The index for the default is
    // corresponting to the configs returned from getDisplayConfigs().
+0 −4
Original line number Diff line number Diff line
@@ -723,10 +723,6 @@ public:
    status_t getDisplayStats(const sp<IBinder>& /*display*/,
            DisplayStatInfo* /*stats*/) override { return NO_ERROR; }
    int getActiveConfig(const sp<IBinder>& /*display*/) override { return 0; }
    status_t setActiveConfig(const sp<IBinder>& /*display*/, int /*id*/)
            override {
        return NO_ERROR;
    }
    status_t getDisplayColorModes(const sp<IBinder>& /*display*/,
            Vector<ColorMode>* /*outColorModes*/) override {
        return NO_ERROR;
Loading