diff options
author | Nancy Chen <nancychen@google.com> | 2014-06-11 17:56:07 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2014-06-26 16:21:15 -0700 |
commit | 87ba489564b25d4a64c9faaeafea46e2f72d8933 (patch) | |
tree | 15d3eb5c9865eb1bc4c3244d3277c3ea7ab23a3b /tests/src | |
parent | 8a80d19f88d224f1427d7656e361eb77e1f90974 (diff) |
Add icon indicating subscription in call log/call history
Display an icon in the call details showing which connection provider
(subscription) is responsible for the call.
Bug: 15473965
Change-Id: I0c6755864083799b8bafe20c3692b0d943beeee3
Diffstat (limited to 'tests/src')
3 files changed, 48 insertions, 24 deletions
diff --git a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java index 679335e57..ae4759668 100644 --- a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java +++ b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java @@ -290,7 +290,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { mHelper.setPhoneCallDetails(mViews, new PhoneCallDetails(number, presentation, formattedNumber, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{ Calls.VOICEMAIL_TYPE }, TEST_DATE, TEST_DURATION) + new int[]{ Calls.VOICEMAIL_TYPE }, TEST_DATE, TEST_DURATION, null) ); } @@ -300,7 +300,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { mHelper.setPhoneCallDetails(mViews, new PhoneCallDetails(number, Calls.PRESENTATION_ALLOWED, formattedNumber, TEST_COUNTRY_ISO, geocodedLocation, - new int[]{ Calls.VOICEMAIL_TYPE }, TEST_DATE, TEST_DURATION) + new int[]{ Calls.VOICEMAIL_TYPE }, TEST_DATE, TEST_DURATION, null) ); } @@ -309,7 +309,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { mHelper.setPhoneCallDetails(mViews, new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{ Calls.INCOMING_TYPE }, date, TEST_DURATION) + new int[]{ Calls.INCOMING_TYPE }, date, TEST_DURATION, null) ); } @@ -318,7 +318,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { mHelper.setPhoneCallDetails(mViews, new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - callTypes, TEST_DATE, TEST_DURATION) + callTypes, TEST_DATE, TEST_DURATION, null) ); } @@ -326,7 +326,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { mHelper.setCallDetailsHeader(mNameView, new PhoneCallDetails(number, presentation, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION)); + new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION, null)); } private void setCallDetailsHeader(String name) { @@ -334,6 +334,6 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION, - name, 0, "", null, null, 0)); + name, 0, "", null, null, 0, null)); } } diff --git a/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java b/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java index 96eefbc5d..ae76157f3 100644 --- a/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java @@ -128,7 +128,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { public void testGetCallDescriptionID_UnknownAnswered() { PhoneCallDetails details = new PhoneCallDetails("", Calls.PRESENTATION_UNKNOWN, "", TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION, null); assertEquals(R.string.description_incoming_answered_call, mHelper.getCallDescriptionStringID(details)); } @@ -140,7 +140,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { public void testGetCallDescriptionID_UnknownMissed() { PhoneCallDetails details = new PhoneCallDetails("", Calls.PRESENTATION_UNKNOWN, "", TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.MISSED_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.MISSED_TYPE}, TEST_DATE, TEST_DURATION, null); assertEquals(R.string.description_incoming_missed_call, mHelper.getCallDescriptionStringID(details)); } @@ -152,7 +152,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { public void testGetCallDescriptionID_UnknownVoicemail() { PhoneCallDetails details = new PhoneCallDetails("", Calls.PRESENTATION_UNKNOWN, "", TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.VOICEMAIL_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.VOICEMAIL_TYPE}, TEST_DATE, TEST_DURATION, null); assertEquals(R.string.description_incoming_missed_call, mHelper.getCallDescriptionStringID(details)); } @@ -165,7 +165,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION, null); assertEquals(R.string.description_incoming_answered_call, mHelper.getCallDescriptionStringID(details)); } @@ -178,7 +178,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.MISSED_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.MISSED_TYPE}, TEST_DATE, TEST_DURATION, null); assertEquals(R.string.description_incoming_missed_call, mHelper.getCallDescriptionStringID(details)); } @@ -191,7 +191,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.VOICEMAIL_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.VOICEMAIL_TYPE}, TEST_DATE, TEST_DURATION, null); assertEquals(R.string.description_incoming_missed_call, mHelper.getCallDescriptionStringID(details)); } @@ -205,7 +205,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION, null); assertEquals(R.string.description_outgoing_call, mHelper.getCallDescriptionStringID(details)); } @@ -219,7 +219,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.OUTGOING_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.OUTGOING_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION, null); assertEquals(R.string.description_outgoing_call, mHelper.getCallDescriptionStringID(details)); } @@ -232,7 +232,8 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.OUTGOING_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.OUTGOING_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION, + null); CharSequence description = mHelper.getCallDescription(details); assertFalse(description.toString() .contains(this.mResources.getString(R.string.description_new_voicemail))); @@ -246,7 +247,8 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.INCOMING_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.INCOMING_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION, + null); CharSequence description = mHelper.getCallDescription(details); assertFalse(description.toString() .contains(this.mResources.getString(R.string.description_new_voicemail))); @@ -260,7 +262,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.MISSED_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.MISSED_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION, null); CharSequence description = mHelper.getCallDescription(details); assertFalse(description.toString() .contains(this.mResources.getString(R.string.description_new_voicemail))); @@ -274,7 +276,8 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.VOICEMAIL_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.VOICEMAIL_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION, + null); CharSequence description = mHelper.getCallDescription(details); assertTrue(description.toString() .contains(this.mResources.getString(R.string.description_new_voicemail))); @@ -288,7 +291,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.VOICEMAIL_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.VOICEMAIL_TYPE}, TEST_DATE, TEST_DURATION, null); CharSequence description = mHelper.getCallDescription(details); // Rather than hard coding the "X calls" string message, we'll generate it with an empty @@ -307,7 +310,8 @@ public class CallLogListItemHelperTest extends AndroidTestCase { PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{Calls.VOICEMAIL_TYPE, Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION); + new int[]{Calls.VOICEMAIL_TYPE, Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION, + null); CharSequence description = mHelper.getCallDescription(details); assertTrue(description.toString() .contains(this.mResources.getString(R.string.description_num_calls, 2))); @@ -333,7 +337,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { mHelper.setPhoneCallDetails(mViews, new PhoneCallDetails(number, presentation, formattedNumber, TEST_COUNTRY_ISO, TEST_GEOCODE, - new int[]{ callType }, TEST_DATE, TEST_DURATION) + new int[]{ callType }, TEST_DATE, TEST_DURATION, null) ); } @@ -342,7 +346,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { mHelper.setPhoneCallDetails(mViews, new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - types, TEST_DATE, TEST_DURATION) + types, TEST_DATE, TEST_DURATION, null) ); } @@ -351,7 +355,7 @@ public class CallLogListItemHelperTest extends AndroidTestCase { mHelper.setPhoneCallDetails(mViews, new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, - types, TEST_DATE, TEST_DURATION) + types, TEST_DATE, TEST_DURATION, null) ); } } diff --git a/tests/src/com/android/dialer/tests/calllog/FillCallLogTestActivity.java b/tests/src/com/android/dialer/tests/calllog/FillCallLogTestActivity.java index 1e5c25742..e12a2a2aa 100644 --- a/tests/src/com/android/dialer/tests/calllog/FillCallLogTestActivity.java +++ b/tests/src/com/android/dialer/tests/calllog/FillCallLogTestActivity.java @@ -31,6 +31,8 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.RemoteException; import android.provider.CallLog.Calls; +import android.telecomm.Subscription; +import android.telephony.TelephonyManager; import android.text.format.DateFormat; import android.util.Log; import android.view.View; @@ -47,6 +49,7 @@ import android.widget.Toast; import com.android.dialer.tests.R; import java.util.Calendar; +import java.util.List; import java.util.Random; /** @@ -83,6 +86,8 @@ public class FillCallLogTestActivity extends Activity { private int mCallDateYear; private int mCallDateMonth; private int mCallDateDay; + private RadioButton mSubscription0; + private RadioButton mSubscription1; @Override protected void onCreate(Bundle savedInstanceState) { @@ -127,6 +132,8 @@ public class FillCallLogTestActivity extends Activity { mCallDate = (TextView) findViewById(R.id.call_date); mPhoneNumber = (TextView) findViewById(R.id.phone_number); mOffset = (EditText) findViewById(R.id.delta_after_add); + mSubscription0 = (RadioButton) findViewById(R.id.subscription0); + mSubscription1 = (RadioButton) findViewById(R.id.subscription1); // Use the current time as the default values for the picker final Calendar c = Calendar.getInstance(); @@ -388,6 +395,18 @@ public class FillCallLogTestActivity extends Activity { } } + private Subscription getManualSubscription() { + TelephonyManager telephonyManager = new TelephonyManager(this); + List <Subscription> subscriptions = telephonyManager.getSubscriptions(); + if (mSubscription0.isChecked()) { + return subscriptions.get(0); + } else if (mSubscription1.isChecked()){ + return subscriptions.get(1); + } else { + return null; + } + } + /** * Shows a time picker dialog, storing the results in the time field. */ @@ -470,7 +489,8 @@ public class FillCallLogTestActivity extends Activity { dateTime.set(mCallDateYear, mCallDateMonth, mCallDateDay, mCallTimeHour, mCallTimeMinute); Calls.addCall(null, this, mPhoneNumber.getText().toString(), getManualPresentation(), - getManualCallType(), dateTime.getTimeInMillis(), RNG.nextInt(60 * 60)); + getManualCallType(), getManualSubscription(), dateTime.getTimeInMillis(), + RNG.nextInt(60 * 60)); // Subtract offset from the call date/time and store as new date/time int offset = Integer.parseInt(mOffset.getText().toString()); |