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

Commit 1fbbf9d1 authored by Ady Abraham's avatar Ady Abraham Committed by android-build-merger
Browse files

SurfaceFlinger: Add touch events to Scheduler am: 8532d011

am: ed7e8876

Change-Id: I8280c25e26c10e63164005148f52c5accc0f36e8
parents 8a143e31 ed7e8876
Loading
Loading
Loading
Loading
+31 −0
Original line number Original line Diff line number Diff line
@@ -955,6 +955,27 @@ public:
        }
        }
        return NO_ERROR;
        return NO_ERROR;
    }
    }

    virtual status_t notifyPowerHint(int32_t hintId) {
        Parcel data, reply;
        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (error != NO_ERROR) {
            ALOGE("notifyPowerHint: failed to write interface token: %d", error);
            return error;
        }
        error = data.writeInt32(hintId);
        if (error != NO_ERROR) {
            ALOGE("notifyPowerHint: failed to write hintId: %d", error);
            return error;
        }
        error = remote()->transact(BnSurfaceComposer::NOTIFY_POWER_HINT, data, &reply,
                                   IBinder::FLAG_ONEWAY);
        if (error != NO_ERROR) {
            ALOGE("notifyPowerHint: failed to transact: %d", error);
            return error;
        }
        return NO_ERROR;
    }
};
};


// Out-of-line virtual method definition to trigger vtable emission in this
// Out-of-line virtual method definition to trigger vtable emission in this
@@ -1556,6 +1577,16 @@ status_t BnSurfaceComposer::onTransact(
            }
            }
            return setDisplayBrightness(displayToken, brightness);
            return setDisplayBrightness(displayToken, brightness);
        }
        }
        case NOTIFY_POWER_HINT: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            int32_t hintId;
            status_t error = data.readInt32(&hintId);
            if (error != NO_ERROR) {
                ALOGE("notifyPowerHint: failed to read hintId: %d", error);
                return error;
            }
            return notifyPowerHint(hintId);
        }
        default: {
        default: {
            return BBinder::onTransact(code, data, reply, flags);
            return BBinder::onTransact(code, data, reply, flags);
        }
        }
+4 −0
Original line number Original line Diff line number Diff line
@@ -1543,6 +1543,10 @@ status_t SurfaceComposerClient::setDisplayBrightness(const sp<IBinder>& displayT
    return ComposerService::getComposerService()->setDisplayBrightness(displayToken, brightness);
    return ComposerService::getComposerService()->setDisplayBrightness(displayToken, brightness);
}
}


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

// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------


status_t ScreenshotClient::capture(const sp<IBinder>& display, const ui::Dataspace reqDataSpace,
status_t ScreenshotClient::capture(const sp<IBinder>& display, const ui::Dataspace reqDataSpace,
+11 −0
Original line number Original line Diff line number Diff line
@@ -425,6 +425,16 @@ public:
     */
     */
    virtual status_t setDisplayBrightness(const sp<IBinder>& displayToken,
    virtual status_t setDisplayBrightness(const sp<IBinder>& displayToken,
                                          float brightness) const = 0;
                                          float brightness) const = 0;

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


// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
@@ -477,6 +487,7 @@ public:
        GET_DISPLAY_BRIGHTNESS_SUPPORT,
        GET_DISPLAY_BRIGHTNESS_SUPPORT,
        SET_DISPLAY_BRIGHTNESS,
        SET_DISPLAY_BRIGHTNESS,
        CAPTURE_SCREEN_BY_ID,
        CAPTURE_SCREEN_BY_ID,
        NOTIFY_POWER_HINT,
        // Always append new enum to the end.
        // Always append new enum to the end.
    };
    };


+10 −0
Original line number Original line Diff line number Diff line
@@ -201,6 +201,16 @@ public:
     */
     */
    static status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness);
    static status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness);


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

    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------
    // surface creation / destruction
    // surface creation / destruction


+1 −0
Original line number Original line Diff line number Diff line
@@ -704,6 +704,7 @@ public:
                                      std::vector<int32_t>* /*outAllowedConfigs*/) override {
                                      std::vector<int32_t>* /*outAllowedConfigs*/) override {
        return NO_ERROR;
        return NO_ERROR;
    }
    }
    status_t notifyPowerHint(int32_t /*hintId*/) override { return NO_ERROR; }


protected:
protected:
    IBinder* onAsBinder() override { return nullptr; }
    IBinder* onAsBinder() override { return nullptr; }
Loading