Merge "Allow empty tokens in strict grammar" am: bd03ae8b86 am: 618efc989b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1414388 Change-Id: Ib4db14d7344f84383decf914fbeedf3c69384875
This commit is contained in:
@@ -98,6 +98,13 @@ public class CallLog {
|
|||||||
*/
|
*/
|
||||||
public static final String LIMIT_PARAM_KEY = "limit";
|
public static final String LIMIT_PARAM_KEY = "limit";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Form of {@link #CONTENT_URI} which limits the query results to a single result.
|
||||||
|
*/
|
||||||
|
private static final Uri CONTENT_URI_LIMIT_1 = CONTENT_URI.buildUpon()
|
||||||
|
.appendQueryParameter(LIMIT_PARAM_KEY, "1")
|
||||||
|
.build();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query parameter used to specify the starting record to return.
|
* Query parameter used to specify the starting record to return.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -932,11 +939,11 @@ public class CallLog {
|
|||||||
Cursor c = null;
|
Cursor c = null;
|
||||||
try {
|
try {
|
||||||
c = resolver.query(
|
c = resolver.query(
|
||||||
CONTENT_URI,
|
CONTENT_URI_LIMIT_1,
|
||||||
new String[] {NUMBER},
|
new String[] {NUMBER},
|
||||||
TYPE + " = " + OUTGOING_TYPE,
|
TYPE + " = " + OUTGOING_TYPE,
|
||||||
null,
|
null,
|
||||||
DEFAULT_SORT_ORDER + " LIMIT 1");
|
DEFAULT_SORT_ORDER);
|
||||||
if (c == null || !c.moveToFirst()) {
|
if (c == null || !c.moveToFirst()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user