From 84bf2b070567f347ba060bf93b8384b1db4615fd Mon Sep 17 00:00:00 2001 From: Diablodiab Date: Mon, 11 Jan 2016 21:45:46 +0100 Subject: [PATCH] Add REFRESH parameter option to Android version. You can use this parameter to specify a preferred refresh rate for Retroarch to use. --- .../browser/retroactivity/RetroActivityFuture.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityFuture.java b/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityFuture.java index cefd73b0f0..19ad1290c6 100644 --- a/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityFuture.java +++ b/pkg/android/phoenix/src/com/retroarch/browser/retroactivity/RetroActivityFuture.java @@ -1,6 +1,8 @@ package com.retroarch.browser.retroactivity; import android.view.View; +import android.view.WindowManager; +import android.content.Intent; public final class RetroActivityFuture extends RetroActivityCamera { @@ -25,6 +27,17 @@ public final class RetroActivityFuture extends RetroActivityCamera { | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | API_SYSTEM_UI_FLAG_FULLSCREEN | API_SYSTEM_UI_FLAG_IMMERSIVE_STICKY); + + // Check for REFRESH parameter + Intent retro = getIntent(); + String refresh = retro.getStringExtra("REFRESH"); + + // If REFRESH parameter is provided then try to set refreshrate accordingly + if(refresh != null) { + WindowManager.LayoutParams params = getWindow().getAttributes(); + params.preferredRefreshRate = Integer.parseInt(refresh); + getWindow().setAttributes(params); + } } }