~mir-team/mir/android-input-transport-scatter-send-event

« back to all changes in this revision

Viewing changes to 3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h

  • Committer: Brandon Schaefer
  • Date: 2015-12-04 02:31:22 UTC
  • Revision ID: brandon.schaefer@canonical.com-20151204023122-zyt91xfjkymtmnhl
* Move to using a unit8_t* for the mac + a uint32_t mac_size to pass a variable length mac hash
  through the fd

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
namespace android {
43
43
 
 
44
/* Padding for InputMessage */
 
45
static uint32_t const MESSAGE_PADDING = 1000;
 
46
 
44
47
/*
45
48
 * Intermediate representation used to send input events and related signals.
46
49
 */
62
65
        struct Key {
63
66
            uint32_t seq;
64
67
            int64_t eventTime;
65
 
            uint64_t mac;
66
68
            int32_t deviceId;
67
69
            int32_t source;
68
70
            int32_t action;
72
74
            int32_t metaState;
73
75
            int32_t repeatCount;
74
76
            int64_t downTime;
 
77
            uint32_t mac_size;
 
78
            uint8_t* mac;
75
79
 
76
80
            inline size_t size() const {
77
81
                return sizeof(Key);
81
85
        struct Motion {
82
86
            uint32_t seq;
83
87
            int64_t eventTime;
84
 
            uint64_t mac;
85
88
            int32_t deviceId;
86
89
            int32_t source;
87
90
            int32_t action;
99
102
                PointerProperties properties;
100
103
                PointerCoords coords;
101
104
            } pointers[MAX_POINTERS];
 
105
            uint32_t mac_size;
 
106
            uint8_t* mac;
102
107
 
103
108
            int32_t getActionId() const {
104
109
                uint32_t index = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK)
120
125
                return sizeof(Finished);
121
126
            }
122
127
        } finished;
 
128
 
 
129
        /* Use a 1KB padding for the MAC
 
130
         *
 
131
         * So we only send 1 message and recv it *knowing* we have
 
132
         * the entire message
 
133
         */
 
134
        struct Padding {
 
135
            uint8_t padding[MESSAGE_PADDING];
 
136
        };
123
137
    } body;
124
138
 
125
139
    bool isValid(size_t actualSize) const;