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

Commit ad8fda47 authored by The Android Automerger's avatar The Android Automerger
Browse files

Merge branch 'master' into honeycomb-release

parents 85f67847 8c36126f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <utils/threads.h>
#include <utils/List.h>
#include <utils/Errors.h>
#include <utils/PropertyMap.h>

#include <linux/input.h>

@@ -156,6 +157,8 @@ public:

    virtual String8 getDeviceName(int32_t deviceId) const = 0;

    virtual void getConfiguration(int32_t deviceId, PropertyMap* outConfiguration) const = 0;

    virtual status_t getAbsoluteAxisInfo(int32_t deviceId, int axis,
            RawAbsoluteAxisInfo* outAxisInfo) const = 0;

@@ -205,6 +208,8 @@ public:

    virtual String8 getDeviceName(int32_t deviceId) const;

    virtual void getConfiguration(int32_t deviceId, PropertyMap* outConfiguration) const;

    virtual status_t getAbsoluteAxisInfo(int32_t deviceId, int axis,
            RawAbsoluteAxisInfo* outAxisInfo) const;

@@ -247,6 +252,8 @@ private:
        uint32_t        classes;
        uint8_t*        keyBitmask;
        KeyLayoutMap*   layoutMap;
        String8         configurationFile;
        PropertyMap*    configuration;
        KeyMapInfo      keyMapInfo;
        int             fd;
        device_t*       next;
@@ -264,6 +271,7 @@ private:
    bool markSupportedKeyCodesLocked(device_t* device, size_t numCodes,
            const int32_t* keyCodes, uint8_t* outFlags) const;

    void loadConfiguration(device_t* device);
    void configureKeyMap(device_t* device);
    void setKeyboardProperties(device_t* device, bool firstKeyboard);
    void clearKeyboardProperties(device_t* device, bool firstKeyboard);
+16 −0
Original line number Diff line number Diff line
@@ -497,6 +497,22 @@ private:
    KeyedVector<int32_t, MotionRange> mMotionRanges;
};

/* Types of input device configuration files. */
enum InputDeviceConfigurationFileType {
    INPUT_DEVICE_CONFIGURATION_FILE_TYPE_CONFIGURATION = 0,     /* .idc file */
    INPUT_DEVICE_CONFIGURATION_FILE_TYPE_KEY_LAYOUT = 1,        /* .kl file */
    INPUT_DEVICE_CONFIGURATION_FILE_TYPE_KEY_CHARACTER_MAP = 2, /* .kcm file */
};

/*
 * Get the path of an input device configuration file, if one is available.
 * Spaces in the name are replaced with underscores.
 * Considers both system provided and user installed configuration files.
 *
 * Returns an empty string if not found.
 */
extern String8 getInputDeviceConfigurationFilePath(
        const String8& name, InputDeviceConfigurationFileType type);

} // namespace android

+1 −6
Original line number Diff line number Diff line
@@ -291,9 +291,7 @@ public:
     * This method is expected to set the POLICY_FLAG_PASS_TO_USER policy flag if the event
     * should be dispatched to applications.
     */
    virtual void interceptKeyBeforeQueueing(nsecs_t when, int32_t deviceId,
            int32_t action, int32_t& flags, int32_t keyCode, int32_t scanCode,
            uint32_t& policyFlags) = 0;
    virtual void interceptKeyBeforeQueueing(const KeyEvent* keyEvent, uint32_t& policyFlags) = 0;

    /* Intercepts a generic touch, trackball or other event before queueing it.
     * The policy can use this method as an opportunity to perform power management functions
@@ -894,9 +892,6 @@ private:
    // Input channels that will receive a copy of all input events.
    Vector<sp<InputChannel> > mMonitoringChannels;

    // Preallocated key event object used for policy inquiries.
    KeyEvent mReusableKeyEvent;

    // Event injection and synchronization.
    Condition mInjectionResultAvailableCondition;
    bool hasInjectionPermission(int32_t injectorPid, int32_t injectorUid);
+37 −35
Original line number Diff line number Diff line
@@ -47,23 +47,6 @@ struct VirtualKeyDefinition {
};


/* Specifies input device calibration settings. */
class InputDeviceCalibration {
public:
    InputDeviceCalibration();

    void clear();
    void addProperty(const String8& key, const String8& value);

    bool tryGetProperty(const String8& key, String8& outValue) const;
    bool tryGetProperty(const String8& key, int32_t& outValue) const;
    bool tryGetProperty(const String8& key, float& outValue) const;

private:
    KeyedVector<String8, String8> mProperties;
};


/*
 * Input reader policy interface.
 *
@@ -107,10 +90,6 @@ public:
    virtual void getVirtualKeyDefinitions(const String8& deviceName,
            Vector<VirtualKeyDefinition>& outVirtualKeyDefinitions) = 0;

    /* Gets the calibration for an input device. */
    virtual void getInputDeviceCalibration(const String8& deviceName,
            InputDeviceCalibration& outCalibration) = 0;

    /* Gets the excluded device names for the platform. */
    virtual void getExcludedDeviceNames(Vector<String8>& outExcludedDeviceNames) = 0;
};
@@ -314,8 +293,8 @@ public:

    int32_t getMetaState();

    inline const InputDeviceCalibration& getCalibration() {
        return mCalibration;
    inline const PropertyMap& getConfiguration() {
        return mConfiguration;
    }

private:
@@ -330,7 +309,7 @@ private:
    typedef int32_t (InputMapper::*GetStateFunc)(uint32_t sourceMask, int32_t code);
    int32_t getState(uint32_t sourceMask, int32_t code, GetStateFunc getStateFunc);

    InputDeviceCalibration mCalibration;
    PropertyMap mConfiguration;
};


