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