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

Commit 67077188 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6045210 from 470eee76 to rvc-release

Change-Id: Icf536a2a16e6d8104b4fc3ba171d0b73dbff3b36
parents fe9fffa9 470eee76
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -158,7 +158,10 @@ enum {
    AINPUT_EVENT_TYPE_KEY = 1,

    /** Indicates that the input event is a motion event. */
    AINPUT_EVENT_TYPE_MOTION = 2
    AINPUT_EVENT_TYPE_MOTION = 2,

    /** Focus event */
    AINPUT_EVENT_TYPE_FOCUS = 3,
};

/**
+29 −0
Original line number Diff line number Diff line
@@ -167,6 +167,8 @@ namespace android {
class Parcel;
#endif

const char* inputEventTypeToString(int32_t type);

/*
 * Flags that flow alongside events in the input dispatch system to help with certain
 * policy decisions such as waking from device sleep.
@@ -686,6 +688,28 @@ protected:
    Vector<PointerCoords> mSamplePointerCoords;
};

/*
 * Focus events.
 */
class FocusEvent : public InputEvent {
public:
    virtual ~FocusEvent() {}

    virtual int32_t getType() const override { return AINPUT_EVENT_TYPE_FOCUS; }

    inline bool getHasFocus() const { return mHasFocus; }

    inline bool getInTouchMode() const { return mInTouchMode; }

    void initialize(bool hasFocus, bool inTouchMode);

    void initialize(const FocusEvent& from);

protected:
    bool mHasFocus;
    bool mInTouchMode;
};

/*
 * Input event factory.
 */
@@ -698,6 +722,7 @@ public:

    virtual KeyEvent* createKeyEvent() = 0;
    virtual MotionEvent* createMotionEvent() = 0;
    virtual FocusEvent* createFocusEvent() = 0;
};

/*
@@ -711,10 +736,12 @@ public:

    virtual KeyEvent* createKeyEvent() override { return &mKeyEvent; }
    virtual MotionEvent* createMotionEvent() override { return &mMotionEvent; }
    virtual FocusEvent* createFocusEvent() override { return &mFocusEvent; }

private:
    KeyEvent mKeyEvent;
    MotionEvent mMotionEvent;
    FocusEvent mFocusEvent;
};

/*
@@ -727,6 +754,7 @@ public:

    virtual KeyEvent* createKeyEvent() override;
    virtual MotionEvent* createMotionEvent() override;
    virtual FocusEvent* createFocusEvent() override;

    void recycle(InputEvent* event);

@@ -735,6 +763,7 @@ private:

    std::queue<std::unique_ptr<KeyEvent>> mKeyEventPool;
    std::queue<std::unique_ptr<MotionEvent>> mMotionEventPool;
    std::queue<std::unique_ptr<FocusEvent>> mFocusEventPool;
};

} // namespace android
+25 −9
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ struct InputMessage {
        KEY,
        MOTION,
        FINISHED,
        FOCUS,
    };

    struct Header {
@@ -92,9 +93,7 @@ struct InputMessage {
            uint32_t empty2;
            nsecs_t downTime __attribute__((aligned(8)));

            inline size_t size() const {
                return sizeof(Key);
            }
            inline size_t size() const { return sizeof(Key); }
        } key;

        struct Motion {
@@ -110,7 +109,7 @@ struct InputMessage {
            int32_t metaState;
            int32_t buttonState;
            MotionClassification classification; // base type: uint8_t
            uint8_t empty2[3];
            uint8_t empty2[3];                   // 3 bytes to fill gap created by classification
            int32_t edgeFlags;
            nsecs_t downTime __attribute__((aligned(8)));
            float xOffset;
@@ -148,10 +147,17 @@ struct InputMessage {
            uint32_t seq;
            uint32_t handled; // actually a bool, but we must maintain 8-byte alignment

            inline size_t size() const {
                return sizeof(Finished);
            }
            inline size_t size() const { return sizeof(Finished); }
        } finished;

        struct Focus {
            uint32_t seq;
            // The following two fields take up 4 bytes total
            uint16_t hasFocus;    // actually a bool
            uint16_t inTouchMode; // actually a bool, but we must maintain 8-byte alignment

            inline size_t size() const { return sizeof(Focus); }
        } focus;
    } __attribute__((aligned(8))) body;

    bool isValid(size_t actualSize) const;
@@ -294,6 +300,15 @@ public:
                                uint32_t pointerCount, const PointerProperties* pointerProperties,
                                const PointerCoords* pointerCoords);

    /* Publishes a focus event to the input channel.
     *
     * Returns OK on success.
     * Returns WOULD_BLOCK if the channel is full.
     * Returns DEAD_OBJECT if the channel's peer has been closed.
     * Other errors probably indicate that the channel is broken.
     */
    status_t publishFocusEvent(uint32_t seq, bool hasFocus, bool inTouchMode);

    /* Receives the finished signal from the consumer in reply to the original dispatch signal.
     * If a signal was received, returns the message sequence number,
     * and whether the consumer handled the message.
@@ -349,8 +364,8 @@ public:
     * Returns NO_MEMORY if the event could not be created.
     * Other errors probably indicate that the channel is broken.
     */
    status_t consume(InputEventFactoryInterface* factory, bool consumeBatches,
            nsecs_t frameTime, uint32_t* outSeq, InputEvent** outEvent);
    status_t consume(InputEventFactoryInterface* factory, bool consumeBatches, nsecs_t frameTime,
                     uint32_t* outSeq, InputEvent** outEvent);

    /* Sends a finished signal to the publisher to inform it that the message
     * with the specified sequence number has finished being process and whether
@@ -521,6 +536,7 @@ private:
    static void rewriteMessage(TouchState& state, InputMessage& msg);
    static void initializeKeyEvent(KeyEvent* event, const InputMessage* msg);
    static void initializeMotionEvent(MotionEvent* event, const InputMessage* msg);
    static void initializeFocusEvent(FocusEvent* event, const InputMessage* msg);
    static void addSample(MotionEvent* event, const InputMessage* msg);
    static bool canAddSample(const Batch& batch, const InputMessage* msg);
    static ssize_t findSampleNoLaterThan(const Batch& batch, nsecs_t time);
+0 −9
Original line number Diff line number Diff line
@@ -33,15 +33,6 @@ namespace android {

namespace gralloc4 {

/**
 * This library is compiled into VNDK-SP and FWK_ONLY copies. When a device is upgraded, the vendor
 * partition may choose to use an older copy of the VNDK-SP.
 *
 * Prepend the version to every encode and decode so the system partition can fallback to an older
 * version if necessary.
 */
