From cded3beaf28a703e1ef8f71bbc6836e6806c3736 Mon Sep 17 00:00:00 2001 From: Tobias Thierer Date: Fri, 9 Jun 2017 14:16:05 +0000 Subject: Revert "Update AOSP Dialer source from internal google3 repository at cl/158012278. am: 91ce7d2a47" This reverts commit c67d658e7daa453fe9ad9fd1a37f81eaf2048c44. Reason for revert: This CL broke the sailfish-userdebug_javac-all target on master. Change-Id: I9b54333a654c00154ca84f4ece84bea4f07cc19b --- .../android/contacts/common/util/StopWatch.java | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'java/com/android/contacts/common/util/StopWatch.java') diff --git a/java/com/android/contacts/common/util/StopWatch.java b/java/com/android/contacts/common/util/StopWatch.java index 7986d1081..b944b9867 100644 --- a/java/com/android/contacts/common/util/StopWatch.java +++ b/java/com/android/contacts/common/util/StopWatch.java @@ -16,7 +16,7 @@ package com.android.contacts.common.util; -import com.android.dialer.common.LogUtil; +import android.util.Log; import java.util.ArrayList; /** A {@link StopWatch} records start, laps and stop, and print them to logcat. */ @@ -37,6 +37,11 @@ public class StopWatch { return new StopWatch(label); } + /** Return a dummy instance that does no operations. */ + public static StopWatch getNullStopWatch() { + return NullStopWatch.INSTANCE; + } + /** Record a lap. */ public void lap(String lapLabel) { mTimes.add(System.currentTimeMillis()); @@ -71,6 +76,25 @@ public class StopWatch { sb.append(" "); last = current; } - LogUtil.v(TAG, sb.toString()); + Log.v(TAG, sb.toString()); + } + + private static class NullStopWatch extends StopWatch { + + public static final NullStopWatch INSTANCE = new NullStopWatch(); + + public NullStopWatch() { + super(null); + } + + @Override + public void lap(String lapLabel) { + // noop + } + + @Override + public void stopAndLog(String TAG, int timeThresholdToLog) { + // noop + } } } -- cgit v1.2.3