diff options
author | Yorke Lee <yorkelee@google.com> | 2015-09-10 15:55:20 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-09-10 15:55:20 +0000 |
commit | a3b4676fe2bf93387333cb1ee789388265f7aac1 (patch) | |
tree | b1ed3c4dbfa8e397638fb3cdb116db281a5ed73d | |
parent | bdb8bc1a0dda0d9193a08b482d3732fd2534a719 (diff) | |
parent | b7b0a210c377f4f09e6f0c34af6345c79a8990f7 (diff) |
Merge "Add stub implementations for logging changes" into ub-contactsdialer-a-dev
-rw-r--r-- | src/com/android/dialer/logging/Logger.java | 58 | ||||
-rw-r--r-- | src/com/android/dialerbind/ObjectFactory.java | 6 |
2 files changed, 64 insertions, 0 deletions
diff --git a/src/com/android/dialer/logging/Logger.java b/src/com/android/dialer/logging/Logger.java new file mode 100644 index 000000000..300707779 --- /dev/null +++ b/src/com/android/dialer/logging/Logger.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2015 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.dialer.logging; + +import android.app.Activity; + +import com.android.dialerbind.ObjectFactory; +import com.android.incallui.Call; + +public abstract class Logger { + + public static Logger getInstance() { + return ObjectFactory.getLoggerInstance(); + } + + /** + * Logs a call event. PII like the call's number or caller details should never be logged. + * + * @param call to log. + */ + public static void logCall(Call call) { + final Logger logger = getInstance(); + if (logger != null) { + logger.logCallImpl(call); + } + } + + /** + * Logs an event indicating that a screen/fragment was displayed. + * + * @param fragmentName of the displayed fragment. + * @param activity Parent activity of the fragment. + * @param tag Optional string used to provide additional information about the fragment. + */ + public static void logScreenView(String fragmentName, Activity activity, String tag) { + final Logger logger = getInstance(); + if (logger != null) { + logger.logScreenViewImpl(fragmentName, activity, tag); + } + } + + public abstract void logCallImpl(Call call); + public abstract void logScreenViewImpl(String fragmentName, Activity activity, String tag); +} diff --git a/src/com/android/dialerbind/ObjectFactory.java b/src/com/android/dialerbind/ObjectFactory.java index d67ada0d1..c64afe83a 100644 --- a/src/com/android/dialerbind/ObjectFactory.java +++ b/src/com/android/dialerbind/ObjectFactory.java @@ -22,6 +22,7 @@ import android.content.Context; import com.android.dialer.calllog.CallLogAdapter; import com.android.dialer.calllog.ContactInfoHelper; +import com.android.dialer.logging.Logger; import com.android.dialer.service.CachedNumberLookupService; import com.android.dialer.voicemail.VoicemailPlaybackPresenter; @@ -59,4 +60,9 @@ public class ObjectFactory { voicemailPlaybackPresenter, isCallLogActivity); } + + public static Logger getLoggerInstance() { + // no-op + return null; + } } |