diff options
author | Mick Lin <Mick.Lin@mediatek.com> | 2015-01-29 21:20:24 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-29 21:20:24 +0000 |
commit | 39792bf53dadd41b71da8f87cfeb8a54817ff051 (patch) | |
tree | ab91dd827055333d0c7a80ed813831c3fe2552d6 | |
parent | 0d7db0e0961f25334f758cac9d4491ea20a04fec (diff) | |
parent | a248f0f15484f92e92f86b217031717f92277189 (diff) | |
download | Mms-39792bf53dadd41b71da8f87cfeb8a54817ff051.tar.gz |
am a248f0f1: am cb184442: [DS] Correct the access method for telephony system property
* commit 'a248f0f15484f92e92f86b217031717f92277189':
[DS] Correct the access method for telephony system property
-rw-r--r-- | src/com/android/mms/util/DownloadManager.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/com/android/mms/util/DownloadManager.java b/src/com/android/mms/util/DownloadManager.java index b6d9f497..713dff8b 100644 --- a/src/com/android/mms/util/DownloadManager.java +++ b/src/com/android/mms/util/DownloadManager.java @@ -35,6 +35,8 @@ import android.telephony.ServiceState; import android.util.Log; import android.widget.Toast; +import android.telephony.SubscriptionManager; +import android.telephony.TelephonyManager; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.telephony.TelephonyProperties; import com.android.mms.LogTag; @@ -178,13 +180,15 @@ public class DownloadManager { } static boolean isRoaming() { - // TODO: fix and put in Telephony layer - String roaming = SystemProperties.get( - TelephonyProperties.PROPERTY_OPERATOR_ISROAMING, null); - if (LOCAL_LOGV) { - Log.v(TAG, "roaming ------> " + roaming); + return isRoaming(SubscriptionManager.getDefaultSmsSubId()); + } + + static boolean isRoaming(int subId) { + TelephonyManager teleMgr = TelephonyManager.getDefault(); + if (teleMgr == null) { + return false; } - return "true".equals(roaming); + return teleMgr.isNetworkRoaming(subId); } public void markState(final Uri uri, int state) { |