thermal-engine: Add support for bandwidth client API to receive two data

Add support for bandwidth request API to receive two input data
(bw_score and usecase_id) from clients using the same API.

Add new thermal bandwidth client helper API to combine two type of
bandwidth input data into single 32 bit int value. Client can use
this utility API for merging two inputs prior to every bandwidth
request to thermal/limits module.

Validate multi inputs from client from both thermal client library
and thermal server side before using it.

Remove tab characters from thermal client header file.

Client needs to consider below points for using bandwidth client APIs

- Whenever client wants to update bandwidth vote to limits, use this
helper API, 'thermal_bandwidth_client_merge_input_info()' first to
merge two input data into single int variable and the return value
will be used as final bandwidth request value for API,
'thermal_bandwidth_client_request()' with client name.

- 1st 16 bit will be used for bandwidth utilization score and 2nd
16 bits will be used for usecase_id.

- Both input data should be a maximum of 15 bit positive integer.
More than 15 bit data will be treat as invalid bandwidth data.

- Default value for both bandwidth input data will be zero. So client
should not use zero as a valid use case id or bandwidth score.

- It is client responsibility to pass current value of both inputs
anytime. If one of the input changes, client needs to send latest
value for both the inputs. The limits code will always consider last
requested value for both inputs.

- On first client request call, thermal library code will create few
resources for sending data and server death monitor. It will re-use
the same resource on subsequent calls. It is clients responsibility to
invoke 'thermal_bandwidth_client_cancel_request()' API to release all
these resources once client is done with bandwidth request update or
on exit.

Change-Id: I7afe80812434cfef6fe568e59e8beda5bdc8fddc
1 file changed
tree: 4318556939bf364b8660486de992aa2b6d748f74
  1. Android.bp
  2. Android.mk
  3. NOTICE
  4. thermal_client.h