diff options
author | Yorke Lee <yorkelee@google.com> | 2014-07-23 14:05:31 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2014-07-24 12:51:56 -0700 |
commit | 8cd9423bd04584acbcbf178bf6a1c1953debb8da (patch) | |
tree | 68c75d919a5688ee061f81550a3df348a455c6ef /tests | |
parent | a396b7a4d2f9074b57abd6ebdc6e1654d84383e1 (diff) |
Add voicemail transcriptions to Dialer
* Display voicemail transcriptions in the call log and call details
activity in the Dialer
* Fix a bug in CallDetailActivity that would result in multiple instances of VoicemailPlaybackFragment being added on rotation. Now, reuse the same fragment
if it is already present in the FragmentManager, to avoid creating new ones
* Simplify some test and ctor logic in PhoneCallDetails to reduce the pain
of adding new fields into PhoneCallDetails
* Simplified playback_layout.xml to remove unnecessary parent LinearLayouts
Bug: 16320164
Change-Id: Ie68acc9058aace49d8e64f44a0128de0b6a3f842
Diffstat (limited to 'tests')
3 files changed, 27 insertions, 43 deletions
diff --git a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java index d0c13eeb6..569da5414 100644 --- a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java +++ b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java @@ -312,7 +312,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { new PhoneCallDetails(number, presentation, formattedNumber, TEST_COUNTRY_ISO, TEST_GEOCODE, new int[]{ Calls.VOICEMAIL_TYPE }, TEST_DATE, TEST_DURATION, null, - Calls.FEATURES_NONE, null) + Calls.FEATURES_NONE, null, null) ); } @@ -323,7 +323,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { new PhoneCallDetails(number, Calls.PRESENTATION_ALLOWED, formattedNumber, TEST_COUNTRY_ISO, geocodedLocation, new int[]{ Calls.VOICEMAIL_TYPE }, TEST_DATE, TEST_DURATION, null, - Calls.FEATURES_NONE, null) + Calls.FEATURES_NONE, null, null) ); } @@ -332,8 +332,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, null, - Calls.FEATURES_NONE, null) + new int[]{ Calls.INCOMING_TYPE }, date, TEST_DURATION) ); } @@ -342,7 +341,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, null, Calls.FEATURES_NONE, null) + callTypes, TEST_DATE, TEST_DURATION) ); } @@ -354,7 +353,7 @@ 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, null, - features, null) + features, null, null) ); } @@ -363,7 +362,7 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { new PhoneCallDetails(number, presentation, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE, new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION, null, - Calls.FEATURES_NONE, null)); + Calls.FEATURES_NONE, null, null)); } private void setCallDetailsHeader(String name) { @@ -371,6 +370,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, null, Calls.FEATURES_NONE, null)); + name, 0, "", null, null, 0, null, Calls.FEATURES_NONE, null, null)); } } diff --git a/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java b/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java index 4c9d92cfc..52f2544c8 100644 --- a/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java @@ -128,8 +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, null, Calls.FEATURES_NONE, - null); + new int[]{Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION); assertEquals(R.string.description_incoming_answered_call, mHelper.getCallDescriptionStringID(details)); } @@ -141,8 +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, null, Calls.FEATURES_NONE, - null); + new int[]{Calls.MISSED_TYPE}, TEST_DATE, TEST_DURATION); assertEquals(R.string.description_incoming_missed_call, mHelper.getCallDescriptionStringID(details)); } @@ -154,8 +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, null, - Calls.FEATURES_NONE, null); + new int[]{Calls.VOICEMAIL_TYPE}, TEST_DATE, TEST_DURATION); assertEquals(R.string.description_incoming_missed_call, mHelper.getCallDescriptionStringID(details)); } @@ -168,8 +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, null, Calls.FEATURES_NONE, - null); + new int[]{Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION); assertEquals(R.string.description_incoming_answered_call, mHelper.getCallDescriptionStringID(details)); } @@ -182,8 +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, null, Calls.FEATURES_NONE, - null); + new int[]{Calls.MISSED_TYPE}, TEST_DATE, TEST_DURATION); assertEquals(R.string.description_incoming_missed_call, mHelper.getCallDescriptionStringID(details)); } @@ -196,8 +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, null, - Calls.FEATURES_NONE, null); + new int[]{Calls.VOICEMAIL_TYPE}, TEST_DATE, TEST_DURATION); assertEquals(R.string.description_incoming_missed_call, mHelper.getCallDescriptionStringID(details)); } @@ -211,8 +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, null, Calls.FEATURES_NONE, - null); + new int[]{Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); assertEquals(R.string.description_outgoing_call, mHelper.getCallDescriptionStringID(details)); } @@ -226,8 +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, null, - Calls.FEATURES_NONE, null); + new int[]{Calls.OUTGOING_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); assertEquals(R.string.description_outgoing_call, mHelper.getCallDescriptionStringID(details)); } @@ -240,8 +232,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, - null, Calls.FEATURES_NONE, null); + new int[]{Calls.OUTGOING_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); CharSequence description = mHelper.getCallDescription(details); assertFalse(description.toString() .contains(this.mResources.getString(R.string.description_new_voicemail))); @@ -255,8 +246,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, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION, - null, Calls.FEATURES_NONE, null); + new int[]{Calls.INCOMING_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); CharSequence description = mHelper.getCallDescription(details); assertFalse(description.toString() .contains(this.mResources.getString(R.string.description_new_voicemail))); @@ -270,8 +260,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, null, - Calls.FEATURES_NONE, null); + new int[]{Calls.MISSED_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); CharSequence description = mHelper.getCallDescription(details); assertFalse(description.toString() .contains(this.mResources.getString(R.string.description_new_voicemail))); @@ -285,8 +274,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, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION, - null, Calls.FEATURES_NONE, null); + new int[]{Calls.VOICEMAIL_TYPE, Calls.OUTGOING_TYPE}, TEST_DATE, TEST_DURATION); CharSequence description = mHelper.getCallDescription(details); assertTrue(description.toString() .contains(this.mResources.getString(R.string.description_new_voicemail))); @@ -300,8 +288,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, null, - Calls.FEATURES_NONE, null); + new int[]{Calls.VOICEMAIL_TYPE}, TEST_DATE, TEST_DURATION); CharSequence description = mHelper.getCallDescription(details); // Rather than hard coding the "X calls" string message, we'll generate it with an empty @@ -320,8 +307,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, Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION, - null, Calls.FEATURES_NONE, null); + new int[]{Calls.VOICEMAIL_TYPE, Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION); CharSequence description = mHelper.getCallDescription(details); assertTrue(description.toString() .contains(this.mResources.getString(R.string.description_num_calls, 2))); @@ -335,8 +321,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, Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION, - null, Calls.FEATURES_VIDEO, null); + new int[]{Calls.INCOMING_TYPE, Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION); CharSequence description = mHelper.getCallDescription(details); assertTrue(description.toString() .contains(this.mResources.getString(R.string.description_video_call, 2))); @@ -362,8 +347,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, null, Calls.FEATURES_NONE, - null) + new int[]{ callType }, TEST_DATE, TEST_DURATION) ); } @@ -372,7 +356,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, null, Calls.FEATURES_NONE, null) + types, TEST_DATE, TEST_DURATION) ); } @@ -381,7 +365,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, null, Calls.FEATURES_NONE, null) + types, TEST_DATE, TEST_DURATION) ); } } diff --git a/tests/src/com/android/dialer/calllog/CallLogQueryTestUtils.java b/tests/src/com/android/dialer/calllog/CallLogQueryTestUtils.java index dc3f525d8..2f7d212ed 100644 --- a/tests/src/com/android/dialer/calllog/CallLogQueryTestUtils.java +++ b/tests/src/com/android/dialer/calllog/CallLogQueryTestUtils.java @@ -29,7 +29,8 @@ public class CallLogQueryTestUtils { public static Object[] createTestValues() { Object[] values = new Object[]{ 0L, "", 0L, 0L, Calls.INCOMING_TYPE, "", "", "", null, 0, null, null, null, null, - 0L, null, 0, Calls.PRESENTATION_ALLOWED, null, null, Calls.FEATURES_NONE, null + 0L, null, 0, Calls.PRESENTATION_ALLOWED, null, null, Calls.FEATURES_NONE, null, + null }; assertEquals(CallLogQuery._PROJECTION.length, values.length); return values; |