1 /* 2 * Copyright (C) 2022 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.systemui.media.taptotransfer.receiver 18 19 import com.android.internal.logging.UiEvent 20 import com.android.internal.logging.UiEventLogger 21 import com.android.systemui.dagger.SysUISingleton 22 import javax.inject.Inject 23 24 /** A class for analytics logging for the media tap-to-transfer chip on the receiver device. */ 25 @SysUISingleton 26 class MediaTttReceiverUiEventLogger @Inject constructor(private val logger: UiEventLogger) { 27 /** Logs that the receiver chip has changed states. */ logReceiverStateChangenull28 fun logReceiverStateChange(chipState: ChipStateReceiver) { 29 logger.log(chipState.uiEvent) 30 } 31 } 32 33 enum class MediaTttReceiverUiEvents(val metricId: Int) : UiEventLogger.UiEventEnum { 34 @UiEvent(doc = "See android.app.StatusBarManager.MEDIA_TRANSFER_RECEIVER_* docs") 35 MEDIA_TTT_RECEIVER_CLOSE_TO_SENDER(982), 36 @UiEvent(doc = "See android.app.StatusBarManager.MEDIA_TRANSFER_RECEIVER_* docs") 37 MEDIA_TTT_RECEIVER_FAR_FROM_SENDER(983), 38 @UiEvent(doc = "See android.app.StatusBarManager.MEDIA_TRANSFER_RECEIVER_* docs") 39 MEDIA_TTT_RECEIVER_TRANSFER_TO_RECEIVER_SUCCEEDED(1263), 40 @UiEvent(doc = "See android.app.StatusBarManager.MEDIA_TRANSFER_RECEIVER_* docs") 41 MEDIA_TTT_RECEIVER_TRANSFER_TO_RECEIVER_FAILED(1264); 42 getIdnull43 override fun getId() = metricId 44 } 45