From 51f2b28ae6a45f57f94e5c9a66081a10aebc8349 Mon Sep 17 00:00:00 2001 From: zachh Date: Fri, 25 Aug 2017 12:19:07 -0700 Subject: Added partial UI to new call log. UI notes: -Updated view holder to show number and basic secondary text -Updated adapter to divide "Today" and "Older" entries -Photo is just an anonymous avatar for now -Clicking anywhere is a no-op Other things done in this CL: -Plumbed a few more columns through the call log framework -Tweaked some column names in the data model (contract) -Cleaned up some existing tests and added some new ones Screenshot: https://screenshot.googleplex.com/DiMscW47AYb This is the complete spec I am working from: https://screenshot.googleplex.com/XLquTek1oHk Bug: 34672501 Test: existing and new Change-Id: Ice0e538e23e59b7d752f47125a5f9da96bf91430 PiperOrigin-RevId: 166508997 --- java/com/android/dialer/strictmode/DialerStrictMode.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'java/com/android/dialer/strictmode') diff --git a/java/com/android/dialer/strictmode/DialerStrictMode.java b/java/com/android/dialer/strictmode/DialerStrictMode.java index 4a0336e53..c7d0b3f57 100644 --- a/java/com/android/dialer/strictmode/DialerStrictMode.java +++ b/java/com/android/dialer/strictmode/DialerStrictMode.java @@ -28,6 +28,7 @@ import android.support.annotation.AnyThread; import android.support.annotation.MainThread; import android.support.v4.os.UserManagerCompat; import com.android.dialer.buildtype.BuildType; +import com.android.dialer.function.Supplier; import com.android.dialer.util.DialerUtils; /** Enables strict mode for the application, and provides means of temporarily disabling it. */ @@ -94,11 +95,6 @@ public final class DialerStrictMode { return Looper.getMainLooper().equals(Looper.myLooper()); } - /** Functional interface intended to be used with {@link #bypass(Provider)}. */ - public interface Provider { - T get(); - } - /** * Convenience method for disabling and enabling the thread policy death penalty using lambdas. * @@ -111,17 +107,17 @@ public final class DialerStrictMode { *

The thread policy is only mutated if this is called from the main thread. */ @AnyThread - public static T bypass(Provider provider) { + public static T bypass(Supplier supplier) { if (isStrictModeAllowed() && onMainThread()) { ThreadPolicy originalPolicy = StrictMode.getThreadPolicy(); StrictModeUtils.setRecommendedMainThreadPolicy(THREAD_LOG_PENALTY); try { - return provider.get(); + return supplier.get(); } finally { StrictMode.setThreadPolicy(originalPolicy); } } - return provider.get(); + return supplier.get(); } /** @@ -149,3 +145,5 @@ public final class DialerStrictMode { runnable.run(); } } + + -- cgit v1.2.3