diff options
author | Mick Lin <Mick.Lin@mediatek.com> | 2015-01-29 21:15:10 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-29 21:15:10 +0000 |
commit | a248f0f15484f92e92f86b217031717f92277189 (patch) | |
tree | e00cf1ce941b43246ccdc32bb1e5f77d8022b438 | |
parent | 349d14f6cc482b30eb3258f0f97e4577440e4a29 (diff) | |
parent | cb184442b093c64416c93ef6f15d0d7dd7f7692c (diff) | |
download | Mms-a248f0f15484f92e92f86b217031717f92277189.tar.gz |
am cb184442: [DS] Correct the access method for telephony system property
* commit 'cb184442b093c64416c93ef6f15d0d7dd7f7692c':
[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) { |