diff options
author | Wink Saville <wink@google.com> | 2009-04-13 21:15:23 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2009-04-13 21:15:23 -0700 |
commit | 44038aa032ffd876f3c9b20a84db9d189f77e18e (patch) | |
tree | ae060ac7571ed8729dddd289cf81ddbf73719cee /telephony/java | |
parent | d5a9af45fff88be8bde35852f247e212f82e5e26 (diff) | |
download | frameworks_base-44038aa032ffd876f3c9b20a84db9d189f77e18e.zip frameworks_base-44038aa032ffd876f3c9b20a84db9d189f77e18e.tar.gz frameworks_base-44038aa032ffd876f3c9b20a84db9d189f77e18e.tar.bz2 |
Fix crash when mSST is null and change default to GSM.
Diffstat (limited to 'telephony/java')
-rw-r--r-- | telephony/java/com/android/internal/telephony/Phone.java | 2 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/PhoneFactory.java | 21 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/RIL.java | 14 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/RILConstants.java | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | telephony/java/com/android/internal/telephony/gsm/GSMPhone.java | 5 |
6 files changed, 25 insertions, 24 deletions
diff --git a/telephony/java/com/android/internal/telephony/Phone.java b/telephony/java/com/android/internal/telephony/Phone.java index ed90d32..62949b0 100644 --- a/telephony/java/com/android/internal/telephony/Phone.java +++ b/telephony/java/com/android/internal/telephony/Phone.java @@ -170,7 +170,7 @@ public interface Phone { int NT_MODE_EVDO_NO_CDMA = 6; /* EvDo only */ int NT_MODE_GLOBAL = 7; /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) AVAILABLE Application Settings menu*/ - int PREFERRED_NT_MODE = NT_MODE_GLOBAL; + int PREFERRED_NT_MODE = NT_MODE_GSM_ONLY; // Used for CDMA roaming mode diff --git a/telephony/java/com/android/internal/telephony/PhoneFactory.java b/telephony/java/com/android/internal/telephony/PhoneFactory.java index 3db0499..86e2f04 100644 --- a/telephony/java/com/android/internal/telephony/PhoneFactory.java +++ b/telephony/java/com/android/internal/telephony/PhoneFactory.java @@ -108,26 +108,23 @@ public class PhoneFactory { sCommandsInterface = new RIL(context, networkMode, cdmaSubscription); switch(networkMode) { - case RILConstants.NETWORK_MODE_WCDMA_PREF: - case RILConstants.NETWORK_MODE_GSM_ONLY: - case RILConstants.NETWORK_MODE_WCDMA_ONLY: - case RILConstants.NETWORK_MODE_GSM_UMTS: - sProxyPhone = new PhoneProxy(new GSMPhone(context, - sCommandsInterface, sPhoneNotifier)); - Log.i(LOG_TAG, "Creating GSMPhone"); - break; case RILConstants.NETWORK_MODE_CDMA: case RILConstants.NETWORK_MODE_CDMA_NO_EVDO: case RILConstants.NETWORK_MODE_EVDO_NO_CDMA: + case RILConstants.NETWORK_MODE_GLOBAL: sProxyPhone = new PhoneProxy(new CDMAPhone(context, sCommandsInterface, sPhoneNotifier)); Log.i(LOG_TAG, "Creating CDMAPhone"); break; - case RILConstants.NETWORK_MODE_GLOBAL: + case RILConstants.NETWORK_MODE_WCDMA_PREF: + case RILConstants.NETWORK_MODE_GSM_ONLY: + case RILConstants.NETWORK_MODE_WCDMA_ONLY: + case RILConstants.NETWORK_MODE_GSM_UMTS: default: - sProxyPhone = new PhoneProxy(new CDMAPhone(context, + sProxyPhone = new PhoneProxy(new GSMPhone(context, sCommandsInterface, sPhoneNotifier)); - Log.i(LOG_TAG, "Creating CDMAPhone"); + Log.i(LOG_TAG, "Creating GSMPhone"); + break; } sMadeDefaults = true; } @@ -160,5 +157,3 @@ public class PhoneFactory { } } } - - diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index f5d3b32..636a223 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -565,22 +565,18 @@ public final class RIL extends BaseCommands implements CommandsInterface { mNetworkMode = networkMode; //At startup mPhoneType is first set from networkMode switch(networkMode) { - case RILConstants.NETWORK_MODE_WCDMA_PREF: - case RILConstants.NETWORK_MODE_GSM_ONLY: - case RILConstants.NETWORK_MODE_WCDMA_ONLY: - case RILConstants.NETWORK_MODE_GSM_UMTS: - mPhoneType = RILConstants.GSM_PHONE; - break; case RILConstants.NETWORK_MODE_CDMA: case RILConstants.NETWORK_MODE_CDMA_NO_EVDO: case RILConstants.NETWORK_MODE_EVDO_NO_CDMA: - mPhoneType = RILConstants.CDMA_PHONE; - break; case RILConstants.NETWORK_MODE_GLOBAL: mPhoneType = RILConstants.CDMA_PHONE; break; + case RILConstants.NETWORK_MODE_WCDMA_PREF: + case RILConstants.NETWORK_MODE_GSM_ONLY: + case RILConstants.NETWORK_MODE_WCDMA_ONLY: + case RILConstants.NETWORK_MODE_GSM_UMTS: default: - mPhoneType = RILConstants.CDMA_PHONE; + mPhoneType = RILConstants.GSM_PHONE; } PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE); diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index 028aad7..9c63627 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -51,7 +51,7 @@ public interface RILConstants { int NETWORK_MODE_EVDO_NO_CDMA = 6; /* EvDo only */ int NETWORK_MODE_GLOBAL = 7; /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) AVAILABLE Application Settings menu*/ - int PREFERRED_NETWORK_MODE = NETWORK_MODE_GLOBAL; + int PREFERRED_NETWORK_MODE = NETWORK_MODE_GSM_ONLY; /* CDMA subscription source. See ril.h RIL_REQUEST_CDMA_SET_SUBSCRIPTION */ int SUBSCRIPTION_FROM_RUIM = 0; /* CDMA subscription from RUIM when available */ diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java index c139619..8ffb7ec 100644..100755 --- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java +++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java @@ -475,6 +475,11 @@ public class CDMAPhone extends PhoneBase { // we report data connected ret = DataState.CONNECTED; + } else if (mSST == null) { + // Radio Technology Change is ongoning, dispose() and removeReferences() have + // already been called + + ret = DataState.DISCONNECTED; } else if (mSST.getCurrentCdmaDataConnectionState() == ServiceState.RADIO_TECHNOLOGY_UNKNOWN) { // If we're out of service, open TCP sockets may still work diff --git a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java index d1ae997..a2d3c5e 100644..100755 --- a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java +++ b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java @@ -316,6 +316,11 @@ public class GSMPhone extends PhoneBase { // we report data connected ret = DataState.CONNECTED; + } else if (mSST == null) { + // Radio Technology Change is ongoning, dispose() and removeReferences() have + // already been called + + ret = DataState.DISCONNECTED; } else if (mSST.getCurrentGprsState() != ServiceState.STATE_IN_SERVICE) { // If we're out of service, open TCP sockets may still work |