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

Commit 31473fc7 authored by Lais Andrade's avatar Lais Andrade Committed by Android (Google) Code Review
Browse files

Merge "Replace PowerHint with Boost in SurfaceComposer callback"

parents f8172d9e 3a6e47d2
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -1092,22 +1092,22 @@ public:
        return NO_ERROR;
    }

    virtual status_t notifyPowerHint(int32_t hintId) {
    virtual status_t notifyPowerBoost(int32_t boostId) {
        Parcel data, reply;
        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (error != NO_ERROR) {
            ALOGE("notifyPowerHint: failed to write interface token: %d", error);
            ALOGE("notifyPowerBoost: failed to write interface token: %d", error);
            return error;
        }
        error = data.writeInt32(hintId);
        error = data.writeInt32(boostId);
        if (error != NO_ERROR) {
            ALOGE("notifyPowerHint: failed to write hintId: %d", error);
            ALOGE("notifyPowerBoost: failed to write boostId: %d", error);
            return error;
        }
        error = remote()->transact(BnSurfaceComposer::NOTIFY_POWER_HINT, data, &reply,
        error = remote()->transact(BnSurfaceComposer::NOTIFY_POWER_BOOST, data, &reply,
                                   IBinder::FLAG_ONEWAY);
        if (error != NO_ERROR) {
            ALOGE("notifyPowerHint: failed to transact: %d", error);
            ALOGE("notifyPowerBoost: failed to transact: %d", error);
            return error;
        }
        return NO_ERROR;
@@ -1986,15 +1986,15 @@ status_t BnSurfaceComposer::onTransact(
            }
            return setDisplayBrightness(displayToken, brightness);
        }
        case NOTIFY_POWER_HINT: {
        case NOTIFY_POWER_BOOST: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            int32_t hintId;
            status_t error = data.readInt32(&hintId);
            int32_t boostId;
            status_t error = data.readInt32(&boostId);
            if (error != NO_ERROR) {
                ALOGE("notifyPowerHint: failed to read hintId: %d", error);
                ALOGE("notifyPowerBoost: failed to read boostId: %d", error);
                return error;
            }
            return notifyPowerHint(hintId);
            return notifyPowerBoost(boostId);
        }
        case SET_GLOBAL_SHADOW_SETTINGS: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
+2 −2
Original line number Diff line number Diff line
@@ -1846,8 +1846,8 @@ status_t SurfaceComposerClient::setDisplayBrightness(const sp<IBinder>& displayT
    return ComposerService::getComposerService()->setDisplayBrightness(displayToken, brightness);
}

status_t SurfaceComposerClient::notifyPowerHint(int32_t hintId) {
    return ComposerService::getComposerService()->notifyPowerHint(hintId);
status_t SurfaceComposerClient::notifyPowerBoost(int32_t boostId) {
    return ComposerService::getComposerService()->notifyPowerBoost(boostId);
}

status_t SurfaceComposerClient::setGlobalShadowSettings(const half4& ambientColor,
+5 −5
Original line number Diff line number Diff line
@@ -488,14 +488,14 @@ public:
    virtual status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness) = 0;

    /*
     * Sends a power hint to the composer. This function is asynchronous.
     * Sends a power boost to the composer. This function is asynchronous.
     *
     * hintId
     *      hint id according to android::hardware::power::V1_0::PowerHint
     * boostId
     *      boost id according to android::hardware::power::Boost
     *
     * Returns NO_ERROR upon success.
     */
    virtual status_t notifyPowerHint(int32_t hintId) = 0;
    virtual status_t notifyPowerBoost(int32_t boostId) = 0;

    /*
     * Sets the global configuration for all the shadows drawn by SurfaceFlinger. Shadow follows
@@ -583,7 +583,7 @@ public:
        GET_DISPLAY_BRIGHTNESS_SUPPORT,
        SET_DISPLAY_BRIGHTNESS,
        CAPTURE_SCREEN_BY_ID,
        NOTIFY_POWER_HINT,
        NOTIFY_POWER_BOOST,
        SET_GLOBAL_SHADOW_SETTINGS,
        GET_AUTO_LOW_LATENCY_MODE_SUPPORT,
        SET_AUTO_LOW_LATENCY_MODE,
+4 −4
Original line number Diff line number Diff line
@@ -217,14 +217,14 @@ public:
    static status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness);

    /*
     * Sends a power hint to the composer. This function is asynchronous.
     * Sends a power boost to the composer. This function is asynchronous.
     *
     * hintId
     *      hint id according to android::hardware::power::V1_0::PowerHint
     * boostId
     *      boost id according to android::hardware::power::Boost
     *
     * Returns NO_ERROR upon success.
     */
    static status_t notifyPowerHint(int32_t hintId);
    static status_t notifyPowerBoost(int32_t boostId);

    /*
     * Sets the global configuration for all the shadows drawn by SurfaceFlinger. Shadow follows
+1 −1
Original line number Diff line number Diff line
@@ -849,7 +849,7 @@ public:
                                          float* /*outAppRequestRefreshRateMax*/) override {
        return NO_ERROR;
    };
    status_t notifyPowerHint(int32_t /*hintId*/) override { return NO_ERROR; }
    status_t notifyPowerBoost(int32_t /*boostId*/) override { return NO_ERROR; }

    status_t setGlobalShadowSettings(const half4& /*ambientColor*/, const half4& /*spotColor*/,
                                     float /*lightPosY*/, float /*lightPosZ*/,
Loading