1 /*
2  * Copyright (C) 2020 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 
17 package com.android.car.connecteddevice.util;
18 
19 import static com.android.car.connecteddevice.util.SafeLog.logi;
20 
21 import com.android.car.connecteddevice.ConnectedDeviceManager;
22 
23 /** Logging class for collecting metrics. */
24 public class EventLog {
25 
26     private static final String TAG = "ConnectedDeviceEvent";
27 
EventLog()28     private EventLog() { }
29 
30     /** Mark in log that the service has started. */
onServiceStarted()31     public static void onServiceStarted() {
32         logi(TAG, "SERVICE_STARTED");
33     }
34 
35     /** Mark in log that the {@link ConnectedDeviceManager} has started. */
onConnectedDeviceManagerStarted()36     public static void onConnectedDeviceManagerStarted() {
37         logi(TAG, "CONNECTED_DEVICE_MANAGER_STARTED");
38     }
39 
40     /** Mark in the log that BLE is on. */
onBleOn()41     public static void onBleOn() {
42         logi(TAG, "BLE_ON");
43     }
44 
45     /** Mark in the log that a search for the user's device has started. */
onStartDeviceSearchStarted()46     public static void onStartDeviceSearchStarted() {
47         logi(TAG, "SEARCHING_FOR_DEVICE");
48     }
49 
50 
51     /** Mark in the log that a device connected. */
onDeviceConnected()52     public static void onDeviceConnected() {
53         logi(TAG, "DEVICE_CONNECTED");
54     }
55 
56     /** Mark in the log that the device has sent its id. */
onDeviceIdReceived()57     public static void onDeviceIdReceived() {
58         logi(TAG, "RECEIVED_DEVICE_ID");
59     }
60 
61     /** Mark in the log that a secure channel has been established with a device. */
onSecureChannelEstablished()62     public static void onSecureChannelEstablished() {
63         logi(TAG, "SECURE_CHANNEL_ESTABLISHED");
64     }
65 }
66