blob: 9d9c17f3b443920333530072b0abea97e2dc13c6 [file] [log] [blame]
Leif Wilden5eb77482018-01-23 23:54:05 +00001/*
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 */
16package com.android.settingslib.core.instrumentation;
17
18import android.content.Context;
19import android.util.Pair;
20
21/**
22 * Generic log writer interface.
23 */
24public interface LogWriter {
25
26 /**
27 * Logs a visibility event when view becomes visible.
28 */
Raff Tsaic90301c2019-11-11 11:21:24 +080029 void visible(Context context, int source, int category, int latency);
Leif Wilden5eb77482018-01-23 23:54:05 +000030
31 /**
32 * Logs a visibility event when view becomes hidden.
33 */
34 void hidden(Context context, int category);
35
36 /**
Leif Wilden5eb77482018-01-23 23:54:05 +000037 * 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 Wilden5eb77482018-01-23 23:54:05 +000044 void action(Context context, int category, int value);
45
46 /**
47 * Logs an user action.
Leif Wilden5eb77482018-01-23 23:54:05 +000048 */
Leif Wilden5eb77482018-01-23 23:54:05 +000049 void action(Context context, int category, boolean value);
50
51 /**
52 * Logs an user action.
53 */
Fan Zhangf63a61d2018-11-12 23:34:32 -080054 void action(Context context, int category, String pkg);
Leif Wilden5eb77482018-01-23 23:54:05 +000055
56 /**
Fan Zhang0921e2c2018-11-09 14:01:21 -080057 * Generically log action.
Fan Zhang6cabe272018-10-29 12:36:12 -070058 */
Fan Zhang0921e2c2018-11-09 14:01:21 -080059 void action(int attribution, int action, int pageId, String key, int value);
Leif Wilden5eb77482018-01-23 23:54:05 +000060}