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 android.tools 18 19 object PlatformConsts { 20 /** 21 * The default Display id, which is the id of the primary display assuming there is one. 22 * 23 * Duplicated from [Display.DEFAULT_DISPLAY] because this class is used by JVM and KotlinJS 24 */ 25 const val DEFAULT_DISPLAY = 0 26 27 /** 28 * Window type: an application window that serves as the "base" window of the overall 29 * application 30 * 31 * Duplicated from [WindowManager.LayoutParams.TYPE_BASE_APPLICATION] because this class is used 32 * by JVM and KotlinJS 33 */ 34 const val TYPE_BASE_APPLICATION = 1 35 36 /** 37 * Window type: special application window that is displayed while the application is starting 38 * 39 * Duplicated from [WindowManager.LayoutParams.TYPE_APPLICATION_STARTING] because this class is 40 * used by JVM and KotlinJS 41 */ 42 const val TYPE_APPLICATION_STARTING = 3 43 44 /** 45 * Rotation constant: 0 degrees rotation (natural orientation) 46 * 47 * Duplicated from [Surface.ROTATION_0] because this class is used by JVM and KotlinJS 48 */ 49 const val ROTATION_0 = 0 50 51 /** 52 * Rotation constant: 90 degrees rotation. 53 * 54 * Duplicated from [Surface.ROTATION_90] because this class is used by JVM and KotlinJS 55 */ 56 const val ROTATION_90 = 1 57 58 /** 59 * Rotation constant: 180 degrees rotation. 60 * 61 * Duplicated from [Surface.ROTATION_180] because this class is used by JVM and KotlinJS 62 */ 63 const val ROTATION_180 = 2 64 65 /** 66 * Rotation constant: 270 degrees rotation. 67 * 68 * Duplicated from [Surface.ROTATION_270] because this class is used by JVM and KotlinJS 69 */ 70 const val ROTATION_270 = 3 71 72 /** 73 * Navigation bar mode constant: 3 button navigation. 74 * 75 * Duplicated from [WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY] because this 76 * class is used by JVM and KotlinJS 77 */ 78 const val MODE_GESTURAL = "com.android.internal.systemui.navbar.gestural" 79 80 /** 81 * Navigation bar mode : gestural navigation. 82 * 83 * Duplicated from [WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY] because this 84 * class is used by JVM and KotlinJS 85 */ 86 const val MODE_3BUTTON = "com.android.internal.systemui.navbar.threebutton" 87 88 internal const val STATE_INITIALIZING = "INITIALIZING" 89 const val STATE_RESUMED = "RESUMED" 90 const val STATE_PAUSED = "PAUSED" 91 const val STATE_STOPPED = "STOPPED" 92 const val STATE_DESTROYED = "DESTROYED" 93 const val DESKTOP_MODE_MINIMUM_WINDOW_WIDTH = 386 94 const val DESKTOP_MODE_MINIMUM_WINDOW_HEIGHT = 352 95 internal const val APP_STATE_IDLE = "APP_STATE_IDLE" 96 internal const val ACTIVITY_TYPE_UNDEFINED = 0 97 internal const val ACTIVITY_TYPE_STANDARD = 1 98 internal const val DEFAULT_MINIMAL_SPLIT_SCREEN_DISPLAY_SIZE_DP = 440 99 internal const val ACTIVITY_TYPE_HOME = 2 100 internal const val ACTIVITY_TYPE_RECENTS = 3 101 internal const val WINDOWING_MODE_UNDEFINED = 0 102 103 /** @see android.app.WindowConfiguration.WINDOWING_MODE_PINNED */ 104 internal const val WINDOWING_MODE_PINNED = 2 105 106 /** @see android.view.WindowManager.LayoutParams */ 107 internal const val TYPE_NAVIGATION_BAR_PANEL = 2024 108 109 // Default minimal size of resizable task, used if none is set explicitly. 110 // Must be kept in sync with 'default_minimal_size_resizable_task' 111 // dimen from frameworks/base. 112 internal const val DEFAULT_RESIZABLE_TASK_SIZE_DP = 220 113 114 /** From [android.util.DisplayMetrics] */ 115 internal const val DENSITY_DEFAULT = 160f 116 117 /** From [com.android.systemui.shared.recents.utilities.Utilities] */ 118 internal const val TABLET_MIN_DPS = 600f 119 120 /** 121 * From {@see android.view.WindowManager.FLAG_FULLSCREEN}. 122 * 123 * This class is shared between JVM and JS (Winscope) and cannot access Android internals 124 */ 125 internal const val FLAG_FULLSCREEN = 0x00000400 126 internal const val WINDOW_TYPE_STARTING = 1 127 internal const val WINDOW_TYPE_EXITING = 2 128 internal const val WINDOW_TYPE_DEBUGGER = 3 129 130 internal const val STARTING_WINDOW_PREFIX = "Starting " 131 internal const val DEBUGGER_WINDOW_PREFIX = "Waiting For Debugger: " 132 133 const val SPLIT_SCREEN_TRANSITION_HANDLER = "com.android.wm.shell.splitscreen.StageCoordinator" 134 135 const val DESKTOP_MODE_INITIAL_WINDOW_HEIGHT_PROPORTION = 0.375 136 } 137