diff options
author | Wink Saville <wink@google.com> | 2014-07-13 05:17:28 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2014-07-13 05:17:28 -0700 |
commit | c29360a92ad603fcec008c098cbbed47e3399dc8 (patch) | |
tree | e433b2bffebac2d99a1c47380731d8eb26b3054f /libril | |
parent | 2b77203b8c64e5bfa848303df7328d015069f8c7 (diff) | |
download | android_hardware_ril-c29360a92ad603fcec008c098cbbed47e3399dc8.tar.gz android_hardware_ril-c29360a92ad603fcec008c098cbbed47e3399dc8.tar.bz2 android_hardware_ril-c29360a92ad603fcec008c098cbbed47e3399dc8.zip |
Add support for retrieving real time data connection information.
To be able to reduce power consumption caused by the mobile radio being
in a high power state, the radio will report its power state in real
time.
Bug: 8233234
Change-Id: Ia4195211c380efc04a65c6f1f6e4d29095a1bc35
Diffstat (limited to 'libril')
-rw-r--r-- | libril/ril.cpp | 25 | ||||
-rw-r--r-- | libril/ril_commands.h | 2 | ||||
-rw-r--r-- | libril/ril_unsol_commands.h | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/libril/ril.cpp b/libril/ril.cpp index 51743e5..bccc8d2 100644 --- a/libril/ril.cpp +++ b/libril/ril.cpp @@ -300,6 +300,7 @@ static int responseCdmaCallWaiting(Parcel &p,void *response, size_t responselen) static int responseSimRefresh(Parcel &p, void *response, size_t responselen); static int responseCellInfoList(Parcel &p, void *response, size_t responselen); static int responseHardwareConfig(Parcel &p, void *response, size_t responselen); +static int responseDcRtInfo(Parcel &p, void *response, size_t responselen); static int decodeVoiceRadioTechnology (RIL_RadioState radioState); static int decodeCdmaSubscriptionSource (RIL_RadioState radioState); @@ -3182,6 +3183,27 @@ static int responseCdmaSms(Parcel &p, void *response, size_t responselen) { return 0; } +static int responseDcRtInfo(Parcel &p, void *response, size_t responselen) +{ + int num = responselen / sizeof(RIL_DcRtInfo); + if ((responselen % sizeof(RIL_DcRtInfo) != 0) || (num != 1)) { + RLOGE("invalid response length %d expected multiple of %d", + (int)responselen, (int)sizeof(RIL_DcRtInfo)); + return RIL_ERRNO_INVALID_RESPONSE; + } + + startResponse; + RIL_DcRtInfo *pDcRtInfo = (RIL_DcRtInfo *)response; + p.writeInt64(pDcRtInfo->time); + p.writeInt32(pDcRtInfo->powerState); + appendPrintBuf("%s[time=%d,powerState=%d]", printBuf, + pDcRtInfo->time, + pDcRtInfo->powerState); + closeResponse; + + return 0; +} + /** * A write on the wakeup fd is done just to pop us out of select() * We empty the buffer here and then ril_event will reset the timers on the @@ -4519,6 +4541,8 @@ requestToString(int request) { case RIL_REQUEST_ALLOW_DATA: return "ALLOW_DATA"; case RIL_REQUEST_GET_HARDWARE_CONFIG: return "GET_HARDWARE_CONFIG"; case RIL_REQUEST_SIM_AUTHENTICATION: return "SIM_AUTHENTICATION"; + 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_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"; @@ -4559,6 +4583,7 @@ requestToString(int request) { case RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED: return "UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED"; case RIL_UNSOL_SRVCC_STATE_NOTIFY: return "UNSOL_SRVCC_STATE_NOTIFY"; case RIL_UNSOL_HARDWARE_CONFIG_CHANGED: return "HARDWARE_CONFIG_CHANGED"; + case RIL_UNSOL_DC_RT_INFO_CHANGED: return "UNSOL_DC_RT_INFO_CHANGED"; default: return "<unknown request>"; } } diff --git a/libril/ril_commands.h b/libril/ril_commands.h index 91cd7e5..d0affe7 100644 --- a/libril/ril_commands.h +++ b/libril/ril_commands.h @@ -140,3 +140,5 @@ {RIL_REQUEST_ALLOW_DATA, dispatchInts, responseVoid}, {RIL_REQUEST_GET_HARDWARE_CONFIG, dispatchVoid, responseHardwareConfig}, {RIL_REQUEST_SIM_AUTHENTICATION, dispatchString, responseString}, + {RIL_REQUEST_GET_DC_RT_INFO, dispatchVoid, responseDcRtInfo}, + {RIL_REQUEST_SET_DC_RT_INFO_RATE, dispatchInts, responseVoid}, diff --git a/libril/ril_unsol_commands.h b/libril/ril_unsol_commands.h index aca1fba..2232015 100644 --- a/libril/ril_unsol_commands.h +++ b/libril/ril_unsol_commands.h @@ -55,3 +55,4 @@ {RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED, responseInts, WAKE_PARTIAL}, {RIL_UNSOL_SRVCC_STATE_NOTIFY, responseInts, WAKE_PARTIAL}, {RIL_UNSOL_HARDWARE_CONFIG_CHANGED, responseHardwareConfig, WAKE_PARTIAL}, + {RIL_UNSOL_DC_RT_INFO_CHANGED, responseDcRtInfo, WAKE_PARTIAL}, |