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.dreams.touch.dagger; 18 19 import static com.android.systemui.dreams.touch.dagger.DreamTouchModule.INPUT_SESSION_NAME; 20 import static com.android.systemui.dreams.touch.dagger.DreamTouchModule.PILFER_ON_GESTURE_CONSUME; 21 22 import android.view.GestureDetector; 23 24 import com.android.systemui.dreams.touch.InputSession; 25 import com.android.systemui.shared.system.InputChannelCompat; 26 27 import javax.inject.Named; 28 29 import dagger.BindsInstance; 30 import dagger.Subcomponent; 31 32 /** 33 * {@link InputSessionComponent} generates {@link InputSession} with specific instances bound for 34 * the session name and whether touches should be pilfered when consumed. 35 */ 36 @Subcomponent 37 public interface InputSessionComponent { 38 /** 39 * Generates {@link InputSessionComponent}. 40 */ 41 @Subcomponent.Factory 42 interface Factory { create(@amedINPUT_SESSION_NAME) @indsInstance String name, @BindsInstance InputChannelCompat.InputEventListener inputEventListener, @BindsInstance GestureDetector.OnGestureListener gestureListener, @Named(PILFER_ON_GESTURE_CONSUME) @BindsInstance boolean pilferOnGestureConsume)43 InputSessionComponent create(@Named(INPUT_SESSION_NAME) @BindsInstance String name, 44 @BindsInstance InputChannelCompat.InputEventListener inputEventListener, 45 @BindsInstance GestureDetector.OnGestureListener gestureListener, 46 @Named(PILFER_ON_GESTURE_CONSUME) @BindsInstance boolean pilferOnGestureConsume); 47 } 48 49 /** */ getInputSession()50 InputSession getInputSession(); 51 } 52