1 /* 2 * Copyright (C) 2023 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.intentresolver.logging 17 18 import com.android.internal.logging.InstanceId 19 import com.android.internal.logging.InstanceIdSequence 20 import com.android.internal.logging.MetricsLogger 21 import com.android.internal.logging.UiEventLogger 22 import com.android.internal.logging.UiEventLoggerImpl 23 import dagger.Binds 24 import dagger.Module 25 import dagger.Provides 26 import dagger.hilt.InstallIn 27 import dagger.hilt.android.components.ActivityRetainedComponent 28 import dagger.hilt.android.scopes.ActivityRetainedScoped 29 30 @Module 31 @InstallIn(ActivityRetainedComponent::class) 32 interface EventLogModule { 33 eventLognull34 @Binds @ActivityRetainedScoped fun eventLog(value: EventLogImpl): EventLog 35 36 companion object { 37 @Provides 38 fun instanceId(sequence: InstanceIdSequence): InstanceId = sequence.newInstanceId() 39 40 @Provides fun uiEventLogger(): UiEventLogger = UiEventLoggerImpl() 41 42 @Provides fun frameworkLogger(): FrameworkStatsLogger = object : FrameworkStatsLogger {} 43 44 @Provides fun metricsLogger(): MetricsLogger = MetricsLogger() 45 } 46 } 47