From 1aac25187ff3dca0856177559ff15c670208e775 Mon Sep 17 00:00:00 2001 From: Ramesh Sudini Date: Sat, 16 Apr 2011 04:54:09 -0700 Subject: [PATCH] Telephony: GDCT - Set enabled state before notification is sent out. Change-Id: I6e84920b8d082fd6da838bccb5333051362bc4bc --- .../gsm/GsmDataConnectionTracker.java | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index 1d0e0fc7d3f78..8c836b317aa5e 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -509,16 +509,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { return false; } - protected boolean isEnabled(String apnType) { - ApnContext apnContext = mApnContexts.get(apnType); - if (apnContext == null) return false; - if (apnContext.getState() == State.DISCONNECTING - && apnContext.getPendingAction() == ApnContext.PENDING_ACTION_APN_DISABLE) { - return false; - } - return true; - } - /** * Report on whether data connectivity is enabled for any APN. * @return {@code false} if data connectivity has been explicitly disabled, @@ -1583,6 +1573,12 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType()); + // Check if APN disabled. + if (apnContext.getPendingAction() == ApnContext.PENDING_ACTION_APN_DISABLE) { + apnContext.setEnabled(false); + apnContext.setPendingAction(ApnContext.PENDING_ACTION_NONE); + } + // if all data connection are gone, check whether Airplane mode request was // pending. if (!isConnected()) { @@ -1592,12 +1588,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { } } - // Check if APN disabled. - if (apnContext.getPendingAction() == ApnContext.PENDING_ACTION_APN_DISABLE) { - apnContext.setEnabled(false); - apnContext.setPendingAction(ApnContext.PENDING_ACTION_NONE); - } - if (TextUtils.equals(apnContext.getApnType(), Phone.APN_TYPE_DEFAULT) && retryAfterDisconnected(apnContext.getReason())) { SystemProperties.set("gsm.defaultpdpcontext.active", "false");