diff options
author | Deepak Kundra <deepakkundra@gmail.com> | 2016-05-06 10:51:08 +0800 |
---|---|---|
committer | Deepak Kundra <deepakkundra@gmail.com> | 2016-05-09 17:34:07 -0700 |
commit | 711e2efada7c476dc0a25bbd859011441e6cb051 (patch) | |
tree | 759f7753c809696867b4bfce7ca99f73512707c4 | |
parent | ed04ee9784794f1183c0cf4440ec59cb1c6a1a0b (diff) | |
download | android_hardware_ril-stable/cm-13.0-caf-ZNH2K.tar.gz android_hardware_ril-stable/cm-13.0-caf-ZNH2K.tar.bz2 android_hardware_ril-stable/cm-13.0-caf-ZNH2K.zip |
RF cutback feature for SARstable/cm-13.0-caf-ZNH2KBstable/cm-13.0-caf-ZNH2K
Issue-id:FEIJ-350
Change-Id: I0cda490538cdf14ebf5248c5c487677e71a6ac07
(cherry picked from commit 2ee6820e5007ac2f1fbd58932991aa967d0f30ca)
-rw-r--r-- | include/telephony/ril.h | 14 | ||||
-rwxr-xr-x | libril/ril.cpp | 34 | ||||
-rw-r--r-- | libril/ril_commands.h | 2 |
3 files changed, 50 insertions, 0 deletions
diff --git a/include/telephony/ril.h b/include/telephony/ril.h index f80ff07..7a711ac 100644 --- a/include/telephony/ril.h +++ b/include/telephony/ril.h @@ -1508,6 +1508,10 @@ typedef struct { } RIL_CafOpenChannelParams; +typedef struct { + int state; +} RIL_RfControlState; + /** * RIL_REQUEST_GET_SIM_STATUS * @@ -4577,6 +4581,16 @@ typedef struct { */ #define RIL_REQUEST_CAF_SIM_OPEN_CHANNEL_WITH_P2 137 +/** + * RIL_REQUEST_SET_MAX_TRANSMIT_POWER + * + * Sends the request to enable or disable MAX transmit power control option + * + * "response" is void + */ + +#define RIL_REQUEST_SET_MAX_TRANSMIT_POWER 139 + /***********************************************************************/ #define RIL_UNSOL_RESPONSE_BASE 1000 diff --git a/libril/ril.cpp b/libril/ril.cpp index 0c99526..d49d5dd 100755 --- a/libril/ril.cpp +++ b/libril/ril.cpp @@ -272,6 +272,7 @@ static void dispatchSimAuthentication(Parcel &p, RequestInfo *pRI); static void dispatchDataProfile(Parcel &p, RequestInfo *pRI); static void dispatchRadioCapability(Parcel &p, RequestInfo *pRI); static void dispatchOpenChannelWithP2(Parcel &p, RequestInfo *pRI); +static void dispatchSetMaxTransmitPower(Parcel &p, RequestInfo *pRI); static int responseInts(Parcel &p, void *response, size_t responselen); static int responseFailCause(Parcel &p, void *response, size_t responselen); static int responseStrings(Parcel &p, void *response, size_t responselen); @@ -2102,6 +2103,38 @@ invalid: return; } + +static void dispatchSetMaxTransmitPower(Parcel &p, RequestInfo *pRI) { + RIL_RfControlState state; + int32_t t; + status_t status; + + memset(&state, 0, sizeof(state)); + status = p.readInt32(&t); + if (status != NO_ERROR) { + RLOGE("__func__ ERROR"); + goto invalid; + } + state.state = (int)t; + RLOGI("__func__ : %d\n", state.state); + + startRequest; + appendPrintBuf("%sstate.state=%d", printBuf, state.state); + closeRequest; + printRequest(pRI->token, pRI->pCI->requestNumber); + + CALL_ONREQUEST(pRI->pCI->requestNumber, &state, sizeof(state), pRI, pRI->socket_id); + +#ifdef MEMSET_FREED + memset(&state, 0, sizeof(state)); +#endif + + return; +invalid: + invalidCommandBlock(pRI); + return; +} + static int blockingWrite(int fd, const void *buffer, size_t len) { size_t writeOffset = 0; @@ -5228,6 +5261,7 @@ requestToString(int request) { case RIL_REQUEST_GET_DC_RT_INFO: return "GET_DC_RT_INFO"; case RIL_REQUEST_SET_DC_RT_INFO_RATE: return "SET_DC_RT_INFO_RATE"; case RIL_REQUEST_SET_DATA_PROFILE: return "SET_DATA_PROFILE"; + case RIL_REQUEST_SET_MAX_TRANSMIT_POWER: return "RIL_REQUEST_SET_MAX_TRANSMIT_POWER"; case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED: return "UNSOL_RESPONSE_RADIO_STATE_CHANGED"; case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED: return "UNSOL_RESPONSE_CALL_STATE_CHANGED"; case RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED: return "UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED"; diff --git a/libril/ril_commands.h b/libril/ril_commands.h index acbd6ba..141d412 100644 --- a/libril/ril_commands.h +++ b/libril/ril_commands.h @@ -152,3 +152,5 @@ {RIL_REQUEST_GET_ACTIVITY_INFO, dispatchVoid, responseActivityData}, {RIL_REQUEST_SIM_GET_ATR, dispatchInts, responseString}, {RIL_REQUEST_CAF_SIM_OPEN_CHANNEL_WITH_P2, dispatchOpenChannelWithP2, responseInts}, + {0, NULL, NULL}, + {RIL_REQUEST_SET_MAX_TRANSMIT_POWER, dispatchSetMaxTransmitPower, responseVoid}, |