From b6370d2441de873b1a5b9e65b1c2aa4d5da769fb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 12 Aug 2013 01:51:49 +0200 Subject: [PATCH] (Android Java) Set threaded video to default - Shield/Nexus 7 2013 now simply an 'OK' messagebox --- android/phoenix/res/xml/prefs.xml | 2 +- .../retroarch/browser/MainMenuActivity.java | 26 +++++++------------ .../src/org/retroarch/browser/RetroArch.java | 8 +----- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/android/phoenix/res/xml/prefs.xml b/android/phoenix/res/xml/prefs.xml index 1d7eab953f..b895af4e48 100644 --- a/android/phoenix/res/xml/prefs.xml +++ b/android/phoenix/res/xml/prefs.xml @@ -34,7 +34,7 @@ diff --git a/android/phoenix/src/org/retroarch/browser/MainMenuActivity.java b/android/phoenix/src/org/retroarch/browser/MainMenuActivity.java index b8db113a75..cd4a13cabd 100644 --- a/android/phoenix/src/org/retroarch/browser/MainMenuActivity.java +++ b/android/phoenix/src/org/retroarch/browser/MainMenuActivity.java @@ -13,7 +13,6 @@ import org.retroarch.R; import android.app.AlertDialog; import android.content.DialogInterface; -import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.AssetManager; @@ -155,18 +154,15 @@ public class MainMenuActivity extends PreferenceActivity { boolean detectDevice(boolean show_dialog) { - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); - SharedPreferences.Editor edit = prefs.edit(); - edit.putBoolean("video_threaded", true); - edit.commit(); + boolean retval = false; Log.i("Device MODEL", android.os.Build.MODEL); if (android.os.Build.MODEL.equals("SHIELD")) { AlertDialog.Builder alert = new AlertDialog.Builder(this) .setTitle("NVidia Shield detected") - .setMessage("Would you like to set up the ideal configuration options for your device?\nNOTE: For optimal performance, turn off Google Account sync, Google Play Store auto-updates, GPS and Wifi in your Android settings menu.") - .setPositiveButton("Yes", new DialogInterface.OnClickListener() { + .setMessage("The ideal configuration options for your device will now be preconfigured.\nNOTE: For optimal performance, turn off Google Account sync, Google Play Store auto-updates, GPS and Wifi in your Android settings menu.") + .setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); @@ -176,17 +172,16 @@ public class MainMenuActivity extends PreferenceActivity { edit.putBoolean("input_autodetect_enable", true); edit.commit(); } - }) - .setNegativeButton("No", null); + }); alert.show(); - return true; + retval = true; } else if (android.os.Build.ID.equals("JSS15J")) { AlertDialog.Builder alert = new AlertDialog.Builder(this) .setTitle("Nexus 7 2013 detected") - .setMessage("Would you like to set up the ideal configuration options for your device?\nNOTE: For optimal performance, turn off Google Account sync, Google Play Store auto-updates, GPS and Wifi in your Android settings menu.") - .setPositiveButton("Yes", new DialogInterface.OnClickListener() { + .setMessage("The ideal configuration options for your device will now be preconfigured.\nNOTE: For optimal performance, turn off Google Account sync, Google Play Store auto-updates, GPS and Wifi in your Android settings menu.") + .setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); @@ -194,10 +189,9 @@ public class MainMenuActivity extends PreferenceActivity { edit.putString("video_refresh_rate", Double.valueOf(59.65).toString()); edit.commit(); } - }) - .setNegativeButton("No", null); + }); alert.show(); - return true; + retval = true; } if (show_dialog) { @@ -206,7 +200,7 @@ public class MainMenuActivity extends PreferenceActivity { Toast.LENGTH_SHORT).show(); } - return false; + return retval; } @Override diff --git a/android/phoenix/src/org/retroarch/browser/RetroArch.java b/android/phoenix/src/org/retroarch/browser/RetroArch.java index ae80922648..c65689d8a9 100644 --- a/android/phoenix/src/org/retroarch/browser/RetroArch.java +++ b/android/phoenix/src/org/retroarch/browser/RetroArch.java @@ -60,7 +60,6 @@ public class RetroArch extends Activity implements private IconAdapter adapter; static private final int ACTIVITY_LOAD_ROM = 0; static private String libretro_path; - static private Double report_refreshrate; static private final String TAG = "CoreSelection"; private ConfigFile config; private ConfigFile core_config; @@ -140,7 +139,6 @@ public class RetroArch extends Activity implements String cpuInfo = readCPUInfo(); boolean cpuIsNeon = cpuInfoIsNeon(cpuInfo); - report_refreshrate = getDisplayRefreshRate(); setContentView(R.layout.line_list); @@ -272,7 +270,7 @@ public class RetroArch extends Activity implements config.setInt("input_autodetect_icade_profile_pad4", Integer.valueOf(prefs.getString("input_autodetect_icade_profile_pad4", "0"))); config.setDouble("video_refresh_rate", getRefreshRate()); - config.setBoolean("video_threaded", prefs.getBoolean("video_threaded", false)); + config.setBoolean("video_threaded", prefs.getBoolean("video_threaded", true)); String aspect = prefs.getString("video_aspect_ratio", "auto"); if (aspect.equals("full")) { @@ -418,10 +416,6 @@ public class RetroArch extends Activity implements String current_ime = Settings.Secure.getString(getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD); new AlertDialog.Builder(this).setMessage(current_ime).setNeutralButton("Close", null).show(); return true; - case R.id.report_refreshrate: - String current_rate = "Screen Refresh Rate: " + Double.valueOf(report_refreshrate).toString(); - new AlertDialog.Builder(this).setMessage(current_rate).setNeutralButton("Close", null).show(); - return true; default: return false; }