Created
March 18, 2022 13:58
-
-
Save pflammertsma/671f571c5a763b0e4916ad1e9cefa82e to your computer and use it in GitHub Desktop.
Sample for refresh rate switching with application focus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2021 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
val params: WindowManager.LayoutParams = window.attributes | |
if (requestedMode.modeId !== params.preferredDisplayModeId) { | |
params.preferredDisplayModeId = requestedMode.modeId | |
window.attributes = params | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment