From e89e0f58b5e6159a76baebc1b4e0b5063007e467 Mon Sep 17 00:00:00 2001 From: weijiaxu Date: Fri, 18 Aug 2017 14:03:30 -0700 Subject: Fix scuba test according to recent changes on dialer. Recent changes on ViewPagerTabs make the default tab be the one used when users close dialer last time, which adds some correlation among scuba test cases. More specifically, that cancels the unread count above call log tab according to the order of test cases sometimes. Test: Run on a local device PiperOrigin-RevId: 165749385 Change-Id: Id505543d4b4202e11ac61a73bc78eab3ed2b10f0 --- .../android/dialer/databasepopulator/CallLogPopulator.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'java/com/android/dialer/databasepopulator') diff --git a/java/com/android/dialer/databasepopulator/CallLogPopulator.java b/java/com/android/dialer/databasepopulator/CallLogPopulator.java index 79b3fd6b6..7c387ecd1 100644 --- a/java/com/android/dialer/databasepopulator/CallLogPopulator.java +++ b/java/com/android/dialer/databasepopulator/CallLogPopulator.java @@ -75,6 +75,16 @@ public final class CallLogPopulator { @WorkerThread public static void populateCallLog(@NonNull Context context) { + populateCallLog(context, false); + } + + @WorkerThread + public static void populateCallLogWithoutMissed(@NonNull Context context) { + populateCallLog(context, true); + } + + @WorkerThread + public static void populateCallLog(@NonNull Context context, boolean isWithoutMissedCalls) { Assert.isWorkerThread(); ArrayList operations = new ArrayList<>(); // Do this 4 times to make the call log 4 times bigger. @@ -82,6 +92,9 @@ public final class CallLogPopulator { for (int i = 0; i < 4; i++) { for (CallEntry.Builder builder : SIMPLE_CALL_LOG) { CallEntry callEntry = builder.setTimeMillis(timeMillis).build(); + if (isWithoutMissedCalls && builder.build().getType() == Calls.MISSED_TYPE) { + continue; + } operations.add( ContentProviderOperation.newInsert(Calls.CONTENT_URI) .withValues(callEntry.getAsContentValues()) -- cgit v1.2.3