• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package com.android.server.wm;
18 
19 import android.annotation.SystemApi;
20 import android.annotation.UserIdInt;
21 
22 
23 /**
24  * Interface implemented by {@link com.android.internal.car.CarActivityInterceptor} and used by
25  * {@link CarActivityInterceptorUpdatable}.
26  *
27  * Because {@code CarActivityInterceptorUpdatable} calls {@code CarActivityInterceptorInterface}
28  * with {@code mLock} acquired, {@code CarActivityInterceptorInterface} shouldn't call
29  * {@code CarActivityInterceptorUpdatable} again during its execution.
30  * @hide
31  */
32 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
33 public interface CarActivityInterceptorInterface {
34     /**
35      * Returns the main user (i.e., not a profile) that is assigned to the display, or the
36      * {@link android.app.ActivityManager#getCurrentUser() current foreground user} if no user is
37      * associated with the display.
38      * See {@link com.android.server.pm.UserManagerInternal#getUserAssignedToDisplay(int)} for
39      * the detail.
40      */
getUserAssignedToDisplay(int displayId)41     @UserIdInt int getUserAssignedToDisplay(int displayId);
42 
43     /**
44      * Returns the main display id assigned to the user, or {@code Display.INVALID_DISPLAY} if the
45      * user is not assigned to any main display.
46      * See {@link com.android.server.pm.UserManagerInternal#getMainDisplayAssignedToUser(int)} for
47      * the detail.
48      */
getMainDisplayAssignedToUser(@serIdInt int userId)49     int getMainDisplayAssignedToUser(@UserIdInt int userId);
50 }
51