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
|
/* 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_PROTOCOL_CORE_COMMANDS_API_H
#define _ANDROID_PROTOCOL_CORE_COMMANDS_API_H
/*
* Contains the API for calling into the Core with UI control commands.
*/
#include "android/android.h"
#include "android/hw-sensors.h"
/* Instructs the Core to change the coarse orientation.
* Return:
* 0 on success, or < 0 on failure.
*/
extern int corecmd_set_coarse_orientation(AndroidCoarseOrientation orient);
/* Toggles the network in the Core.
* Return:
* 0 on success, or < 0 on failure.
*/
extern int corecmd_toggle_network();
/* Starts or stops tracing in the Core.
* Param:
* start - Starts (> 0), or stops (== 0) tracing.
* Return:
* 0 on success, or < 0 on failure.
*/
extern int corecmd_trace_control(int start);
/* Checks if network is disabled in the Core.
* Return:
* 0 if network is enabled, 1 if it is disabled, or < 0 on failure.
*/
extern int corecmd_is_network_disabled();
/* Requests a NetworkSpeed instance from the Core.
* Param:
* index - Index of an entry in the NetworkSpeed array.
* netspeed - Upon success contains allocated and initialized NetworkSpeed
* instance for the given index. Note that strings addressed by "name" and
* "display" fileds in the returned NetworkSpeed instance are containd
* inside the buffer allocated for the returned NetworkSpeed instance.
* Caller of this routine must eventually free the buffer returned in this
* parameter.
* Return:
* 0 on success, or < 0 on failure.
*/
extern int corecmd_get_netspeed(int index, NetworkSpeed** netspeed);
/* Requests a NetworkLatency instance from the Core.
* Param:
* index - Index of an entry in the NetworkLatency array.
* netdelay - Upon success contains allocated and initialized NetworkLatency
* instance for the given index. Note that strings addressed by "name" and
* "display" fileds in the returned NetworkLatency instance are containd
* inside the buffer allocated for the returned NetworkLatency instance.
* Caller of this routine must eventually free the buffer returned in this
* parameter.
* Return:
* 0 on success, or < 0 on failure.
*/
extern int corecmd_get_netdelay(int index, NetworkLatency** netdelay);
/* Requests a QEMU file path from the Core.
* Param:
* type, filename - Request parameters that define the file for which path is
* requested.
* Return:
* 0 on success, or < 0 on failure.
*/
extern int corecmd_get_qemu_path(int type,
const char* filename,
char* path,
size_t path_buf_size);
/* Gets LCD density property from the core properties.
* Return:
* LCD density on success, or < 0 on failure.
*/
extern int corecmd_get_hw_lcd_density(void);
#endif /* _ANDROID_PROTOCOL_CORE_COMMANDS_API_H */
|