We need READ_CALL_LOG if targetSDK is > 15. What a drag.

This commit is contained in:
Moxie Marlinspike 2012-11-20 19:09:46 -08:00
parent c66e221598
commit 80a6c65790
2 changed files with 5 additions and 3 deletions

View File

@ -29,6 +29,7 @@
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<application android:icon="@drawable/icon" <application android:icon="@drawable/icon"
android:label="@string/app_name" android:label="@string/app_name"

View File

@ -429,9 +429,10 @@ public class MmsDatabase extends Database {
public Cursor getCarrierMmsInformation(String apn) { public Cursor getCarrierMmsInformation(String apn) {
Uri uri = Uri.withAppendedPath(Uri.parse("content://telephony/carriers"), "current"); Uri uri = Uri.withAppendedPath(Uri.parse("content://telephony/carriers"), "current");
String selection = (apn == null || apn.trim().length() == 0) ? null : String.format("apn = '%s'", apn.trim()); String selection = (apn == null || apn.trim().length() == 0) ? null : "apn = ?";
String[] selectionArgs = (apn == null || apn.trim().length() == 0) ? null : new String[] {apn.trim()};
return context.getContentResolver().query(uri, null, selection, null, null); return context.getContentResolver().query(uri, null, selection, selectionArgs, null);
} }
private PduHeaders getHeadersForId(long messageId) throws MmsException { private PduHeaders getHeadersForId(long messageId) throws MmsException {