1 /* 2 * Copyright 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 android.gui; 18 19 /** @hide */ 20 parcelable DisplayModeSpecs { 21 /** 22 * Defines the refresh rates ranges that should be used by SF. 23 */ 24 parcelable RefreshRateRanges { 25 /** 26 * Defines a range of refresh rates. 27 */ 28 parcelable RefreshRateRange { 29 float min; 30 float max; 31 } 32 33 /** 34 * The range of refresh rates that the display should run at. 35 */ 36 RefreshRateRange physical; 37 38 /** 39 * The range of refresh rates that apps should render at. 40 */ 41 RefreshRateRange render; 42 } 43 44 /** 45 * Refers to the time after which the idle screen's refresh rate is to be reduced 46 */ 47 parcelable IdleScreenRefreshRateConfig { 48 49 /** 50 * The timeout value in milli seconds 51 */ 52 int timeoutMillis; 53 } 54 55 /** 56 * Base mode ID. This is what system defaults to for all other settings, or 57 * if the refresh rate range is not available. 58 */ 59 int defaultMode; 60 61 /** 62 * If true this will allow switching between modes in different display configuration 63 * groups. This way the user may see visual interruptions when the display mode changes. 64 */ 65 66 boolean allowGroupSwitching; 67 68 /** 69 * The primary physical and render refresh rate ranges represent DisplayManager's general 70 * guidance on the display modes SurfaceFlinger will consider when switching refresh 71 * rates and scheduling the frame rate. Unless SurfaceFlinger has a specific reason to do 72 * otherwise, it will stay within this range. 73 */ 74 RefreshRateRanges primaryRanges; 75 76 /** 77 * The app request physical and render refresh rate ranges allow SurfaceFlinger to consider 78 * more display modes when switching refresh rates. Although SurfaceFlinger will 79 * generally stay within the primary range, specific considerations, such as layer frame 80 * rate settings specified via the setFrameRate() API, may cause SurfaceFlinger to go 81 * outside the primary range. SurfaceFlinger never goes outside the app request range. 82 * The app request range will be greater than or equal to the primary refresh rate range, 83 * never smaller. 84 */ 85 RefreshRateRanges appRequestRanges; 86 87 /** 88 * The config to represent the maximum time (in ms) for which the display can remain in an idle 89 * state before reducing the refresh rate to conserve power. 90 * Null value refers that the device is not configured to dynamically reduce the refresh rate 91 * based on external conditions. 92 * -1 refers to the current conditions requires no timeout 93 */ 94 @nullable IdleScreenRefreshRateConfig idleScreenRefreshRateConfig; 95 } 96