From b9c9beeee508ae8ab7019e3a9f141c8e004af512 Mon Sep 17 00:00:00 2001
From: Tobias <thm.frey@gmail.com>
Date: Sun, 11 Feb 2024 02:24:10 +0100
Subject: [PATCH] android: add basic support for google game dashboard (#7430)

This adds support for the Performance and Battery Saver modes in the Game Dashboard mostly found on Google Pixel devices.
This does not yet define the specifics for the performance modes but does provide the initial basic support.

Co-authored-by: Emma <153868115+gaypotatoemma@users.noreply.github.com>
---
 src/android/app/src/main/AndroidManifest.xml          | 3 +++
 src/android/app/src/main/res/xml/game_mode_config.xml | 7 +++++++
 2 files changed, 10 insertions(+)
 create mode 100644 src/android/app/src/main/res/xml/game_mode_config.xml

diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml
index 6263a42db..b9190ad6b 100644
--- a/src/android/app/src/main/AndroidManifest.xml
+++ b/src/android/app/src/main/AndroidManifest.xml
@@ -42,6 +42,9 @@
         android:banner="@mipmap/ic_launcher"
         android:requestLegacyExternalStorage="true">
 
+        <meta-data android:name="android.game_mode_config"
+            android:resource="@xml/game_mode_config" />
+
         <activity
             android:name="org.citra.citra_emu.ui.main.MainActivity"
             android:theme="@style/Theme.Citra.Splash.Main"
diff --git a/src/android/app/src/main/res/xml/game_mode_config.xml b/src/android/app/src/main/res/xml/game_mode_config.xml
new file mode 100644
index 000000000..b28dd3a11
--- /dev/null
+++ b/src/android/app/src/main/res/xml/game_mode_config.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<game-mode-config
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:supportsBatteryGameMode="true"
+    android:supportsPerformanceGameMode="true"
+    android:allowGameDownscaling="false"
+    android:allowGameFpsOverride="false"/>