Loading include/input/Input.h +23 −7 Original line number Diff line number Diff line Loading @@ -43,6 +43,13 @@ * Additional private constants not defined in ndk/ui/input.h. */ enum { #ifdef __linux__ /* This event was generated or modified by accessibility service. */ AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = android::os::IInputConstants::INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT, // 0x800, #else AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800; #endif /* Signifies that the key is being predispatched */ AKEY_EVENT_FLAG_PREDISPATCH = 0x20000000, Loading Loading @@ -81,6 +88,16 @@ enum { */ AMOTION_EVENT_FLAG_NO_FOCUS_CHANGE = 0x40, #ifdef __linux__ /** * This event was generated or modified by accessibility service. */ AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = android::os::IInputConstants::INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT, // 0x800, #else AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800; #endif /* Motion event is inconsistent with previously sent motion events. */ AMOTION_EVENT_FLAG_TAINTED = 0x80000000, }; Loading @@ -89,14 +106,15 @@ enum { * Allowed VerifiedKeyEvent flags. All other flags from KeyEvent do not get verified. * These values must be kept in sync with VerifiedKeyEvent.java */ constexpr int32_t VERIFIED_KEY_EVENT_FLAGS = AKEY_EVENT_FLAG_CANCELED; constexpr int32_t VERIFIED_KEY_EVENT_FLAGS = AKEY_EVENT_FLAG_CANCELED | AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT; /** * Allowed VerifiedMotionEventFlags. All other flags from MotionEvent do not get verified. * These values must be kept in sync with VerifiedMotionEvent.java */ constexpr int32_t VERIFIED_MOTION_EVENT_FLAGS = AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED | AMOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED; constexpr int32_t VERIFIED_MOTION_EVENT_FLAGS = AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED | AMOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED | AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT; /** * This flag indicates that the point up event has been canceled. Loading Loading @@ -222,16 +240,14 @@ enum { POLICY_FLAG_GESTURE = 0x00000008, POLICY_FLAG_RAW_MASK = 0x0000ffff, #ifdef __linux__ POLICY_FLAG_INPUTFILTER_TRUSTED = android::os::IInputConstants::POLICY_FLAG_INPUTFILTER_TRUSTED, #ifdef __linux__ POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = android::os::IInputConstants::POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY, #else POLICY_FLAG_INPUTFILTER_TRUSTED = 0x10000, POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000, #endif /* These flags are set by the input dispatcher. */ // Indicates that the input event was injected. Loading include/input/InputDevice.h +0 −2 Original line number Diff line number Diff line Loading @@ -318,8 +318,6 @@ extern std::string getInputDeviceConfigurationFilePathByName( const std::string& name, InputDeviceConfigurationFileType type); enum ReservedInputDeviceId : int32_t { // Device id assigned to input events generated inside accessibility service ACCESSIBILITY_DEVICE_ID = -2, // Device id of a special "virtual" keyboard that is always present. VIRTUAL_KEYBOARD_ID = -1, // Device id of the "built-in" keyboard if there is one. Loading libs/input/android/os/IInputConstants.aidl +7 −8 Original line number Diff line number Diff line Loading @@ -42,16 +42,15 @@ interface IInputConstants const int INVALID_INPUT_EVENT_ID = 0; /** * The injected event was originally sent from InputDispatcher. Most likely, the journey of the * event looked as follows: * InputDispatcherPolicyInterface::filterInputEvent -> InputFilter.java::onInputEvent -> * InputFilter.java::sendInputEvent -> InputDispatcher::injectInputEvent, without being modified * along the way. * The input event was injected from accessibility. Used in policyFlags for input event * injection. */ const int POLICY_FLAG_INPUTFILTER_TRUSTED = 0x10000; const int POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000; /** * The input event was injected from accessibility * The input event was generated or modified by accessibility service. * Shared by both KeyEvent and MotionEvent flags, so this value should not overlap with either * set of flags, including in input/Input.h and in android/input.h. */ const int POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000; const int INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800; } libs/renderengine/skia/filters/LinearEffect.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -167,13 +167,12 @@ static void generateToneMapInterpolation(ui::Dataspace inputDataspace, float nits = xyz.y; // clamp to max input luminance nits = clamp(nits, 0.0, maxInLumi); // scale [0.0, maxInLumi] to [0.0, maxOutLumi] // if the max input luminance is less than what we can output then // no tone mapping is needed as all color values will be in range. if (maxInLumi <= maxOutLumi) { return xyz * (maxOutLumi / maxInLumi); return xyz; } else { // three control points const float x0 = 10.0; const float y0 = 17.0; Loading services/inputflinger/TEST_MAPPING +9 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,15 @@ } ] }, { "name": "FrameworksCoreTests", "options": [ { "include-filter": "android.view.VerifiedKeyEventTest", "include-filter": "android.view.VerifiedMotionEventTest" } ] }, { "name": "CtsSecurityTestCases", "options": [ Loading Loading
include/input/Input.h +23 −7 Original line number Diff line number Diff line Loading @@ -43,6 +43,13 @@ * Additional private constants not defined in ndk/ui/input.h. */ enum { #ifdef __linux__ /* This event was generated or modified by accessibility service. */ AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = android::os::IInputConstants::INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT, // 0x800, #else AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800; #endif /* Signifies that the key is being predispatched */ AKEY_EVENT_FLAG_PREDISPATCH = 0x20000000, Loading Loading @@ -81,6 +88,16 @@ enum { */ AMOTION_EVENT_FLAG_NO_FOCUS_CHANGE = 0x40, #ifdef __linux__ /** * This event was generated or modified by accessibility service. */ AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = android::os::IInputConstants::INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT, // 0x800, #else AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800; #endif /* Motion event is inconsistent with previously sent motion events. */ AMOTION_EVENT_FLAG_TAINTED = 0x80000000, }; Loading @@ -89,14 +106,15 @@ enum { * Allowed VerifiedKeyEvent flags. All other flags from KeyEvent do not get verified. * These values must be kept in sync with VerifiedKeyEvent.java */ constexpr int32_t VERIFIED_KEY_EVENT_FLAGS = AKEY_EVENT_FLAG_CANCELED; constexpr int32_t VERIFIED_KEY_EVENT_FLAGS = AKEY_EVENT_FLAG_CANCELED | AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT; /** * Allowed VerifiedMotionEventFlags. All other flags from MotionEvent do not get verified. * These values must be kept in sync with VerifiedMotionEvent.java */ constexpr int32_t VERIFIED_MOTION_EVENT_FLAGS = AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED | AMOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED; constexpr int32_t VERIFIED_MOTION_EVENT_FLAGS = AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED | AMOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED | AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT; /** * This flag indicates that the point up event has been canceled. Loading Loading @@ -222,16 +240,14 @@ enum { POLICY_FLAG_GESTURE = 0x00000008, POLICY_FLAG_RAW_MASK = 0x0000ffff, #ifdef __linux__ POLICY_FLAG_INPUTFILTER_TRUSTED = android::os::IInputConstants::POLICY_FLAG_INPUTFILTER_TRUSTED, #ifdef __linux__ POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = android::os::IInputConstants::POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY, #else POLICY_FLAG_INPUTFILTER_TRUSTED = 0x10000, POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000, #endif /* These flags are set by the input dispatcher. */ // Indicates that the input event was injected. Loading
include/input/InputDevice.h +0 −2 Original line number Diff line number Diff line Loading @@ -318,8 +318,6 @@ extern std::string getInputDeviceConfigurationFilePathByName( const std::string& name, InputDeviceConfigurationFileType type); enum ReservedInputDeviceId : int32_t { // Device id assigned to input events generated inside accessibility service ACCESSIBILITY_DEVICE_ID = -2, // Device id of a special "virtual" keyboard that is always present. VIRTUAL_KEYBOARD_ID = -1, // Device id of the "built-in" keyboard if there is one. Loading
libs/input/android/os/IInputConstants.aidl +7 −8 Original line number Diff line number Diff line Loading @@ -42,16 +42,15 @@ interface IInputConstants const int INVALID_INPUT_EVENT_ID = 0; /** * The injected event was originally sent from InputDispatcher. Most likely, the journey of the * event looked as follows: * InputDispatcherPolicyInterface::filterInputEvent -> InputFilter.java::onInputEvent -> * InputFilter.java::sendInputEvent -> InputDispatcher::injectInputEvent, without being modified * along the way. * The input event was injected from accessibility. Used in policyFlags for input event * injection. */ const int POLICY_FLAG_INPUTFILTER_TRUSTED = 0x10000; const int POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000; /** * The input event was injected from accessibility * The input event was generated or modified by accessibility service. * Shared by both KeyEvent and MotionEvent flags, so this value should not overlap with either * set of flags, including in input/Input.h and in android/input.h. */ const int POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000; const int INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800; }
libs/renderengine/skia/filters/LinearEffect.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -167,13 +167,12 @@ static void generateToneMapInterpolation(ui::Dataspace inputDataspace, float nits = xyz.y; // clamp to max input luminance nits = clamp(nits, 0.0, maxInLumi); // scale [0.0, maxInLumi] to [0.0, maxOutLumi] // if the max input luminance is less than what we can output then // no tone mapping is needed as all color values will be in range. if (maxInLumi <= maxOutLumi) { return xyz * (maxOutLumi / maxInLumi); return xyz; } else { // three control points const float x0 = 10.0; const float y0 = 17.0; Loading
services/inputflinger/TEST_MAPPING +9 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,15 @@ } ] }, { "name": "FrameworksCoreTests", "options": [ { "include-filter": "android.view.VerifiedKeyEventTest", "include-filter": "android.view.VerifiedMotionEventTest" } ] }, { "name": "CtsSecurityTestCases", "options": [ Loading