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.quickstep.util;
17 
18 import android.content.Context;
19 
20 import com.android.launcher3.R;
21 import com.android.launcher3.util.ResourceBasedOverride;
22 
23 /** Utilities to work with Assistant functionality. */
24 public class AssistUtils implements ResourceBasedOverride {
25 
AssistUtils()26     public AssistUtils() {}
27 
28     /** Creates AssistUtils as specified by overrides */
newInstance(Context context)29     public static AssistUtils newInstance(Context context) {
30         return Overrides.getObject(AssistUtils.class, context, R.string.assist_utils_class);
31     }
32 
33     /** @return Array of AssistUtils.INVOCATION_TYPE_* that we want to handle instead of SysUI. */
getSysUiAssistOverrideInvocationTypes()34     public int[] getSysUiAssistOverrideInvocationTypes() {
35         return new int[0];
36     }
37 
38     /**
39      * @return {@code true} if the override was handled, i.e. an assist surface was shown or the
40      * request should be ignored. {@code false} means the caller should start assist another way.
41      */
tryStartAssistOverride(int invocationType)42     public boolean tryStartAssistOverride(int invocationType) {
43         return false;
44     }
45 }
46