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.car.app.CarActivityManager; 24 import android.car.builtin.annotation.PlatformVersion; 25 import android.content.ComponentName; 26 import android.hardware.display.DisplayManager; 27 import android.os.ServiceSpecificException; 28 import android.os.UserHandle; 29 import android.util.ArrayMap; 30 import android.util.Slog; 31 import android.util.SparseIntArray; 32 import android.view.Display; 33 import android.window.DisplayAreaOrganizer; 34 35 import com.android.annotation.AddedIn; 36 import com.android.internal.annotations.GuardedBy; 37 38 import java.util.ArrayList; 39 import java.util.Arrays; 40 import java.util.Collections; 41 import java.util.List; 42 43 /** 44 * Updatable interface of CarLaunchParamsModifier. 45 * @hide 46 */ 47 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) 48 public interface CarLaunchParamsModifierUpdatable { 49 50 /** Returns {@link DisplayManager.DisplayListener} of CarLaunchParamsModifierUpdatable. */ 51 @AddedIn(PlatformVersion.TIRAMISU_0) getDisplayListener()52 DisplayManager.DisplayListener getDisplayListener(); 53 54 /** Notifies user switching. */ 55 @AddedIn(PlatformVersion.TIRAMISU_0) handleCurrentUserSwitching(@serIdInt int newUserId)56 void handleCurrentUserSwitching(@UserIdInt int newUserId); 57 58 /** Notifies user starting. */ 59 @AddedIn(PlatformVersion.TIRAMISU_0) handleUserStarting(@serIdInt int startingUser)60 void handleUserStarting(@UserIdInt int startingUser); 61 62 /** Notifies user stopped. */ 63 @AddedIn(PlatformVersion.TIRAMISU_0) handleUserStopped(@serIdInt int stoppedUser)64 void handleUserStopped(@UserIdInt int stoppedUser); 65 66 /** 67 * Calculates {@code outParams} based on the given arguments. 68 * See {@code LaunchParamsController.LaunchParamsModifier.onCalculate()} for the detail. 69 */ 70 @AddedIn(PlatformVersion.TIRAMISU_0) calculate(CalculateParams params)71 int calculate(CalculateParams params); 72 } 73