FP2-1927: T-mobile MMS issue
Query for mmsc is incomplete and can fetch wrong results.
JIRA ID:FPII-1927
Change-Id: I7946311782647898b344f3aa374b80ffcbe269d5
diff --git a/src/com/android/mms/transaction/TransactionSettings.java b/src/com/android/mms/transaction/TransactionSettings.java
index d0ecf0d..9305896 100644
--- a/src/com/android/mms/transaction/TransactionSettings.java
+++ b/src/com/android/mms/transaction/TransactionSettings.java
@@ -64,16 +64,15 @@
Log.v(TAG, "TransactionSettings: apnName: " + apnName +
"subId: " + subId);
}
- String selection = null;
+ String selection = Telephony.Carriers.CURRENT + " IS NOT NULL";
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);