@@ -389,13 +368,13 @@ private:

class KeyboardInputMapper : public InputMapper {
public:
    KeyboardInputMapper(InputDevice* device, int32_t associatedDisplayId, uint32_t sources,
            int32_t keyboardType);
    KeyboardInputMapper(InputDevice* device, uint32_t sources, int32_t keyboardType);
    virtual ~KeyboardInputMapper();

    virtual uint32_t getSources();
    virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
    virtual void dump(String8& dump);
    virtual void configure();
    virtual void reset();
    virtual void process(const RawEvent* rawEvent);

@@ -414,10 +393,15 @@ private:
        int32_t scanCode;
    };

    int32_t mAssociatedDisplayId;
    uint32_t mSources;
    int32_t mKeyboardType;

    // Immutable configuration parameters.
    struct Parameters {
        int32_t associatedDisplayId;
        bool orientationAware;
    } mParameters;

    struct LockedState {
        Vector<KeyDown> keyDowns; // keys that are down
        int32_t metaState;
@@ -435,6 +419,9 @@ private:
    void initializeLocked();
    void initializeLedStateLocked(LockedState::LedState& ledState, int32_t led);

    void configureParameters();
    void dumpParameters(String8& dump);

    bool isKeyboardOrGamepadKey(int32_t scanCode);

    void processKey(nsecs_t when, bool down, int32_t keyCode, int32_t scanCode,
@@ -450,12 +437,13 @@ private:

class TrackballInputMapper : public InputMapper {
public:
    TrackballInputMapper(InputDevice* device, int32_t associatedDisplayId);
    TrackballInputMapper(InputDevice* device);
    virtual ~TrackballInputMapper();

    virtual uint32_t getSources();
    virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
    virtual void dump(String8& dump);
    virtual void configure();
    virtual void reset();
    virtual void process(const RawEvent* rawEvent);

@@ -467,7 +455,11 @@ private:

    Mutex mLock;

    int32_t mAssociatedDisplayId;
    // Immutable configuration parameters.
    struct Parameters {
        int32_t associatedDisplayId;
        bool orientationAware;
    } mParameters;

    struct Accumulator {
        enum {
@@ -499,13 +491,16 @@ private:

    void initializeLocked();

    void configureParameters();
    void dumpParameters(String8& dump);

    void sync(nsecs_t when);
};


class TouchInputMapper : public InputMapper {
public:
    TouchInputMapper(InputDevice* device, int32_t associatedDisplayId);
    TouchInputMapper(InputDevice* device);
    virtual ~TouchInputMapper();

    virtual uint32_t getSources();
@@ -591,10 +586,17 @@ protected:
        }
    };

    int32_t mAssociatedDisplayId;

    // Immutable configuration parameters.
    struct Parameters {
        enum DeviceType {
            DEVICE_TYPE_TOUCH_SCREEN,
            DEVICE_TYPE_TOUCH_PAD,
        };

        DeviceType deviceType;
        int32_t associatedDisplayId;
        bool orientationAware;

        bool useBadTouchFilter;
        bool useJumpyTouchFilter;
        bool useAveragingTouchFilter;
@@ -641,7 +643,7 @@ protected:
        bool haveToolSizeAreaBias;
        float toolSizeAreaBias;
        bool haveToolSizeIsSummed;
        int32_t toolSizeIsSummed;
        bool toolSizeIsSummed;

        // Pressure
        enum PressureCalibration {
@@ -846,7 +848,7 @@ private:

class SingleTouchInputMapper : public TouchInputMapper {
public:
    SingleTouchInputMapper(InputDevice* device, int32_t associatedDisplayId);
    SingleTouchInputMapper(InputDevice* device);
    virtual ~SingleTouchInputMapper();

    virtual void reset();
@@ -892,7 +894,7 @@ private:

class MultiTouchInputMapper : public TouchInputMapper {
public:
    MultiTouchInputMapper(InputDevice* device, int32_t associatedDisplayId);
    MultiTouchInputMapper(InputDevice* device);
    virtual ~MultiTouchInputMapper();

    virtual void reset();
+7 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <ui/Input.h>
#include <utils/Errors.h>
#include <utils/String8.h>
#include <utils/PropertyMap.h>

namespace android {

@@ -33,19 +34,23 @@ enum {
};

struct KeyMapInfo {
    String8 keyMapName;
    String8 keyLayoutFile;
    String8 keyCharacterMapFile;
    bool isDefaultKeyMap;

    KeyMapInfo() : isDefaultKeyMap(false) {
    }

    bool isComplete() {
        return !keyLayoutFile.isEmpty() && !keyCharacterMapFile.isEmpty();
    }
};

/**
 * Resolves the key map to use for a particular keyboard device.
 */
extern status_t resolveKeyMap(const String8& deviceName, KeyMapInfo& outKeyMapInfo);
extern status_t resolveKeyMap(const String8& deviceName,
        const PropertyMap* deviceConfiguration, KeyMapInfo& outKeyMapInfo);

/**
 * Sets keyboard system properties.
Loading