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 */
16package com.android.settings.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     */
29    void visible(Context context, int source, int category);
30
31    /**
32     * Logs a visibility event when view becomes hidden.
33     */
34    void hidden(Context context, int category);
35
36    /**
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     */
44    void actionWithSource(Context context, int source, int category);
45
46    /**
47     * Logs an user action.
48     */
49    void action(Context context, int category, int value);
50
51    /**
52     * Logs an user action.
53     */
54    void action(Context context, int category, boolean value);
55
56    /**
57     * Logs an user action.
58     */
59    void action(Context context, int category, String pkg, Pair<Integer, Object>... taggedData);
60
61    /**
62     * Logs a count.
63     */
64    void count(Context context, String name, int value);
65
66    /**
67     * Logs a histogram event.
68     */
69    void histogram(Context context, String name, int bucket);
70}
71