Navigation Menu

Skip to content

Commit

Permalink
Merge tag 'android-7.1.0_r4' of https://android.googlesource.com/plat…
Browse files Browse the repository at this point in the history
…form/hardware/libhardware into 71

Android 7.1.0 release 4

Change-Id: I3885575689151af8afdd7f6f71e1322f34150f39
  • Loading branch information
ryzenforce990 committed Oct 25, 2016
2 parents 0d76048 + 821e034 commit f305386
Show file tree
Hide file tree
Showing 9 changed files with 1,376 additions and 183 deletions.
3 changes: 2 additions & 1 deletion include/hardware/audio.h
Expand Up @@ -256,7 +256,8 @@ typedef struct audio_stream audio_stream_t;
/* type of asynchronous write callback events. Mutually exclusive */
typedef enum {
STREAM_CBK_EVENT_WRITE_READY, /* non blocking write completed */
STREAM_CBK_EVENT_DRAIN_READY /* drain completed */
STREAM_CBK_EVENT_DRAIN_READY, /* drain completed */
STREAM_CBK_EVENT_ERROR, /* stream hit some error, let AF take action */
} stream_callback_event_t;

typedef int (*stream_callback_t)(stream_callback_event_t event, void *param, void *cookie);
Expand Down
28 changes: 28 additions & 0 deletions include/hardware/bt_hf.h
Expand Up @@ -74,6 +74,20 @@ typedef enum
BTHF_CHLD_TYPE_ADDHELDTOCONF, // Add all held calls to a conference
} bthf_chld_type_t;


/* HF Indicators HFP 1.7 */
typedef enum
{
BTHF_HF_IND_ENHANCED_DRIVER_SAFETY = 1,
BTHF_HF_IND_BATTERY_LEVEL_STATUS = 2,
} bthf_hf_ind_type_t;

typedef enum
{
BTHF_HF_IND_DISABLED = 0,
BTHF_HF_IND_ENABLED,
} bthf_hf_ind_status_t;

/** Callback for connection state change.
* state will have one of the values from BtHfConnectionState
*/
Expand Down Expand Up @@ -152,6 +166,15 @@ typedef void (* bthf_unknown_at_cmd_callback)(char *at_string, bt_bdaddr_t *bd_a
*/
typedef void (* bthf_key_pressed_cmd_callback)(bt_bdaddr_t *bd_addr);

/** Callback for BIND. Pass the remote HF Indicators supported.
*/
typedef void (* bthf_bind_cmd_callback)(char *at_string, bt_bdaddr_t *bd_addr);

/** Callback for BIEV. Pass the change in the Remote HF indicator values
*/
typedef void (* bthf_biev_cmd_callback)(bthf_hf_ind_type_t ind_id, int ind_value,
bt_bdaddr_t *bd_addr);

/** BT-HF callback structure. */
typedef struct {
/** set to sizeof(BtHfCallbacks) */
Expand All @@ -172,6 +195,8 @@ typedef struct {
bthf_cops_cmd_callback cops_cmd_cb;
bthf_clcc_cmd_callback clcc_cmd_cb;
bthf_unknown_at_cmd_callback unknown_at_cmd_cb;
bthf_bind_cmd_callback bind_cb;
bthf_biev_cmd_callback biev_cb;
bthf_key_pressed_cmd_callback key_pressed_cmd_cb;
} bthf_callbacks_t;

Expand Down Expand Up @@ -310,6 +335,9 @@ typedef struct {
bt_status_t (*voip_network_type_wifi) (bthf_voip_state_t is_voip_started,
bthf_voip_call_network_type_t is_network_wifi);

/** Response for HF Indicator change (+BIND) */
bt_status_t (*bind_response)(bthf_hf_ind_type_t ind_id, bthf_hf_ind_status_t ind_status,
bt_bdaddr_t *bd_addr);
} bthf_interface_t;

__END_DECLS
Expand Down
22 changes: 22 additions & 0 deletions include/hardware/context_hub.h
Expand Up @@ -357,6 +357,27 @@ struct query_apps_request_t {
* Response : struct mem_range_t[]
*/

/**
* CONTEXT_HUB_OS_REBOOT
* Reboots context hub OS, restarts all the nanoApps.
* No reboot notification is sent to nanoApps; reboot happens immediately and
* unconditionally; all volatile FW state and any data is lost as a result
*
* Payload : none
*
* Response : status_response_t
* On receipt of a successful response, it is
* expected that
*
* i) system reboot has completed;
* status contains reboot reason code (platform-specific)
*
* Unsolicited response:
* System may send unsolicited response at any time;
* this should be interpreted as FW reboot, and necessary setup
* has to be done (same or similar to the setup done on system boot)
*/

/**
* All communication between the context hubs and the Context Hub Service is in
* the form of messages. Some message types are distinguished and their
Expand All @@ -372,6 +393,7 @@ typedef enum {
CONTEXT_HUB_UNLOAD_APP = 4, // Unload a specified app
CONTEXT_HUB_QUERY_APPS = 5, // Query for app(s) info on hub
CONTEXT_HUB_QUERY_MEMORY = 6, // Query for memory info
CONTEXT_HUB_OS_REBOOT = 7, // Request to reboot context HUB OS
} hub_messages_e;

#define CONTEXT_HUB_TYPE_PRIVATE_MSG_BASE 0x00400
Expand Down
32 changes: 32 additions & 0 deletions include/hardware/gralloc.h
Expand Up @@ -396,6 +396,38 @@ static inline int gralloc_close(struct alloc_device_t* device) {
return device->common.close(&device->common);
}

/**
* map_usage_to_memtrack should be called after allocating a gralloc buffer.
*
* @param usage - it is the flag used when alloc function is called.
*
* This function maps the gralloc usage flags to appropriate memtrack bucket.
* GrallocHAL implementers and users should make an additional ION_IOCTL_TAG
* call using the memtrack tag returned by this function. This will help the
* in-kernel memtack to categorize the memory allocated by different processes
* according to their usage.
*
*/
static inline const char* map_usage_to_memtrack(uint32_t usage) {
usage &= GRALLOC_USAGE_ALLOC_MASK;

if ((usage & GRALLOC_USAGE_HW_CAMERA_WRITE) != 0) {
return "camera";
} else if ((usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) != 0 ||
(usage & GRALLOC_USAGE_EXTERNAL_DISP) != 0) {
return "video";
} else if ((usage & GRALLOC_USAGE_HW_RENDER) != 0 ||
(usage & GRALLOC_USAGE_HW_TEXTURE) != 0) {
return "gl";
} else if ((usage & GRALLOC_USAGE_HW_CAMERA_READ) != 0) {
return "camera";
} else if ((usage & GRALLOC_USAGE_SW_READ_MASK) != 0 ||
(usage & GRALLOC_USAGE_SW_WRITE_MASK) != 0) {
return "cpu";
}
return "graphics";
}

__END_DECLS

#endif // ANDROID_GRALLOC_INTERFACE_H

0 comments on commit f305386

Please sign in to comment.