• 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 package com.android.server.wm;
17 
18 import android.annotation.NonNull;
19 import android.annotation.Nullable;
20 import android.annotation.SystemApi;
21 import android.annotation.UserIdInt;
22 import android.content.res.CompatScaleWrapper;
23 
24 /**
25  * Updatable interface of {@link CarDisplayCompatScaleProvider}.
26  *
27  * @hide
28  */
29 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
30 public interface CarDisplayCompatScaleProviderUpdatable {
31 
32     /**
33      * This method is used to scale the height/width/density of a given package.
34      * This is called before initialization of the application context therefore the app will have
35      * no idea about the real width/height/density of the device.
36      *
37      * @param packageName package name of the running application
38      * @param userId user id that is running the application
39      * @return scaling factor for the given package name. return null if package was not handled.
40      */
41     @Nullable
getCompatScale(@onNull String packageName, @UserIdInt int userId)42     CompatScaleWrapper getCompatScale(@NonNull String packageName, @UserIdInt int userId);
43 
44     /**
45      * @param packageName package name of the running application
46      * @param userId user id that the package is installed for
47      * @return true if package requires launching in automotive compatibility mode
48      */
requiresDisplayCompat(@onNull String packageName, @UserIdInt int userId)49     boolean requiresDisplayCompat(@NonNull String packageName, @UserIdInt int userId);
50 }
51