1 /*
2  * Copyright (C) 2024 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.ambient.touch.dagger;
18 
19 import static com.android.systemui.ambient.touch.dagger.AmbientTouchModule.INPUT_SESSION_NAME;
20 import static com.android.systemui.ambient.touch.dagger.AmbientTouchModule.PILFER_ON_GESTURE_CONSUME;
21 
22 import android.view.GestureDetector;
23 
24 import com.android.systemui.ambient.touch.InputSession;
25 import com.android.systemui.shared.system.InputChannelCompat;
26 
27 import dagger.BindsInstance;
28 import dagger.Subcomponent;
29 
30 import javax.inject.Named;
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         modules = { InputSessionModule.class }
38 )
39 public interface InputSessionComponent {
40     /**
41      * Generates {@link InputSessionComponent}.
42      */
43     @Subcomponent.Factory
44     interface Factory {
45         /** */
create(@amedINPUT_SESSION_NAME) @indsInstance String name, @BindsInstance InputChannelCompat.InputEventListener inputEventListener, @BindsInstance GestureDetector.OnGestureListener gestureListener, @Named(PILFER_ON_GESTURE_CONSUME) @BindsInstance boolean pilferOnGestureConsume)46         InputSessionComponent create(@Named(INPUT_SESSION_NAME) @BindsInstance String name,
47                 @BindsInstance InputChannelCompat.InputEventListener inputEventListener,
48                 @BindsInstance GestureDetector.OnGestureListener gestureListener,
49                 @Named(PILFER_ON_GESTURE_CONSUME) @BindsInstance boolean pilferOnGestureConsume);
50     }
51 
52     /** */
getInputSession()53     InputSession getInputSession();
54 }
55