am a248f0f1: am cb184442: [DS] Correct the access method for telephony system property
* commit 'a248f0f15484f92e92f86b217031717f92277189':
[DS] Correct the access method for telephony system property
diff --git a/src/com/android/mms/util/DownloadManager.java b/src/com/android/mms/util/DownloadManager.java
index b6d9f49..713dff8 100644
--- a/src/com/android/mms/util/DownloadManager.java
+++ b/src/com/android/mms/util/DownloadManager.java
@@ -35,6 +35,8 @@
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 @@
}
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) {