blob: bc5960cb33323d9edbbcbf8f61c36792c4606668 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
/* Copyright (C) 2010 The Android Open Source Project
**
** This software is licensed under the terms of the GNU General Public
** License version 2, as published by the Free Software Foundation, and
** may be copied, distributed, and modified under those terms.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
*/
#ifndef _ANDROID_UI_CONTROL_COMMON_H
#define _ANDROID_UI_CONTROL_COMMON_H
#include "android/hw-sensors.h"
/*
* UI control requests sent by the core to the UI.
*/
/* Sets window scale. */
#define ACORE_UICTL_SET_WINDOWS_SCALE 1
/*
* UI control requests sent by the UI to the core.
*/
/* Sets coarse orientation. */
#define AUI_UICTL_SET_COARSE_ORIENTATION 2
/* Toggles the network (no parameters). */
#define AUI_UICTL_TOGGLE_NETWORK 3
/* Starts / stops the tracing. */
#define AUI_UICTL_TRACE_CONTROL 4
/* Checks if network is disabled (no params) */
#define AUI_UICTL_CHK_NETWORK_DISABLED 5
/* Gets net speed */
#define AUI_UICTL_GET_NETSPEED 6
/* Gets net delays */
#define AUI_UICTL_GET_NETDELAY 7
/* Gets path to a QEMU file on local host. */
#define AUI_UICTL_GET_QEMU_PATH 8
/* UI control message header. */
typedef struct UICtlHeader {
/* Message type. */
uint8_t msg_type;
/* Size of the message data following this header. */
uint32_t msg_data_size;
} UICtlHeader;
/* UI control response header. */
typedef struct UICtlRespHeader {
/* Result of the request handling. */
int result;
/* Size of the response data following this header. */
uint32_t resp_data_size;
} UICtlRespHeader;
/* Formats ACORE_UICTL_SET_WINDOWS_SCALE UI control request.
*/
typedef struct UICtlSetWindowsScale {
double scale;
int is_dpi;
} UICtlSetWindowsScale;
/* Formats AUI_UICTL_SET_COARSE_ORIENTATION UI control request.
*/
typedef struct UICtlSetCoarseOrientation {
AndroidCoarseOrientation orient;
} UICtlSetCoarseOrientation;
/* Formats AUI_UICTL_TRACE_CONTROL UI control request.
*/
typedef struct UICtlTraceControl {
int start;
} UICtlTraceControl;
/* Formats AUI_UICTL_GET_NETSPEED UI control request.
*/
typedef struct UICtlGetNetSpeed {
int index;
} UICtlGetNetSpeed;
/* Formats AUI_UICTL_GET_NETSPEED UI control request response.
*/
typedef struct UICtlGetNetSpeedResp {
/* Size of the entire response structure including name and display strings. */
int upload;
int download;
/* display field of NetworkSpeed structure is immediately following
* this field. */
char name[0];
} UICtlGetNetSpeedResp;
/* Formats AUI_UICTL_GET_NETDELAY UI control request.
*/
typedef struct UICtlGetNetDelay {
int index;
} UICtlGetNetDelay;
/* Formats AUI_UICTL_GET_NETDELAY UI control request response.
*/
typedef struct UICtlGetNetDelayResp {
/* Size of the entire response structure including name and display strings. */
int min_ms;
int max_ms;
/* display field of NetworkLatency structure is immediately following
* this field. */
char name[0];
} UICtlGetNetDelayResp;
/* Formats AUI_UICTL_GET_QEMU_PATH UI control request.
*/
typedef struct UICtlGetQemuPath {
int type;
char filename[0];
} UICtlGetQemuPath;
/* Formats AUI_UICTL_GET_QEMU_PATH UI control request response.
*/
typedef struct UICtlGetQemuPathResp {
/* Size of the entire response structure. */
char path[0];
} UICtlGetQemuPathResp;
#if 0
android_core_get_android_netspeed(int index, NetworkSpeed* netspeed) {
android_core_get_android_netdelay(int index, NetworkLatency* delay) {
int
android_core_qemu_find_file(int type, const char *filename,
char* path, size_t path_buf_size)
#endif
#endif /* _ANDROID_UI_CONTROL_COMMON_H */
|