summaryrefslogtreecommitdiff
path: root/java/com/android/voicemail/impl/utils
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-05-03 23:10:39 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-03 23:10:39 +0000
commitd67f1627521b174f12e0c247f154c7c93c5e408e (patch)
tree1a45d60921e293c6088efeaf4d9c408456f3e0e2 /java/com/android/voicemail/impl/utils
parent010981b798fbc6b8e6a00c3ea507f00c3e77c371 (diff)
parent8369df095a73a77b3715f8ae7ba06089cebca4ce (diff)
This change reflects the Dialer V10 RC00 branch.
am: 8369df095a Change-Id: I6820870feb74cba010ac3039e4da41325b3005f9
Diffstat (limited to 'java/com/android/voicemail/impl/utils')
-rw-r--r--java/com/android/voicemail/impl/utils/LoggerUtils.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/java/com/android/voicemail/impl/utils/LoggerUtils.java b/java/com/android/voicemail/impl/utils/LoggerUtils.java
new file mode 100644
index 000000000..070772f2f
--- /dev/null
+++ b/java/com/android/voicemail/impl/utils/LoggerUtils.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.voicemail.impl.utils;
+
+import android.content.Context;
+import android.support.annotation.AnyThread;
+import com.android.dialer.common.concurrent.ThreadUtil;
+import com.android.dialer.logging.DialerImpression;
+import com.android.dialer.logging.Logger;
+
+/** Common utility method when using {@link Logger} */
+public class LoggerUtils {
+
+ /** Posts the impression logging to the main thread so it will be thread safe. */
+ @AnyThread
+ public static void logImpressionOnMainThread(Context context, DialerImpression.Type impression) {
+ ThreadUtil.postOnUiThread(() -> Logger.get(context).logImpression(impression));
+ }
+}