diff options
author | weijiaxu <weijiaxu@google.com> | 2017-08-18 14:03:30 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-30 15:46:27 +0000 |
commit | e89e0f58b5e6159a76baebc1b4e0b5063007e467 (patch) | |
tree | fa80da38a95988bae267b6a3b0ea7ed499175743 | |
parent | 945b28c5d8e911f99315c97f23dad05a86c0e1bc (diff) |
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
-rw-r--r-- | java/com/android/dialer/databasepopulator/CallLogPopulator.java | 13 |
1 files changed, 13 insertions, 0 deletions
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<ContentProviderOperation> 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()) |