OSDN Git Service

Fix notification of disconnected networks.
[android-x86/frameworks-base.git] / telephony / java / com / android / internal / telephony / gsm / GsmDataConnectionTracker.java
index cfb78d0..24e3fef 100644 (file)
@@ -1572,13 +1572,16 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
         if(DBG) log("EVENT_DISCONNECT_DONE connId=" + connId);
         if (ar.userObj instanceof ApnContext) {
             apnContext = (ApnContext) ar.userObj;
+        } else {
+            loge("Invalid ar in onDisconnectDone");
+            return;
         }
 
-        mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());
-
         apnContext.setState(State.IDLE);
         apnContext.setApnSetting(null);
 
+        mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());
+
         // if all data connection are gone, check whether Airplane mode request was
         // pending.
         if (!isConnected()) {