Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6cec0dc0 authored by Mike Lockwood's avatar Mike Lockwood Committed by Android Git Automerger
Browse files

am 32371695: Merge "GpsLocationProvider: Fix race condition while bringing up...

am 32371695: Merge "GpsLocationProvider: Fix race condition while bringing up APN for SUPL." into gingerbread

Merge commit '32371695' into gingerbread-plus-aosp

* commit '32371695':
  GpsLocationProvider: Fix race condition while bringing up APN for SUPL.
parents 8f05b5c8 32371695
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1171,6 +1171,9 @@ public class GpsLocationProvider implements LocationProviderInterface {
    private void reportAGpsStatus(int type, int status) {
        switch (status) {
            case GPS_REQUEST_AGPS_DATA_CONN:
                // 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);
                if (result == Phone.APN_ALREADY_ACTIVE) {
@@ -1179,11 +1182,13 @@ public class GpsLocationProvider implements LocationProviderInterface {
                        mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPEN;
                    } else {
                        Log.e(TAG, "mAGpsApn not set when receiving Phone.APN_ALREADY_ACTIVE");
                        mAGpsDataConnectionState = AGPS_DATA_CONNECTION_CLOSED;
                        native_agps_data_conn_failed();
                    }
                } else if (result == Phone.APN_REQUEST_STARTED) {
                    mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPENING;
                    // Nothing to do here
                } else {
                    mAGpsDataConnectionState = AGPS_DATA_CONNECTION_CLOSED;
                    native_agps_data_conn_failed();
                }
                break;