summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/contacts/CallLogProvider.java
diff options
context:
space:
mode:
authorFlavio Lerda <flerda@google.com>2011-11-15 01:06:01 +0000
committerFlavio Lerda <flerda@google.com>2011-11-15 02:11:02 +0000
commit9978b26dd17bb2b20b91101f1e4682604336b5f6 (patch)
tree976ff81699418e926eddda0589fafd20554a84d7 /src/com/android/providers/contacts/CallLogProvider.java
parentce77bbac15d59223403b778ef91aab7edbee629e (diff)
downloadpackages_providers_ContactsProvider-9978b26dd17bb2b20b91101f1e4682604336b5f6.zip
packages_providers_ContactsProvider-9978b26dd17bb2b20b91101f1e4682604336b5f6.tar.gz
packages_providers_ContactsProvider-9978b26dd17bb2b20b91101f1e4682604336b5f6.tar.bz2
Use integer constant when adding filtering clause.
Currently we are quoting an integer constant when generating the filtering clause that excludes voicemails from the set of calls returned to applications querying the default call log URI. Pass the integer to the helper function, so that we can avoid quoting. Change-Id: I1e460d2c8d3b04047cf4a1f4e1209b3e4ba5053b
Diffstat (limited to 'src/com/android/providers/contacts/CallLogProvider.java')
-rw-r--r--src/com/android/providers/contacts/CallLogProvider.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/com/android/providers/contacts/CallLogProvider.java b/src/com/android/providers/contacts/CallLogProvider.java
index 3c39625..89ae591 100644
--- a/src/com/android/providers/contacts/CallLogProvider.java
+++ b/src/com/android/providers/contacts/CallLogProvider.java
@@ -46,7 +46,7 @@ import java.util.HashMap;
public class CallLogProvider extends ContentProvider {
/** Selection clause to use to exclude voicemail records. */
private static final String EXCLUDE_VOICEMAIL_SELECTION = getInequalityClause(
- Calls.TYPE, Integer.toString(Calls.VOICEMAIL_TYPE));
+ Calls.TYPE, Calls.VOICEMAIL_TYPE);
private static final int CALLS = 1;
@@ -320,10 +320,9 @@ public class CallLogProvider extends ContentProvider {
* matches CALLS_ID. For other uri types the behaviour is undefined.
* @throws IllegalArgumentException if the id included in the Uri is not a valid long value.
*/
- private String parseCallIdFromUri(Uri uri) {
+ private long parseCallIdFromUri(Uri uri) {
try {
- Long id = Long.valueOf(uri.getPathSegments().get(1));
- return id.toString();
+ return Long.parseLong(uri.getPathSegments().get(1));
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Invalid call id in uri: " + uri, e);
}