(Android Java) Set threaded video to default - Shield/Nexus 7 2013 now simply an

'OK' messagebox
This commit is contained in:
twinaphex 2013-08-12 01:51:49 +02:00
parent 972fa44f14
commit b6370d2441
3 changed files with 12 additions and 24 deletions

View File

@ -34,7 +34,7 @@
</PreferenceCategory>
<PreferenceCategory android:title="Synchronization" >
<CheckBoxPreference
android:defaultValue="false"
android:defaultValue="true"
android:key="video_threaded"
android:summary="Uses a multi-threaded video driver. Is likely to improve performance at the expense of slightly more latency and jitter. Use this if you have troubles getting good video and audio."
android:title="Threaded video driver" />

View File

@ -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

View File

@ -60,7 +60,6 @@ public class RetroArch extends Activity implements
private IconAdapter<ModuleWrapper> 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;
}