diff options
author | Flavio Lerda <flerda@google.com> | 2011-06-29 10:54:29 +0100 |
---|---|---|
committer | Flavio Lerda <flerda@google.com> | 2011-06-29 17:57:03 +0100 |
commit | 92d97071e56110e0df7f25e6ebc92ff4ebf74a88 (patch) | |
tree | c10d82fe895fb7cc365821a2c438d8ef673e25d0 /src | |
parent | 7d7d0e95636344c01eb4e4d034791c199bee98e9 (diff) | |
download | packages_providers_ContactsProvider-92d97071e56110e0df7f25e6ebc92ff4ebf74a88.zip packages_providers_ContactsProvider-92d97071e56110e0df7f25e6ebc92ff4ebf74a88.tar.gz packages_providers_ContactsProvider-92d97071e56110e0df7f25e6ebc92ff4ebf74a88.tar.bz2 |
Use shared constants for call log with voicemails.
Use the shared constants for accessing voicemails in the call log.
Remove the local copies in the content provider.
Change-Id: I1c026ab604201b73e4f6a057a8b725479c72c796
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/providers/contacts/CallLogProvider.java | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/com/android/providers/contacts/CallLogProvider.java b/src/com/android/providers/contacts/CallLogProvider.java index b07a56d..c0f8644 100644 --- a/src/com/android/providers/contacts/CallLogProvider.java +++ b/src/com/android/providers/contacts/CallLogProvider.java @@ -21,7 +21,6 @@ import static com.android.providers.contacts.util.DbQueryUtils.getEqualityClause import static com.android.providers.contacts.util.DbQueryUtils.getInequalityClause; import com.android.providers.contacts.ContactsDatabaseHelper.Tables; -import com.android.providers.contacts.util.DbQueryUtils; import com.android.providers.contacts.util.SelectionBuilder; import android.content.ContentProvider; @@ -36,38 +35,13 @@ import android.database.sqlite.SQLiteQueryBuilder; import android.net.Uri; import android.provider.CallLog; import android.provider.CallLog.Calls; -import android.provider.ContactsContract; -import android.util.Log; import java.util.HashMap; -import java.util.Set; /** * Call log content provider. */ public class CallLogProvider extends ContentProvider { - - /** - * An optional URI parameter for call_log operations which instructs the - * provider to allow the operation to be applied to voicemail records as well. - * <p> TYPE: Boolean - * - * <p> Using this parameter with a value true will result in a security - * error if the calling application does not have appropriate permissions - * to access voicemails. - */ - // TODO: Move this to ContactsContract.Calls once we are happy with the changes. - public static final String ALLOW_VOICEMAILS_PARAM_KEY = "allow_voicemails"; - - /** - * Content uri with {@link #ALLOW_VOICEMAILS_PARAM_KEY} set. This can directly - * be used to access call log entries that includes voicemail records. - */ - // TODO: Move this to ContactsContract.Calls once we are happy with the changes. - public static Uri CONTENT_URI_WITH_VOICEMAIL = Calls.CONTENT_URI.buildUpon() - .appendQueryParameter(CallLogProvider.ALLOW_VOICEMAILS_PARAM_KEY, "true") - .build(); - /** Selection clause to use to exclude voicemail records. */ private static final String EXCLUDE_VOICEMAIL_SELECTION = getInequalityClause( Calls.TYPE, Integer.toString(Calls.VOICEMAIL_TYPE)); @@ -297,7 +271,7 @@ public class CallLogProvider extends ContentProvider { * included. */ private boolean isAllowVoicemailRequest(Uri uri) { - return uri.getBooleanQueryParameter(ALLOW_VOICEMAILS_PARAM_KEY, false); + return uri.getBooleanQueryParameter(Calls.ALLOW_VOICEMAILS_PARAM_KEY, false); } /** @@ -310,7 +284,8 @@ public class CallLogProvider extends ContentProvider { if (!isAllowVoicemailRequest(uri)) { throw new IllegalArgumentException( String.format("Uri %s cannot be used for voicemail record." + - " Please set '%s=true' in the uri.", uri, ALLOW_VOICEMAILS_PARAM_KEY)); + " Please set '%s=true' in the uri.", uri, + Calls.ALLOW_VOICEMAILS_PARAM_KEY)); } } |