Loading include/android/input.h +4 −1 Original line number Diff line number Diff line Loading @@ -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, }; /** Loading include/input/Input.h +29 −0 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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. */ Loading @@ -698,6 +722,7 @@ public: virtual KeyEvent* createKeyEvent() = 0; virtual MotionEvent* createMotionEvent() = 0; virtual FocusEvent* createFocusEvent() = 0; }; /* Loading @@ -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; }; /* Loading @@ -727,6 +754,7 @@ public: virtual KeyEvent* createKeyEvent() override; virtual MotionEvent* createMotionEvent() override; virtual FocusEvent* createFocusEvent() override; void recycle(InputEvent* event); Loading @@ -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 Loading include/input/InputTransport.h +25 −9 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ struct InputMessage { KEY, MOTION, FINISHED, FOCUS, }; struct Header { Loading Loading @@ -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 { Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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. Loading Loading @@ -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 Loading Loading @@ -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); Loading libs/gralloc/types/include/gralloctypes/Gralloc4.h +0 −9 Original line number Diff line number Diff line Loading @@ -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" Loading libs/gui/ISurfaceComposer.cpp +71 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading
include/android/input.h +4 −1 Original line number Diff line number Diff line Loading @@ -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, }; /** Loading
include/input/Input.h +29 −0 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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. */ Loading @@ -698,6 +722,7 @@ public: virtual KeyEvent* createKeyEvent() = 0; virtual MotionEvent* createMotionEvent() = 0; virtual FocusEvent* createFocusEvent() = 0; }; /* Loading @@ -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; }; /* Loading @@ -727,6 +754,7 @@ public: virtual KeyEvent* createKeyEvent() override; virtual MotionEvent* createMotionEvent() override; virtual FocusEvent* createFocusEvent() override; void recycle(InputEvent* event); Loading @@ -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 Loading
include/input/InputTransport.h +25 −9 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ struct InputMessage { KEY, MOTION, FINISHED, FOCUS, }; struct Header { Loading Loading @@ -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 { Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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. Loading Loading @@ -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 Loading Loading @@ -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); Loading
libs/gralloc/types/include/gralloctypes/Gralloc4.h +0 −9 Original line number Diff line number Diff line Loading @@ -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" Loading
libs/gui/ISurfaceComposer.cpp +71 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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