Leif Wilden | 5eb7748 | 2018-01-23 23:54:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package com.android.settingslib.core.instrumentation; |
| 17 | |
| 18 | import android.content.Context; |
| 19 | import android.util.Pair; |
| 20 | |
| 21 | /** |
| 22 | * Generic log writer interface. |
| 23 | */ |
| 24 | public interface LogWriter { |
| 25 | |
| 26 | /** |
| 27 | * Logs a visibility event when view becomes visible. |
| 28 | */ |
Raff Tsai | c90301c | 2019-11-11 11:21:24 +0800 | [diff] [blame] | 29 | void visible(Context context, int source, int category, int latency); |
Leif Wilden | 5eb7748 | 2018-01-23 23:54:05 +0000 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * Logs a visibility event when view becomes hidden. |
| 33 | */ |
| 34 | void hidden(Context context, int category); |
| 35 | |
| 36 | /** |
Leif Wilden | 5eb7748 | 2018-01-23 23:54:05 +0000 | [diff] [blame] | 37 | * Logs an user action. |
| 38 | */ |
| 39 | void action(Context context, int category, Pair<Integer, Object>... taggedData); |
| 40 | |
| 41 | /** |
| 42 | * Logs an user action. |
| 43 | */ |
Leif Wilden | 5eb7748 | 2018-01-23 23:54:05 +0000 | [diff] [blame] | 44 | void action(Context context, int category, int value); |
| 45 | |
| 46 | /** |
| 47 | * Logs an user action. |
Leif Wilden | 5eb7748 | 2018-01-23 23:54:05 +0000 | [diff] [blame] | 48 | */ |
Leif Wilden | 5eb7748 | 2018-01-23 23:54:05 +0000 | [diff] [blame] | 49 | void action(Context context, int category, boolean value); |
| 50 | |
| 51 | /** |
| 52 | * Logs an user action. |
| 53 | */ |
Fan Zhang | f63a61d | 2018-11-12 23:34:32 -0800 | [diff] [blame] | 54 | void action(Context context, int category, String pkg); |
Leif Wilden | 5eb7748 | 2018-01-23 23:54:05 +0000 | [diff] [blame] | 55 | |
| 56 | /** |
Fan Zhang | 0921e2c | 2018-11-09 14:01:21 -0800 | [diff] [blame] | 57 | * Generically log action. |
Fan Zhang | 6cabe27 | 2018-10-29 12:36:12 -0700 | [diff] [blame] | 58 | */ |
Fan Zhang | 0921e2c | 2018-11-09 14:01:21 -0800 | [diff] [blame] | 59 | void action(int attribution, int action, int pageId, String key, int value); |
Leif Wilden | 5eb7748 | 2018-01-23 23:54:05 +0000 | [diff] [blame] | 60 | } |