summaryrefslogtreecommitdiff
path: root/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-09-25 17:12:58 -0700
committerAndrew Lee <anwlee@google.com>2015-10-02 15:40:03 -0700
commit838988bf34229b33ed39bb7dc7109427da264c81 (patch)
treeea1bd2be21aaa0cc9d5c72516793cfd5ec27a0fd /tests/src/com/android/dialer/calllog/CallLogAdapterTest.java
parent071d0a4f1c8cf6b6131b7aeabfd2c6b0560b413f (diff)
Add BLOCKED call type and util to mark in call log.
To support call blocking, added BLOCKED call type. Also added utility to be able to mark the most recent call from a number as BLOCKEd in the call log database. Added REJECTED call type as well. This is not presently used within our application, but we want to reserve the integer, anticipating changes in the framework to add this constant. Introduced AppCompConstants, because BLOCKED and REJECTED call type values will not be defined as part of the API on M devices. Change existing call type constants to reference this compatability class. Bug: 24341350 Change-Id: I523ebd8dd1844a3b71a69a14bd38073be5940804
Diffstat (limited to 'tests/src/com/android/dialer/calllog/CallLogAdapterTest.java')
-rw-r--r--tests/src/com/android/dialer/calllog/CallLogAdapterTest.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java b/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java
index 83d098fc5..3a79695be 100644
--- a/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java
+++ b/tests/src/com/android/dialer/calllog/CallLogAdapterTest.java
@@ -35,6 +35,7 @@ import android.view.View;
import com.android.dialer.contactinfo.ContactInfoCache;
import com.android.dialer.contactinfo.ContactInfoCache.OnContactInfoChangedListener;
+import com.android.dialer.util.AppCompatConstants;
import com.android.dialer.util.TestConstants;
import com.google.common.collect.Lists;
@@ -344,7 +345,7 @@ public class CallLogAdapterTest extends AndroidTestCase {
public void testBindView_UriNumber() {
createCallLogEntryWithCachedValues(
"sip:johndoe@gmail.com",
- Calls.INCOMING_TYPE,
+ AppCompatConstants.CALLS_INCOMING_TYPE,
"John Doe",
Phone.TYPE_HOME,
TEST_DEFAULT_CUSTOM_LABEL,
@@ -404,7 +405,7 @@ public class CallLogAdapterTest extends AndroidTestCase {
public void testBindView_NumberOnlyDbCachedFormattedNumber() {
createCallLogEntryWithCachedValues(
TEST_NUMBER,
- Calls.INCOMING_TYPE,
+ AppCompatConstants.CALLS_INCOMING_TYPE,
EMPTY_STRING,
TEST_CACHED_NUMBER_TYPE,
TEST_CACHED_NUMBER_LABEL,
@@ -454,11 +455,17 @@ public class CallLogAdapterTest extends AndroidTestCase {
}
private void createPrivateCallLogEntry() {
- createCallLogEntry(EMPTY_STRING, Calls.PRESENTATION_RESTRICTED, Calls.INCOMING_TYPE);
+ createCallLogEntry(
+ EMPTY_STRING,
+ Calls.PRESENTATION_RESTRICTED,
+ AppCompatConstants.CALLS_INCOMING_TYPE);
}
private void createUnknownCallLogEntry() {
- createCallLogEntry(EMPTY_STRING, Calls.PRESENTATION_UNKNOWN, Calls.INCOMING_TYPE);
+ createCallLogEntry(
+ EMPTY_STRING,
+ Calls.PRESENTATION_UNKNOWN,
+ AppCompatConstants.CALLS_INCOMING_TYPE);
}
private void createVoicemailCallLogEntry() {
@@ -499,7 +506,7 @@ public class CallLogAdapterTest extends AndroidTestCase {
* It includes the values for the cached contact associated with the number.
*
* @param number The phone number.
- * @param type Either Call.OUTGOING_TYPE or Call.INCOMING_TYPE or Call.MISSED_TYPE.
+ * @param type Valid value of {@code Calls.TYPE}.
* @param cachedName The name of the contact with this number
* @param cachedNumberType The type of the number, from the contact with this number.
* @param cachedNumberLabel The label of the number, from the contact with this number.
@@ -555,7 +562,7 @@ public class CallLogAdapterTest extends AndroidTestCase {
if (type != NO_VALUE_SET) {
values[CallLogQuery.CALL_TYPE] = type;
}
- if (type == Calls.VOICEMAIL_TYPE) {
+ if (type == AppCompatConstants.CALLS_VOICEMAIL_TYPE) {
values[CallLogQuery.VOICEMAIL_URI] = ContentUris.withAppendedId(
VoicemailContract.Voicemails.CONTENT_URI, mCursor.getCount());
}