diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-01-23 19:21:37 +0700 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-01-23 19:21:37 +0700 |
commit | db8816c642ec1c2fc91e8c979a07534214948110 (patch) | |
tree | beefe5ccc95486b2cb2832276abc4214a0886487 /src | |
parent | 75d2663a939fba0556e79946957ef3ddb7ad5d4b (diff) | |
download | frameworks_opt_telephony-db8816c642ec1c2fc91e8c979a07534214948110.zip frameworks_opt_telephony-db8816c642ec1c2fc91e8c979a07534214948110.tar.gz frameworks_opt_telephony-db8816c642ec1c2fc91e8c979a07534214948110.tar.bz2 |
SamsungExynos3RIL: fix unable to swtich 2G/3G while connected to wifi
When connected to wifi, the actual mobile network is not connected
but mobile data is reported as enabled, causing the code to try
and disconnect, which never happens since it's not connected in the
first place. Fix by checking if the network is connected instead of
if it's enabled.
Change-Id: I291b739a26fbf6c10917f195f80ea5044b6da03c
Diffstat (limited to 'src')
-rw-r--r-- | src/java/com/android/internal/telephony/SamsungExynos3RIL.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/java/com/android/internal/telephony/SamsungExynos3RIL.java b/src/java/com/android/internal/telephony/SamsungExynos3RIL.java index e4050ee..f7bd517 100644 --- a/src/java/com/android/internal/telephony/SamsungExynos3RIL.java +++ b/src/java/com/android/internal/telephony/SamsungExynos3RIL.java @@ -27,6 +27,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.ConnectivityManager; +import android.net.NetworkInfo; import android.os.Handler; import android.os.Message; import android.os.AsyncResult; @@ -872,8 +873,8 @@ public class SamsungExynos3RIL extends RIL implements CommandsInterface { ConnectivityManager cm = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE); - if(cm.getMobileDataEnabled()) - { + NetworkInfo.State mobileState = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState(); + if (mobileState == NetworkInfo.State.CONNECTED || mobileState == NetworkInfo.State.CONNECTING) { ConnectivityHandler handler = new ConnectivityHandler(mContext); handler.setPreferedNetworkType(networkType, response); } else { |