• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.server.wm;
18 
19 import android.annotation.NonNull;
20 import android.annotation.Nullable;
21 import android.annotation.RequiresApi;
22 import android.annotation.SystemApi;
23 import android.annotation.UserIdInt;
24 import android.car.builtin.annotation.PlatformVersion;
25 import android.os.Build;
26 import android.util.Pair;
27 
28 import com.android.annotation.AddedIn;
29 
30 import java.util.List;
31 
32 /**
33  * Interface implemented by {@code CarLaunchParamsModifier} and used by
34  * {@code CarLaunchParamsModifierUpdatable}.
35  *
36  * Because {@code CarLaunchParamsModifierUpdatable} calls {@code CarLaunchParamsModifierInterface}
37  * with {@code mLock} acquired, {@code CarLaunchParamsModifierInterface} shouldn't call
38  * {@code CarLaunchParamsModifierUpdatable} again during its execution.
39  * @hide
40  */
41 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
42 public interface CarLaunchParamsModifierInterface {
43     /**
44      * Returns {@link TaskDisplayAreaWrapper} of the given {@code featureId} in the given
45      * {@code displayId}.
46      */
47     @AddedIn(PlatformVersion.TIRAMISU_0)
findTaskDisplayArea(int displayId, int featureId)48     @Nullable TaskDisplayAreaWrapper findTaskDisplayArea(int displayId, int featureId);
49 
50     /**
51      * Returns the default {@link TaskDisplayAreaWrapper} of the given {@code displayId}.
52      */
53     @AddedIn(PlatformVersion.TIRAMISU_0)
getDefaultTaskDisplayAreaOnDisplay(int displayId)54     @Nullable TaskDisplayAreaWrapper getDefaultTaskDisplayAreaOnDisplay(int displayId);
55 
56     /**
57      * Returns the list of fallback {@link TaskDisplayAreaWrapper} from the source of the request.
58      */
59     @AddedIn(PlatformVersion.TIRAMISU_0)
getFallbackDisplayAreasForActivity( @onNull ActivityRecordWrapper activityRecord, @Nullable RequestWrapper request)60     @NonNull List<TaskDisplayAreaWrapper> getFallbackDisplayAreasForActivity(
61             @NonNull ActivityRecordWrapper activityRecord, @Nullable RequestWrapper request);
62 
63     /**
64      * @return a pair of the current userId and the target userId.
65      * The target userId is the user to switch during switching the driver,
66      * or {@link android.os.UserHandle.USER_NULL}.
67      */
68     @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
69     @AddedIn(PlatformVersion.UPSIDE_DOWN_CAKE_0)
getCurrentAndTargetUserIds()70     @NonNull Pair<Integer, Integer> getCurrentAndTargetUserIds();
71 
72     /**
73      * Returns the main user (i.e., not a profile) that is assigned to the display, or the
74      * {@link android.app.ActivityManager#getCurrentUser() current foreground user} if no user is
75      * associated with the display.
76      * See {@link com.android.server.pm.UserManagerInternal#getUserAssignedToDisplay(int)} for
77      * the detail.
78      */
79     @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
80     @AddedIn(PlatformVersion.UPSIDE_DOWN_CAKE_0)
getUserAssignedToDisplay(int displayId)81     @UserIdInt int getUserAssignedToDisplay(int displayId);
82 
83     /**
84      * Returns the main display id assigned to the user, or {@code Display.INVALID_DISPLAY} if the
85      * user is not assigned to any main display.
86      * See {@link com.android.server.pm.UserManagerInternal#getMainDisplayAssignedToUser(int)} for
87      * the detail.
88      */
89     @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
90     @AddedIn(PlatformVersion.UPSIDE_DOWN_CAKE_0)
getMainDisplayAssignedToUser(@serIdInt int userId)91     int getMainDisplayAssignedToUser(@UserIdInt int userId);
92 }
93