diff options
| author | 2022-02-15 10:43:00 -0800 | |
|---|---|---|
| committer | 2022-04-01 12:27:31 -0700 | |
| commit | 694aeffba34baf6651833c56e18a4c5c6c8a25c0 (patch) | |
| tree | d26551e6761a03b47e579d852c3b788ad884bc4b /libs/gui/ISurfaceComposer.cpp | |
| parent | b5cb7c155ff3ac1f8fc6d946fc1faf01ce8d8ed5 (diff) | |
Migrate display related methods to AIDL part 2
This migrates more display related methods with simple arguments from ISurfaceComposer.h to the new AIDL interface.
Bug: 219574942
Test: atest SurfaceFlinger_test libsurfaceflinger_unittest libgui_test
Merged-In: I57f428f6934e784cb234704ad89ef22218e441b4
Change-Id: I57f428f6934e784cb234704ad89ef22218e441b4
Diffstat (limited to 'libs/gui/ISurfaceComposer.cpp')
| -rw-r--r-- | libs/gui/ISurfaceComposer.cpp | 366 | 
1 files changed, 0 insertions, 366 deletions
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp index 2da48b81f6..26b31252f3 100644 --- a/libs/gui/ISurfaceComposer.cpp +++ b/libs/gui/ISurfaceComposer.cpp @@ -226,14 +226,6 @@ public:          return result;      } -    void setPowerMode(const sp<IBinder>& display, int mode) override { -        Parcel data, reply; -        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); -        data.writeStrongBinder(display); -        data.writeInt32(mode); -        remote()->transact(BnSurfaceComposer::SET_POWER_MODE, data, &reply); -    } -      status_t getDisplayState(const sp<IBinder>& display, ui::DisplayState* state) override {          Parcel data, reply;          data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); @@ -333,29 +325,6 @@ public:          return static_cast<status_t>(reply.readInt32());      } -    // TODO(b/213909104) : Add unit tests to verify surface flinger boot time APIs -    status_t getBootDisplayModeSupport(bool* outSupport) const override { -        Parcel data, reply; -        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); -        if (error != NO_ERROR) { -            ALOGE("getBootDisplayModeSupport: failed to write interface token: %d", error); -            return error; -        } -        error = remote()->transact(BnSurfaceComposer::GET_BOOT_DISPLAY_MODE_SUPPORT, data, &reply); -        if (error != NO_ERROR) { -            ALOGE("getBootDisplayModeSupport: failed to transact: %d", error); -            return error; -        } -        bool support; -        error = reply.readBool(&support); -        if (error != NO_ERROR) { -            ALOGE("getBootDisplayModeSupport: failed to read support: %d", error); -            return error; -        } -        *outSupport = support; -        return NO_ERROR; -    } -      status_t setBootDisplayMode(const sp<IBinder>& display,                                  ui::DisplayModeId displayModeId) override {          Parcel data, reply; @@ -381,73 +350,6 @@ public:          return result;      } -    status_t clearBootDisplayMode(const sp<IBinder>& display) override { -        Parcel data, reply; -        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); -        if (result != NO_ERROR) { -            ALOGE("clearBootDisplayMode failed to writeInterfaceToken: %d", result); -            return result; -        } -        result = data.writeStrongBinder(display); -        if (result != NO_ERROR) { -            ALOGE("clearBootDisplayMode failed to writeStrongBinder: %d", result); -            return result; -        } -        result = remote()->transact(BnSurfaceComposer::CLEAR_BOOT_DISPLAY_MODE, data, &reply); -        if (result != NO_ERROR) { -            ALOGE("clearBootDisplayMode failed to transact: %d", result); -        } -        return result; -    } - -    void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) override { -        Parcel data, reply; -        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); -        if (result != NO_ERROR) { -            ALOGE("setAutoLowLatencyMode failed to writeInterfaceToken: %d", result); -            return; -        } - -        result = data.writeStrongBinder(display); -        if (result != NO_ERROR) { -            ALOGE("setAutoLowLatencyMode failed to writeStrongBinder: %d", result); -            return; -        } -        result = data.writeBool(on); -        if (result != NO_ERROR) { -            ALOGE("setAutoLowLatencyMode failed to writeBool: %d", result); -            return; -        } -        result = remote()->transact(BnSurfaceComposer::SET_AUTO_LOW_LATENCY_MODE, data, &reply); -        if (result != NO_ERROR) { -            ALOGE("setAutoLowLatencyMode failed to transact: %d", result); -            return; -        } -    } - -    void setGameContentType(const sp<IBinder>& display, bool on) override { -        Parcel data, reply; -        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); -        if (result != NO_ERROR) { -            ALOGE("setGameContentType failed to writeInterfaceToken: %d", result); -            return; -        } -        result = data.writeStrongBinder(display); -        if (result != NO_ERROR) { -            ALOGE("setGameContentType failed to writeStrongBinder: %d", result); -            return; -        } -        result = data.writeBool(on); -        if (result != NO_ERROR) { -            ALOGE("setGameContentType failed to writeBool: %d", result); -            return; -        } -        result = remote()->transact(BnSurfaceComposer::SET_GAME_CONTENT_TYPE, data, &reply); -        if (result != NO_ERROR) { -            ALOGE("setGameContentType failed to transact: %d", result); -        } -    } -      status_t clearAnimationFrameStats() override {          Parcel data, reply;          status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); @@ -722,26 +624,6 @@ public:          return error;      } -    status_t isWideColorDisplay(const sp<IBinder>& token, -                                bool* outIsWideColorDisplay) const override { -        Parcel data, reply; -        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); -        if (error != NO_ERROR) { -            return error; -        } -        error = data.writeStrongBinder(token); -        if (error != NO_ERROR) { -            return error; -        } - -        error = remote()->transact(BnSurfaceComposer::IS_WIDE_COLOR_DISPLAY, data, &reply); -        if (error != NO_ERROR) { -            return error; -        } -        error = reply.readBool(outIsWideColorDisplay); -        return error; -    } -      status_t addRegionSamplingListener(const Rect& samplingArea, const sp<IBinder>& stopLayerHandle,                                         const sp<IRegionSamplingListener>& listener) override {          Parcel data, reply; @@ -974,109 +856,6 @@ public:          return reply.readInt32();      } -    status_t getDisplayBrightnessSupport(const sp<IBinder>& displayToken, -                                         bool* outSupport) const override { -        Parcel data, reply; -        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); -        if (error != NO_ERROR) { -            ALOGE("getDisplayBrightnessSupport: failed to write interface token: %d", error); -            return error; -        } -        error = data.writeStrongBinder(displayToken); -        if (error != NO_ERROR) { -            ALOGE("getDisplayBrightnessSupport: failed to write display token: %d", error); -            return error; -        } -        error = remote()->transact(BnSurfaceComposer::GET_DISPLAY_BRIGHTNESS_SUPPORT, data, &reply); -        if (error != NO_ERROR) { -            ALOGE("getDisplayBrightnessSupport: failed to transact: %d", error); -            return error; -        } -        bool support; -        error = reply.readBool(&support); -        if (error != NO_ERROR) { -            ALOGE("getDisplayBrightnessSupport: failed to read support: %d", error); -            return error; -        } -        *outSupport = support; -        return NO_ERROR; -    } - -    status_t setDisplayBrightness(const sp<IBinder>& displayToken, -                                  const gui::DisplayBrightness& brightness) override { -        Parcel data, reply; -        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); -        if (error != NO_ERROR) { -            ALOGE("setDisplayBrightness: failed to write interface token: %d", error); -            return error; -        } -        error = data.writeStrongBinder(displayToken); -        if (error != NO_ERROR) { -            ALOGE("setDisplayBrightness: failed to write display token: %d", error); -            return error; -        } -        error = data.writeParcelable(brightness); -        if (error != NO_ERROR) { -            ALOGE("setDisplayBrightness: failed to write brightness: %d", error); -            return error; -        } -        error = remote()->transact(BnSurfaceComposer::SET_DISPLAY_BRIGHTNESS, data, &reply); -        if (error != NO_ERROR) { -            ALOGE("setDisplayBrightness: failed to transact: %d", error); -            return error; -        } -        return NO_ERROR; -    } - -    status_t addHdrLayerInfoListener(const sp<IBinder>& displayToken, -                                     const sp<gui::IHdrLayerInfoListener>& listener) override { -        Parcel data, reply; -        SAFE_PARCEL(data.writeInterfaceToken, ISurfaceComposer::getInterfaceDescriptor()); -        SAFE_PARCEL(data.writeStrongBinder, displayToken); -        SAFE_PARCEL(data.writeStrongBinder, IInterface::asBinder(listener)); -        const status_t error = -                remote()->transact(BnSurfaceComposer::ADD_HDR_LAYER_INFO_LISTENER, data, &reply); -        if (error != OK) { -            ALOGE("addHdrLayerInfoListener: Failed to transact; error = %d", error); -        } -        return error; -    } - -    status_t removeHdrLayerInfoListener(const sp<IBinder>& displayToken, -                                        const sp<gui::IHdrLayerInfoListener>& listener) override { -        Parcel data, reply; -        SAFE_PARCEL(data.writeInterfaceToken, ISurfaceComposer::getInterfaceDescriptor()); -        SAFE_PARCEL(data.writeStrongBinder, displayToken); -        SAFE_PARCEL(data.writeStrongBinder, IInterface::asBinder(listener)); -        const status_t error = -                remote()->transact(BnSurfaceComposer::REMOVE_HDR_LAYER_INFO_LISTENER, data, &reply); -        if (error != OK) { -            ALOGE("removeHdrLayerInfoListener: Failed to transact; error = %d", error); -        } -        return error; -    } - -    status_t notifyPowerBoost(int32_t boostId) override { -        Parcel data, reply; -        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); -        if (error != NO_ERROR) { -            ALOGE("notifyPowerBoost: failed to write interface token: %d", error); -            return error; -        } -        error = data.writeInt32(boostId); -        if (error != NO_ERROR) { -            ALOGE("notifyPowerBoost: failed to write boostId: %d", error); -            return error; -        } -        error = remote()->transact(BnSurfaceComposer::NOTIFY_POWER_BOOST, data, &reply, -                                   IBinder::FLAG_ONEWAY); -        if (error != NO_ERROR) { -            ALOGE("notifyPowerBoost: failed to transact: %d", error); -            return error; -        } -        return NO_ERROR; -    } -      status_t setGlobalShadowSettings(const half4& ambientColor, const half4& spotColor,                                       float lightPosY, float lightPosZ, float lightRadius) override {          Parcel data, reply; @@ -1475,15 +1254,6 @@ status_t BnSurfaceComposer::onTransact(              result = reply->writeInt32(result);              return result;          } -        case GET_BOOT_DISPLAY_MODE_SUPPORT: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            bool support = false; -            status_t result = getBootDisplayModeSupport(&support); -            if (result == NO_ERROR) { -                reply->writeBool(support); -            } -            return result; -        }          case SET_BOOT_DISPLAY_MODE: {              CHECK_INTERFACE(ISurfaceComposer, data, reply);              sp<IBinder> display = nullptr; @@ -1500,50 +1270,6 @@ status_t BnSurfaceComposer::onTransact(              }              return setBootDisplayMode(display, displayModeId);          } -        case CLEAR_BOOT_DISPLAY_MODE: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            sp<IBinder> display = nullptr; -            status_t result = data.readStrongBinder(&display); -            if (result != NO_ERROR) { -                ALOGE("clearBootDisplayMode failed to readStrongBinder: %d", result); -                return result; -            } -            return clearBootDisplayMode(display); -        } -        case SET_AUTO_LOW_LATENCY_MODE: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            sp<IBinder> display = nullptr; -            status_t result = data.readStrongBinder(&display); -            if (result != NO_ERROR) { -                ALOGE("setAutoLowLatencyMode failed to readStrongBinder: %d", result); -                return result; -            } -            bool setAllm = false; -            result = data.readBool(&setAllm); -            if (result != NO_ERROR) { -                ALOGE("setAutoLowLatencyMode failed to readBool: %d", result); -                return result; -            } -            setAutoLowLatencyMode(display, setAllm); -            return result; -        } -        case SET_GAME_CONTENT_TYPE: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            sp<IBinder> display = nullptr; -            status_t result = data.readStrongBinder(&display); -            if (result != NO_ERROR) { -                ALOGE("setGameContentType failed to readStrongBinder: %d", result); -                return result; -            } -            bool setGameContentTypeOn = false; -            result = data.readBool(&setGameContentTypeOn); -            if (result != NO_ERROR) { -                ALOGE("setGameContentType failed to readBool: %d", result); -                return result; -            } -            setGameContentType(display, setGameContentTypeOn); -            return result; -        }          case CLEAR_ANIMATION_FRAME_STATS: {              CHECK_INTERFACE(ISurfaceComposer, data, reply);              status_t result = clearAnimationFrameStats(); @@ -1558,13 +1284,6 @@ status_t BnSurfaceComposer::onTransact(              reply->writeInt32(result);              return NO_ERROR;          } -        case SET_POWER_MODE: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            sp<IBinder> display = data.readStrongBinder(); -            int32_t mode = data.readInt32(); -            setPowerMode(display, mode); -            return NO_ERROR; -        }          case ENABLE_VSYNC_INJECTIONS: {              CHECK_INTERFACE(ISurfaceComposer, data, reply);              bool enable = false; @@ -1714,20 +1433,6 @@ status_t BnSurfaceComposer::onTransact(              }              return error;          } -        case IS_WIDE_COLOR_DISPLAY: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            sp<IBinder> display = nullptr; -            status_t error = data.readStrongBinder(&display); -            if (error != NO_ERROR) { -                return error; -            } -            bool result; -            error = isWideColorDisplay(display, &result); -            if (error == NO_ERROR) { -                reply->writeBool(result); -            } -            return error; -        }          case ADD_REGION_SAMPLING_LISTENER: {              CHECK_INTERFACE(ISurfaceComposer, data, reply);              Rect samplingArea; @@ -1925,77 +1630,6 @@ status_t BnSurfaceComposer::onTransact(              reply->writeInt32(result);              return result;          } -        case GET_DISPLAY_BRIGHTNESS_SUPPORT: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            sp<IBinder> displayToken; -            status_t error = data.readNullableStrongBinder(&displayToken); -            if (error != NO_ERROR) { -                ALOGE("getDisplayBrightnessSupport: failed to read display token: %d", error); -                return error; -            } -            bool support = false; -            error = getDisplayBrightnessSupport(displayToken, &support); -            reply->writeBool(support); -            return error; -        } -        case SET_DISPLAY_BRIGHTNESS: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            sp<IBinder> displayToken; -            status_t error = data.readNullableStrongBinder(&displayToken); -            if (error != NO_ERROR) { -                ALOGE("setDisplayBrightness: failed to read display token: %d", error); -                return error; -            } -            gui::DisplayBrightness brightness; -            error = data.readParcelable(&brightness); -            if (error != NO_ERROR) { -                ALOGE("setDisplayBrightness: failed to read brightness: %d", error); -                return error; -            } -            return setDisplayBrightness(displayToken, brightness); -        } -        case ADD_HDR_LAYER_INFO_LISTENER: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            sp<IBinder> displayToken; -            status_t error = data.readNullableStrongBinder(&displayToken); -            if (error != NO_ERROR) { -                ALOGE("addHdrLayerInfoListener: Failed to read display token"); -                return error; -            } -            sp<gui::IHdrLayerInfoListener> listener; -            error = data.readNullableStrongBinder(&listener); -            if (error != NO_ERROR) { -                ALOGE("addHdrLayerInfoListener: Failed to read listener"); -                return error; -            } -            return addHdrLayerInfoListener(displayToken, listener); -        } -        case REMOVE_HDR_LAYER_INFO_LISTENER: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            sp<IBinder> displayToken; -            status_t error = data.readNullableStrongBinder(&displayToken); -            if (error != NO_ERROR) { -                ALOGE("removeHdrLayerInfoListener: Failed to read display token"); -                return error; -            } -            sp<gui::IHdrLayerInfoListener> listener; -            error = data.readNullableStrongBinder(&listener); -            if (error != NO_ERROR) { -                ALOGE("removeHdrLayerInfoListener: Failed to read listener"); -                return error; -            } -            return removeHdrLayerInfoListener(displayToken, listener); -        } -        case NOTIFY_POWER_BOOST: { -            CHECK_INTERFACE(ISurfaceComposer, data, reply); -            int32_t boostId; -            status_t error = data.readInt32(&boostId); -            if (error != NO_ERROR) { -                ALOGE("notifyPowerBoost: failed to read boostId: %d", error); -                return error; -            } -            return notifyPowerBoost(boostId); -        }          case SET_GLOBAL_SHADOW_SETTINGS: {              CHECK_INTERFACE(ISurfaceComposer, data, reply);  |