summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2011-06-21 14:45:07 +0200
committerMartijn Coenen <maco@google.com>2011-06-21 14:45:07 +0200
commit5f0f9e9f2d3e8b73beaf49d542e10fdec6fa199b (patch)
tree7a953b90582ccc91ed83e9ab2c26c80d0928d3fd
parent87315f4cddec4c9bb09a48497c8b6bd65a8b99c7 (diff)
downloadandroid_frameworks_opt_vcard-5f0f9e9f2d3e8b73beaf49d542e10fdec6fa199b.tar.gz
android_frameworks_opt_vcard-5f0f9e9f2d3e8b73beaf49d542e10fdec6fa199b.tar.bz2
android_frameworks_opt_vcard-5f0f9e9f2d3e8b73beaf49d542e10fdec6fa199b.zip
Relax URI checking on VCardComposer.
URI may be extended with additional query parameters (e.g. user profile). Change-Id: Ie5ef1ca76709df26609960c12826668afb75ce21
-rw-r--r--java/com/android/vcard/VCardComposer.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/java/com/android/vcard/VCardComposer.java b/java/com/android/vcard/VCardComposer.java
index 7e0ade4..a2cb594 100644
--- a/java/com/android/vcard/VCardComposer.java
+++ b/java/com/android/vcard/VCardComposer.java
@@ -41,6 +41,7 @@ import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.RawContacts;
import android.provider.ContactsContract.RawContactsEntity;
+import android.provider.ContactsContract;
import android.text.TextUtils;
import android.util.Log;
@@ -362,11 +363,12 @@ public class VCardComposer {
public boolean init(final Uri contentUri, final String[] projection,
final String selection, final String[] selectionArgs,
final String sortOrder, Uri contentUriForRawContactsEntity) {
- if (!Contacts.CONTENT_URI.equals(contentUri)) {
+ if (!ContactsContract.AUTHORITY.equals(contentUri.getAuthority())) {
if (DEBUG) Log.d(LOG_TAG, "Unexpected contentUri: " + contentUri);
mErrorReason = FAILURE_REASON_UNSUPPORTED_URI;
return false;
}
+
if (!initInterFirstPart(contentUriForRawContactsEntity)) {
return false;
}
@@ -413,7 +415,6 @@ public class VCardComposer {
mCursorSuppliedFromOutside = false;
mCursor = mContentResolver.query(
contentUri, projection, selection, selectionArgs, sortOrder);
-
if (mCursor == null) {
Log.e(LOG_TAG, String.format("Cursor became null unexpectedly"));
mErrorReason = FAILURE_REASON_FAILED_TO_GET_DATABASE_INFO;