#define GRALLOC4_METADATA_VERSION 1

#define GRALLOC4_STANDARD_METADATA_TYPE "android.hardware.graphics.common.StandardMetadataType"
#define GRALLOC4_CHROMA_SITING "android.hardware.graphics.common.ChromaSiting"
#define GRALLOC4_COMPRESSION "android.hardware.graphics.common.Compression"
+71 −0
Original line number Diff line number Diff line
@@ -878,6 +878,45 @@ public:
        return reply.readInt32();
    }

    virtual status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken,
                                                  int32_t defaultModeId, float minRefreshRate,
                                                  float maxRefreshRate) {
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (result != NO_ERROR) {
            ALOGE("setDesiredDisplayConfigSpecs: failed to writeInterfaceToken: %d", result);
            return result;
        }
        result = data.writeStrongBinder(displayToken);
        if (result != NO_ERROR) {
            ALOGE("setDesiredDisplayConfigSpecs: failed to write display token: %d", result);
            return result;
        }
        result = data.writeInt32(defaultModeId);
        if (result != NO_ERROR) {
            ALOGE("setDesiredDisplayConfigSpecs failed to write defaultModeId: %d", result);
            return result;
        }
        result = data.writeFloat(minRefreshRate);
        if (result != NO_ERROR) {
            ALOGE("setDesiredDisplayConfigSpecs failed to write minRefreshRate: %d", result);
            return result;
        }
        result = data.writeFloat(maxRefreshRate);
        if (result != NO_ERROR) {
            ALOGE("setDesiredDisplayConfigSpecs failed to write maxRefreshRate: %d", result);
            return result;
        }

        result = remote()->transact(BnSurfaceComposer::SET_DESIRED_DISPLAY_CONFIG_SPECS, data,
                                    &reply);
        if (result != NO_ERROR) {
            ALOGE("setDesiredDisplayConfigSpecs failed to transact: %d", result);
            return result;
        }
        return reply.readInt32();
    }

    virtual status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken,
                                              std::vector<int32_t>* outAllowedConfigs) {
        if (!outAllowedConfigs) return BAD_VALUE;
@@ -1583,6 +1622,38 @@ status_t BnSurfaceComposer::onTransact(
            reply->writeInt32(result);
            return result;
        }
        case SET_DESIRED_DISPLAY_CONFIG_SPECS: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> displayToken = data.readStrongBinder();
            int32_t defaultModeId;
            status_t result = data.readInt32(&defaultModeId);
            if (result != NO_ERROR) {
                ALOGE("setDesiredDisplayConfigSpecs: failed to read defaultModeId: %d", result);
                return result;
            }
            float minRefreshRate;
            result = data.readFloat(&minRefreshRate);
            if (result != NO_ERROR) {
                ALOGE("setDesiredDisplayConfigSpecs: failed to read minRefreshRate: %d", result);
                return result;
            }
            float maxRefreshRate;
            result = data.readFloat(&maxRefreshRate);
            if (result != NO_ERROR) {
                ALOGE("setDesiredDisplayConfigSpecs: failed to read maxRefreshRate: %d", result);
                return result;
            }
            result = setDesiredDisplayConfigSpecs(displayToken, defaultModeId, minRefreshRate,
                                                  maxRefreshRate);
            if (result != NO_ERROR) {
                ALOGE("setDesiredDisplayConfigSpecs: failed to call setDesiredDisplayConfigSpecs: "
                      "%d",
                      result);
                return result;
            }
            reply->writeInt32(result);
            return result;
        }
        case GET_DISPLAY_BRIGHTNESS_SUPPORT: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> displayToken;
Loading