1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 * in compliance with the License. You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software distributed under the License 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 * or implied. See the License for the specific language governing permissions and limitations under 12 * the License. 13 */ 14 15 package com.android.dialer.logging; 16 17 import android.app.Activity; 18 import android.widget.QuickContactBadge; 19 20 /** Allows the container application to gather analytics. */ 21 public interface LoggingBindings { 22 23 /** 24 * Logs an DialerImpression event that's not associated with a specific call. 25 * 26 * @param dialerImpression an integer representing what event occurred. 27 */ 28 void logImpression(DialerImpression.Type dialerImpression); 29 30 /** 31 * Logs an impression for a general dialer event that's not associated with a specific call. 32 * 33 * @param dialerImpression an integer representing what event occurred. 34 */ 35 @Deprecated 36 void logImpression(int dialerImpression); 37 38 /** 39 * Logs an impression for a general dialer event that's associated with a specific call. 40 * 41 * @param dialerImpression an integer representing what event occurred. 42 * @param callId unique ID of the call. 43 * @param callStartTimeMillis the absolute time when the call started. 44 */ 45 void logCallImpression( 46 DialerImpression.Type dialerImpression, String callId, long callStartTimeMillis); 47 48 /** 49 * Logs an interaction that occurred. 50 * 51 * @param interaction an integer representing what interaction occurred. 52 * @see com.android.dialer.logging.InteractionEvent 53 */ 54 void logInteraction(InteractionEvent.Type interaction); 55 56 /** 57 * Logs an event indicating that a screen was displayed. 58 * 59 * @param screenEvent an integer representing the displayed screen. 60 * @param activity Parent activity of the displayed screen. 61 * @see com.android.dialer.logging.ScreenEvent 62 */ 63 void logScreenView(com.android.dialer.logging.ScreenEvent.Type screenEvent, Activity activity); 64 65 /** Logs the composition of contact tiles in the speed dial tab. */ 66 void logSpeedDialContactComposition( 67 int counter, 68 int starredContactsCount, 69 int pinnedContactsCount, 70 int multipleNumbersContactsCount, 71 int contactsWithPhotoCount, 72 int contactsWithNameCount, 73 int lightbringerReachableContactsCount); 74 75 /** Logs a hit event to the analytics server. */ 76 void sendHitEventAnalytics(String category, String action, String label, long value); 77 78 /** Logs where a quick contact badge is clicked */ 79 void logQuickContactOnTouch( 80 QuickContactBadge quickContact, 81 InteractionEvent.Type interactionEvent, 82 boolean shouldPerformClick); 83 84 /** Logs People Api lookup result with error */ 85 void logPeopleApiLookupReportWithError( 86 long latency, int httpResponseCode, PeopleApiLookupError.Type errorType); 87 88 /** Logs successful People Api lookup result */ 89 void logSuccessfulPeopleApiLookupReport(long latency, int httpResponseCode); 90 } 91