summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSusheel nyamala <snyamala@codeaurora.org>2015-05-11 18:21:58 +0530
committerdoc HD <doc.divxm@gmail.com>2015-09-04 00:04:38 +0300
commit2a287b7ef68eb38e0951976e0cdc960764de42e5 (patch)
treecbed1920004f618b679c83f826f718af715567bd
parentcd253495b97ee61b22411abe3bf9f9a31b7238e8 (diff)
Fix mms failures due to invalid mmsc url
There is an issue with current sqlite query which gets mmsc url from mms apn. When there are multiple apn entries sharing same apn, the first matching mms apn will be returned for which mmsc url is not always correct. Modify sqlite query to extract active apn which will have correct mmsc url. CRs-Fixed: 825747 Ref: CYNGNOS-900 Change-Id: I6aea5be268014fa0d2a35e99ae5a67a93e7dce34
-rw-r--r--src/com/android/mms/transaction/TransactionSettings.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/mms/transaction/TransactionSettings.java b/src/com/android/mms/transaction/TransactionSettings.java
index b099d5bf..ab5f808f 100644
--- a/src/com/android/mms/transaction/TransactionSettings.java
+++ b/src/com/android/mms/transaction/TransactionSettings.java
@@ -23,6 +23,7 @@ import android.database.sqlite.SqliteWrapper;
import android.net.NetworkUtils;
import android.net.Uri;
import android.provider.Telephony;
+import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
@@ -64,16 +65,15 @@ public class TransactionSettings {
Log.v(TAG, "TransactionSettings: apnName: " + apnName +
"subId: " + subId);
}
- String selection = null;
+ String numeric = TelephonyManager.getDefault().getIccOperatorNumeric(subId);
+ String selection = "numeric=" + numeric;
String[] selectionArgs = null;
- Uri contentUri = Telephony.Carriers.CONTENT_URI;
+ Uri contentUri = Uri.withAppendedPath(Telephony.Carriers.CONTENT_URI, "/subId/" + subId);
if (!TextUtils.isEmpty(apnName)) {
- selection = Telephony.Carriers.APN + "=?";
+ selection += " AND " + Telephony.Carriers.APN + "=?";
selectionArgs = new String[]{ apnName.trim() };
- } else {
- contentUri = Uri.withAppendedPath(contentUri, "/subId/" + subId);
}
-
+ Log.d(TAG, "Selection: " + selection);
Cursor cursor = SqliteWrapper.query(context, context.getContentResolver(),
contentUri, APN_PROJECTION, selection, selectionArgs,
null);