Cache data availability before gps is enabled

This is so that data disable is not
sent to the modem by default if data
is enabled

Change-Id: I383443fc0321380c22382ba7d7f85dacf948853a
CRs-fixed: 460376
This commit is contained in:
Tushar Janefalkar 2013-04-30 12:54:30 -07:00
parent 9dc77fa9e6
commit 22538a7f38

View file

@ -83,6 +83,7 @@ pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER;
LocEngContext* LocEngContext::me = NULL;
boolean configAlreadyRead = false;
unsigned int agpsStatus = 0;
loc_gps_cfg_s_type gps_conf;
loc_sap_cfg_s_type sap_conf;
@ -430,7 +431,7 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data)
//Send data disable to modem. This will be set to enable when
//an UPDATE_NETWORK_STATE event is received from Android
loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, NULL,
0, 0));
0, (agpsStatus ? 1:0)));
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
msg, loc_eng_free_msg);
}
@ -1242,6 +1243,14 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d
int available, const char* apn)
{
ENTRY_LOG_CALLFLOW();
//This is to store the status of data availability over the network.
//If GPS is not enabled, the INIT_CHECK will fail and the modem will
//not be updated with the network's availability. Since the data status
//can change before GPS is enabled the, storing the status will enable
//us to inform the modem after GPS is enabled
agpsStatus = available;
INIT_CHECK(loc_eng_data.context, return);
if (apn != NULL)
{