android: add configurable setting for Sustained Performance Mode
This commit is contained in:
parent
981b0eec91
commit
aa083d1e4c
|
@ -694,6 +694,9 @@ static const char *midi_input = "Off";
|
||||||
static const char *midi_output = "Off";
|
static const char *midi_output = "Off";
|
||||||
static const unsigned midi_volume = 100;
|
static const unsigned midi_volume = 100;
|
||||||
|
|
||||||
|
/* Only applies to Android 7.0 (API 24) and up */
|
||||||
|
static const bool sustained_performance_mode = true;
|
||||||
|
|
||||||
#if defined(ANDROID)
|
#if defined(ANDROID)
|
||||||
#if defined(ANDROID_ARM)
|
#if defined(ANDROID_ARM)
|
||||||
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/";
|
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/";
|
||||||
|
|
|
@ -1445,6 +1445,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||||
SETTING_BOOL("video_msg_bgcolor_enable", &settings->bools.video_msg_bgcolor_enable, true, message_bgcolor_enable, false);
|
SETTING_BOOL("video_msg_bgcolor_enable", &settings->bools.video_msg_bgcolor_enable, true, message_bgcolor_enable, false);
|
||||||
SETTING_BOOL("video_window_show_decorations", &settings->bools.video_window_show_decorations, true, window_decorations, false);
|
SETTING_BOOL("video_window_show_decorations", &settings->bools.video_window_show_decorations, true, window_decorations, false);
|
||||||
|
|
||||||
|
SETTING_BOOL("sustained_performance_mode", &settings->bools.sustained_performance_mode, true, sustained_performance_mode, false);
|
||||||
|
|
||||||
*size = count;
|
*size = count;
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
|
@ -2942,7 +2944,9 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||||
settings->paths.path_shader[0] = '\0';
|
settings->paths.path_shader[0] = '\0';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frontend_driver_set_sustained_performance_mode(settings->bools.sustained_performance_mode);
|
||||||
|
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
||||||
|
|
|
@ -275,6 +275,8 @@ typedef struct settings
|
||||||
|
|
||||||
bool automatically_add_content_to_playlist;
|
bool automatically_add_content_to_playlist;
|
||||||
bool video_window_show_decorations;
|
bool video_window_show_decorations;
|
||||||
|
|
||||||
|
bool sustained_performance_mode;
|
||||||
} bools;
|
} bools;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
|
|
@ -589,5 +589,6 @@ frontend_ctx_driver_t frontend_ctx_ctr =
|
||||||
NULL, /* detach_console */
|
NULL, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"ctr",
|
"ctr",
|
||||||
};
|
};
|
||||||
|
|
|
@ -70,5 +70,6 @@ frontend_ctx_driver_t frontend_ctx_dos = {
|
||||||
NULL, /* detach_console */
|
NULL, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"dos",
|
"dos",
|
||||||
};
|
};
|
||||||
|
|
|
@ -262,5 +262,6 @@ frontend_ctx_driver_t frontend_ctx_emscripten = {
|
||||||
NULL, /* detach_console */
|
NULL, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"emscripten"
|
"emscripten"
|
||||||
};
|
};
|
||||||
|
|
|
@ -559,5 +559,6 @@ frontend_ctx_driver_t frontend_ctx_gx = {
|
||||||
NULL, /* detach_console */
|
NULL, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"gx",
|
"gx",
|
||||||
};
|
};
|
||||||
|
|
|
@ -46,5 +46,6 @@ frontend_ctx_driver_t frontend_ctx_null = {
|
||||||
#endif
|
#endif
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"null",
|
"null",
|
||||||
};
|
};
|
||||||
|
|
|
@ -634,5 +634,6 @@ frontend_ctx_driver_t frontend_ctx_ps3 = {
|
||||||
NULL, /* detach_console */
|
NULL, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"ps3",
|
"ps3",
|
||||||
};
|
};
|
||||||
|
|
|
@ -520,6 +520,7 @@ frontend_ctx_driver_t frontend_ctx_psp = {
|
||||||
NULL, /* detach_console */
|
NULL, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
#ifdef VITA
|
#ifdef VITA
|
||||||
"vita",
|
"vita",
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -204,5 +204,6 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
|
||||||
NULL, /* detach_console */
|
NULL, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"qnx",
|
"qnx",
|
||||||
};
|
};
|
||||||
|
|
|
@ -95,6 +95,8 @@ enum
|
||||||
INTERNAL_STORAGE_NOT_WRITABLE
|
INTERNAL_STORAGE_NOT_WRITABLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void frontend_unix_set_sustained_performance_mode(bool on);
|
||||||
|
|
||||||
struct android_app *g_android = NULL;
|
struct android_app *g_android = NULL;
|
||||||
|
|
||||||
static pthread_key_t thread_key;
|
static pthread_key_t thread_key;
|
||||||
|
@ -1147,9 +1149,11 @@ static enum frontend_powerstate frontend_unix_get_powerstate(
|
||||||
if (!env || !g_android)
|
if (!env || !g_android)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
if (g_android->getPowerstate)
|
||||||
CALL_INT_METHOD(env, powerstate,
|
CALL_INT_METHOD(env, powerstate,
|
||||||
g_android->activity->clazz, g_android->getPowerstate);
|
g_android->activity->clazz, g_android->getPowerstate);
|
||||||
|
|
||||||
|
if (g_android->getBatteryLevel)
|
||||||
CALL_INT_METHOD(env, battery_level,
|
CALL_INT_METHOD(env, battery_level,
|
||||||
g_android->activity->clazz, g_android->getBatteryLevel);
|
g_android->activity->clazz, g_android->getBatteryLevel);
|
||||||
|
|
||||||
|
@ -1283,6 +1287,7 @@ static void frontend_unix_get_env(int *argc,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
env = jni_thread_getenv();
|
env = jni_thread_getenv();
|
||||||
|
|
||||||
if (!env)
|
if (!env)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -2013,6 +2018,8 @@ static void frontend_unix_init(void *data)
|
||||||
"getPowerstate", "()I");
|
"getPowerstate", "()I");
|
||||||
GET_METHOD_ID(env, android_app->getBatteryLevel, class,
|
GET_METHOD_ID(env, android_app->getBatteryLevel, class,
|
||||||
"getBatteryLevel", "()I");
|
"getBatteryLevel", "()I");
|
||||||
|
GET_METHOD_ID(env, android_app->setSustainedPerformanceMode, class,
|
||||||
|
"setSustainedPerformanceMode", "(Z)V");
|
||||||
CALL_OBJ_METHOD(env, obj, android_app->activity->clazz,
|
CALL_OBJ_METHOD(env, obj, android_app->activity->clazz,
|
||||||
android_app->getIntent);
|
android_app->getIntent);
|
||||||
|
|
||||||
|
@ -2431,6 +2438,20 @@ static bool frontend_unix_check_for_path_changes(path_change_data_t *change_data
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void frontend_unix_set_sustained_performance_mode(bool on)
|
||||||
|
{
|
||||||
|
#ifdef ANDROID
|
||||||
|
JNIEnv *env = jni_thread_getenv();
|
||||||
|
|
||||||
|
if (!env || !g_android)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (g_android->setSustainedPerformanceMode)
|
||||||
|
CALL_VOID_METHOD_PARAM(env, g_android->activity->clazz,
|
||||||
|
g_android->setSustainedPerformanceMode, on);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
frontend_ctx_driver_t frontend_ctx_unix = {
|
frontend_ctx_driver_t frontend_ctx_unix = {
|
||||||
frontend_unix_get_env, /* environment_get */
|
frontend_unix_get_env, /* environment_get */
|
||||||
frontend_unix_init, /* init */
|
frontend_unix_init, /* init */
|
||||||
|
@ -2474,6 +2495,7 @@ frontend_ctx_driver_t frontend_ctx_unix = {
|
||||||
#endif
|
#endif
|
||||||
frontend_unix_watch_path_for_changes,
|
frontend_unix_watch_path_for_changes,
|
||||||
frontend_unix_check_for_path_changes,
|
frontend_unix_check_for_path_changes,
|
||||||
|
frontend_unix_set_sustained_performance_mode,
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
"android"
|
"android"
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -162,6 +162,7 @@ struct android_app
|
||||||
jmethodID isAndroidTV;
|
jmethodID isAndroidTV;
|
||||||
jmethodID getPowerstate;
|
jmethodID getPowerstate;
|
||||||
jmethodID getBatteryLevel;
|
jmethodID getBatteryLevel;
|
||||||
|
jmethodID setSustainedPerformanceMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -302,6 +302,7 @@ frontend_ctx_driver_t frontend_ctx_wiiu =
|
||||||
NULL, /* detach_console */
|
NULL, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"wiiu",
|
"wiiu",
|
||||||
NULL, /* get_video_driver */
|
NULL, /* get_video_driver */
|
||||||
};
|
};
|
||||||
|
|
|
@ -587,5 +587,6 @@ frontend_ctx_driver_t frontend_ctx_win32 = {
|
||||||
frontend_win32_detach_console, /* detach_console */
|
frontend_win32_detach_console, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"win32"
|
"win32"
|
||||||
};
|
};
|
||||||
|
|
|
@ -426,5 +426,6 @@ frontend_ctx_driver_t frontend_ctx_xdk = {
|
||||||
NULL, /* detach_console */
|
NULL, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"xdk",
|
"xdk",
|
||||||
};
|
};
|
||||||
|
|
|
@ -93,5 +93,6 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
|
||||||
NULL, /* detach_console */
|
NULL, /* detach_console */
|
||||||
NULL, /* watch_path_for_changes */
|
NULL, /* watch_path_for_changes */
|
||||||
NULL, /* check_for_path_changes */
|
NULL, /* check_for_path_changes */
|
||||||
|
NULL, /* set_sustained_performance_mode */
|
||||||
"xenon",
|
"xenon",
|
||||||
};
|
};
|
||||||
|
|
|
@ -416,4 +416,12 @@ bool frontend_driver_check_for_path_changes(path_change_data_t *change_data)
|
||||||
return frontend->check_for_path_changes(change_data);
|
return frontend->check_for_path_changes(change_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void frontend_driver_set_sustained_performance_mode(bool on)
|
||||||
|
{
|
||||||
|
frontend_ctx_driver_t *frontend = frontend_get_ptr();
|
||||||
|
if (!frontend || !frontend->set_sustained_performance_mode)
|
||||||
|
return;
|
||||||
|
frontend->set_sustained_performance_mode(on);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -105,6 +105,7 @@ typedef struct frontend_ctx_driver
|
||||||
#endif
|
#endif
|
||||||
void (*watch_path_for_changes)(struct string_list *list, int flags, path_change_data_t **change_data);
|
void (*watch_path_for_changes)(struct string_list *list, int flags, path_change_data_t **change_data);
|
||||||
bool (*check_for_path_changes)(path_change_data_t *change_data);
|
bool (*check_for_path_changes)(path_change_data_t *change_data);
|
||||||
|
void (*set_sustained_performance_mode)(bool on);
|
||||||
|
|
||||||
const char *ident;
|
const char *ident;
|
||||||
|
|
||||||
|
@ -203,6 +204,8 @@ void frontend_driver_watch_path_for_changes(struct string_list *list, int flags,
|
||||||
|
|
||||||
bool frontend_driver_check_for_path_changes(path_change_data_t *change_data);
|
bool frontend_driver_check_for_path_changes(path_change_data_t *change_data);
|
||||||
|
|
||||||
|
void frontend_driver_set_sustained_performance_mode(bool on);
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1529,3 +1529,5 @@ MSG_HASH(MENU_ENUM_LABEL_MIDI_OUTPUT,
|
||||||
"midi_output")
|
"midi_output")
|
||||||
MSG_HASH(MENU_ENUM_LABEL_MIDI_VOLUME,
|
MSG_HASH(MENU_ENUM_LABEL_MIDI_VOLUME,
|
||||||
"midi_volume")
|
"midi_volume")
|
||||||
|
MSG_HASH(MENU_ENUM_LABEL_SUSTAINED_PERFORMANCE_MODE,
|
||||||
|
"sustained_performance_mode")
|
||||||
|
|
|
@ -3752,3 +3752,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_POWER_MANAGEMENT_SETTINGS,
|
||||||
"Power Management")
|
"Power Management")
|
||||||
MSG_HASH(MENU_ENUM_SUBLABEL_POWER_MANAGEMENT_SETTINGS,
|
MSG_HASH(MENU_ENUM_SUBLABEL_POWER_MANAGEMENT_SETTINGS,
|
||||||
"Change power management settings.")
|
"Change power management settings.")
|
||||||
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||||
|
"Sustained Performance Mode")
|
||||||
|
|
|
@ -5502,7 +5502,12 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||||
case DISPLAYLIST_POWER_MANAGEMENT_SETTINGS_LIST:
|
case DISPLAYLIST_POWER_MANAGEMENT_SETTINGS_LIST:
|
||||||
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
||||||
|
|
||||||
/* Fill in entry here */
|
#ifdef ANDROID
|
||||||
|
if (menu_displaylist_parse_settings_enum(menu, info,
|
||||||
|
MENU_ENUM_LABEL_SUSTAINED_PERFORMANCE_MODE,
|
||||||
|
PARSE_ONLY_BOOL, false) == 0)
|
||||||
|
count++;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
menu_entries_append_enum(info->list,
|
menu_entries_append_enum(info->list,
|
||||||
|
|
|
@ -1633,6 +1633,9 @@ void general_write_handler(void *data)
|
||||||
case MENU_ENUM_LABEL_MIDI_VOLUME:
|
case MENU_ENUM_LABEL_MIDI_VOLUME:
|
||||||
midi_driver_set_volume(settings->uints.midi_volume);
|
midi_driver_set_volume(settings->uints.midi_volume);
|
||||||
break;
|
break;
|
||||||
|
case MENU_ENUM_LABEL_SUSTAINED_PERFORMANCE_MODE:
|
||||||
|
frontend_unix_set_sustained_performance_mode(settings->bools.sustained_performance_mode);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6378,6 +6381,21 @@ static bool setting_append_list(
|
||||||
|
|
||||||
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
|
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
|
||||||
|
|
||||||
|
CONFIG_BOOL(
|
||||||
|
list, list_info,
|
||||||
|
&settings->bools.sustained_performance_mode,
|
||||||
|
MENU_ENUM_LABEL_SUSTAINED_PERFORMANCE_MODE,
|
||||||
|
MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||||
|
sustained_performance_mode,
|
||||||
|
MENU_ENUM_LABEL_VALUE_OFF,
|
||||||
|
MENU_ENUM_LABEL_VALUE_ON,
|
||||||
|
&group_info,
|
||||||
|
&subgroup_info,
|
||||||
|
parent_group,
|
||||||
|
general_write_handler,
|
||||||
|
general_read_handler,
|
||||||
|
SD_FLAG_CMD_APPLY_AUTO);
|
||||||
|
|
||||||
END_SUB_GROUP(list, list_info, parent_group);
|
END_SUB_GROUP(list, list_info, parent_group);
|
||||||
END_GROUP(list, list_info, parent_group);
|
END_GROUP(list, list_info, parent_group);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1870,6 +1870,8 @@ enum msg_hash_enums
|
||||||
MENU_LABEL(MIDI_OUTPUT),
|
MENU_LABEL(MIDI_OUTPUT),
|
||||||
MENU_LABEL(MIDI_VOLUME),
|
MENU_LABEL(MIDI_VOLUME),
|
||||||
|
|
||||||
|
MENU_LABEL(SUSTAINED_PERFORMANCE_MODE),
|
||||||
|
|
||||||
MSG_LAST
|
MSG_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,8 @@ import android.os.Build;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class which provides common methods for RetroActivity related classes.
|
* Class which provides common methods for RetroActivity related classes.
|
||||||
*/
|
*/
|
||||||
|
@ -22,6 +24,7 @@ public class RetroActivityCommon extends RetroActivityLocation
|
||||||
public static int FRONTEND_POWERSTATE_CHARGING = 2;
|
public static int FRONTEND_POWERSTATE_CHARGING = 2;
|
||||||
public static int FRONTEND_POWERSTATE_CHARGED = 3;
|
public static int FRONTEND_POWERSTATE_CHARGED = 3;
|
||||||
public static int FRONTEND_POWERSTATE_ON_POWER_SOURCE = 4;
|
public static int FRONTEND_POWERSTATE_ON_POWER_SOURCE = 4;
|
||||||
|
public boolean sustainedPerformanceMode = true;
|
||||||
|
|
||||||
// Exiting cleanly from NDK seems to be nearly impossible.
|
// Exiting cleanly from NDK seems to be nearly impossible.
|
||||||
// Have to use exit(0) to avoid weird things happening, even with runOnUiThread() approaches.
|
// Have to use exit(0) to avoid weird things happening, even with runOnUiThread() approaches.
|
||||||
|
@ -34,10 +37,33 @@ public class RetroActivityCommon extends RetroActivityLocation
|
||||||
@TargetApi(24)
|
@TargetApi(24)
|
||||||
public void setSustainedPerformanceMode(boolean on)
|
public void setSustainedPerformanceMode(boolean on)
|
||||||
{
|
{
|
||||||
Log.i("RetroActivity", "setting sustained performance mode to " + on);
|
sustainedPerformanceMode = on;
|
||||||
getWindow().setSustainedPerformanceMode(on);
|
|
||||||
|
if (Build.VERSION.SDK_INT >= 24) {
|
||||||
|
if (isSustainedPerformanceModeSupported()) {
|
||||||
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Log.i("RetroActivity", "setting sustained performance mode to " + sustainedPerformanceMode);
|
||||||
|
|
||||||
|
getWindow().setSustainedPerformanceMode(sustainedPerformanceMode);
|
||||||
|
|
||||||
|
latch.countDown();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
latch.await();
|
||||||
|
}catch(InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(24)
|
||||||
public boolean isSustainedPerformanceModeSupported()
|
public boolean isSustainedPerformanceModeSupported()
|
||||||
{
|
{
|
||||||
boolean supported = false;
|
boolean supported = false;
|
||||||
|
|
|
@ -18,10 +18,7 @@ public final class RetroActivityFuture extends RetroActivityCamera {
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 24) {
|
setSustainedPerformanceMode(sustainedPerformanceMode);
|
||||||
if (isSustainedPerformanceModeSupported())
|
|
||||||
setSustainedPerformanceMode(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 19) {
|
if (Build.VERSION.SDK_INT >= 19) {
|
||||||
// Immersive mode
|
// Immersive mode
|
||||||
|
|
|
@ -878,3 +878,6 @@
|
||||||
# network_cmd_enable = false
|
# network_cmd_enable = false
|
||||||
# network_cmd_port = 55355
|
# network_cmd_port = 55355
|
||||||
# stdin_cmd_enable = false
|
# stdin_cmd_enable = false
|
||||||
|
|
||||||
|
# Enable Sustained Performance Mode in Android 7.0+
|
||||||
|
# sustained_performance_mode = true
|
||||||
|
|
Loading…
Reference in New Issue