am 32371695: Merge "GpsLocationProvider: Fix race condition while bringing up APN for SUPL." into gingerbread
Merge commit '32371695daf917701f78a86224b58bfda0381e27' into gingerbread-plus-aosp * commit '32371695daf917701f78a86224b58bfda0381e27': GpsLocationProvider: Fix race condition while bringing up APN for SUPL.
This commit is contained in:
@@ -1171,7 +1171,10 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
|||||||
private void reportAGpsStatus(int type, int status) {
|
private void reportAGpsStatus(int type, int status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case GPS_REQUEST_AGPS_DATA_CONN:
|
case GPS_REQUEST_AGPS_DATA_CONN:
|
||||||
int result = mConnMgr.startUsingNetworkFeature(
|
// Set mAGpsDataConnectionState before calling startUsingNetworkFeature
|
||||||
|
// to avoid a race condition with handleUpdateNetworkState()
|
||||||
|
mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPENING;
|
||||||
|
int result = mConnMgr.startUsingNetworkFeature(
|
||||||
ConnectivityManager.TYPE_MOBILE, Phone.FEATURE_ENABLE_SUPL);
|
ConnectivityManager.TYPE_MOBILE, Phone.FEATURE_ENABLE_SUPL);
|
||||||
if (result == Phone.APN_ALREADY_ACTIVE) {
|
if (result == Phone.APN_ALREADY_ACTIVE) {
|
||||||
if (mAGpsApn != null) {
|
if (mAGpsApn != null) {
|
||||||
@@ -1179,11 +1182,13 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
|||||||
mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPEN;
|
mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPEN;
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "mAGpsApn not set when receiving Phone.APN_ALREADY_ACTIVE");
|
Log.e(TAG, "mAGpsApn not set when receiving Phone.APN_ALREADY_ACTIVE");
|
||||||
|
mAGpsDataConnectionState = AGPS_DATA_CONNECTION_CLOSED;
|
||||||
native_agps_data_conn_failed();
|
native_agps_data_conn_failed();
|
||||||
}
|
}
|
||||||
} else if (result == Phone.APN_REQUEST_STARTED) {
|
} else if (result == Phone.APN_REQUEST_STARTED) {
|
||||||
mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPENING;
|
// Nothing to do here
|
||||||
} else {
|
} else {
|
||||||
|
mAGpsDataConnectionState = AGPS_DATA_CONNECTION_CLOSED;
|
||||||
native_agps_data_conn_failed();
|
native_agps_data_conn_failed();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user