AnboxProxy provides a proxy layer which encapsulates callbacks that can be used by a platform to change Android system behaviors. E.g. change the screen orientation. The platform can invoke the callbacks which are provided by Anbox on demand when triggering an action or changing a behavior.
More...
#include <anbox_proxy.h>
|
| AnboxProxy ()=default |
|
virtual | ~AnboxProxy ()=default |
|
| AnboxProxy (const AnboxProxy &)=delete |
|
AnboxProxy & | operator= (const AnboxProxy &)=delete |
|
int | change_screen_orientation (AnboxScreenOrientationType orientation_type) |
| Change the screen orientation. More...
|
|
void | set_change_screen_orientation_callback (const AnboxChangeScreenOrientationCallback &callback, void *user_data) |
| Set the screen orientation change callback. More...
|
|
int | change_display_density (uint32_t density) |
| Change the display density. More...
|
|
void | set_change_display_density_callback (const AnboxChangeDisplayDensityCallback &callback, void *user_data) |
| Set the display density change callback. More...
|
|
int | change_display_size (uint32_t width, uint32_t height) |
| Change the display size. More...
|
|
void | set_change_display_size_callback (const AnboxChangeDisplaySizeCallback &callback, void *user_data) |
| Set the display size change callback. More...
|
|
int | trigger_action (const char *name, const char **args, size_t args_len) |
| Trigger an action which is executed within the Android container. More...
|
|
void | set_trigger_action_callback (const AnboxTriggerActionCallback &callback, void *user_data) |
| Set the trigger action callback. More...
|
|
virtual int | send_message (const char *type, size_t type_size, const char *data, size_t data_size) |
| Send a message from Anbox to the platform. More...
|
|
int | create_adb_connection (const char *id) |
| Create ADB connection. More...
|
|
void | set_create_adb_connection_callback (const AnboxCreateADBConnectionCallback &callback, void *user_data) |
| Set the ADB connection creation callback. More...
|
|
AnboxProxy provides a proxy layer which encapsulates callbacks that can be used by a platform to change Android system behaviors. E.g. change the screen orientation. The platform can invoke the callbacks which are provided by Anbox on demand when triggering an action or changing a behavior.
Definition at line 65 of file anbox_proxy.h.
◆ AnboxProxy() [1/2]
anbox::AnboxProxy::AnboxProxy |
( |
| ) |
|
|
default |
◆ ~AnboxProxy()
virtual anbox::AnboxProxy::~AnboxProxy |
( |
| ) |
|
|
virtualdefault |
◆ AnboxProxy() [2/2]
anbox::AnboxProxy::AnboxProxy |
( |
const AnboxProxy & |
| ) |
|
|
delete |
◆ change_display_density()
int anbox::AnboxProxy::change_display_density |
( |
uint32_t |
density | ) |
|
|
inline |
Change the display density.
- Parameters
-
density | the density value of the display |
- Returns
- 0 on success, otherwise returns EINVAL on error occurs.
Definition at line 97 of file anbox_proxy.h.
◆ change_display_size()
int anbox::AnboxProxy::change_display_size |
( |
uint32_t |
width, |
|
|
uint32_t |
height |
|
) |
| |
|
inline |
Change the display size.
- Parameters
-
width | the width of the display size |
height | the height of the display size |
- Returns
- 0 on success, otherwise returns EINVAL on error occurs.
Definition at line 117 of file anbox_proxy.h.
◆ change_screen_orientation()
Change the screen orientation.
- Parameters
-
orientation_type | the type of orientation to be applied to Android container |
- Returns
- 0 on success, otherwise returns EINVAL on error occurs.
Definition at line 78 of file anbox_proxy.h.
◆ create_adb_connection()
int anbox::AnboxProxy::create_adb_connection |
( |
const char * |
id | ) |
|
|
inline |
Create ADB connection.
- Parameters
-
id | the unique ID of the ADB connection |
- Returns
- a positive value representing the exposed ADB connection port number on success, or EINVAL if an error occurs.
Definition at line 184 of file anbox_proxy.h.
◆ operator=()
◆ send_message()
virtual int anbox::AnboxProxy::send_message |
( |
const char * |
type, |
|
|
size_t |
type_size, |
|
|
const char * |
data, |
|
|
size_t |
data_size |
|
) |
| |
|
inlinevirtual |
Send a message from Anbox to the platform.
- Parameters
-
type | pointer to type data |
type_size | length of type data |
data | pointer to message data |
data_size | length of message data |
- Returns
- 0 on success, otherwise returns a negative value on error.
Definition at line 168 of file anbox_proxy.h.
◆ set_change_display_density_callback()
Set the display density change callback.
Definition at line 104 of file anbox_proxy.h.
◆ set_change_display_size_callback()
Set the display size change callback.
Definition at line 124 of file anbox_proxy.h.
◆ set_change_screen_orientation_callback()
Set the screen orientation change callback.
Definition at line 85 of file anbox_proxy.h.
◆ set_create_adb_connection_callback()
Set the ADB connection creation callback.
Definition at line 191 of file anbox_proxy.h.
◆ set_trigger_action_callback()
◆ trigger_action()
int anbox::AnboxProxy::trigger_action |
( |
const char * |
name, |
|
|
const char ** |
args, |
|
|
size_t |
args_len |
|
) |
| |
|
inline |
Trigger an action which is executed within the Android container.
- Parameters
-
name | the name of action |
args | the arguments to be launched the action |
args_len | the number of arguments to launch the action |
- Returns
- 0 on success, otherwise returns EINVAL on error occurs.
- Note
- the args only stands for the parameter to action and unlike standard C the action name must not be included in the parameters. So does
args_len
only reflects the number of parameters, the name of the action must not be counted. The returned value 0 only implies the request to launch action is handled by Anbox successfully, it doesn't tell if the action is invoked successfully within the Android container or not. To check the actual error message if the action script is not executed successfully within the Android container, please view the log of anbox service unit.
Definition at line 146 of file anbox_proxy.h.
The documentation for this class was generated from the following file: