Let them reboot if they ignore the warning. At least we tried

This commit is contained in:
TwistedUmbrella 2014-03-02 23:44:31 -05:00
parent ee88660820
commit 8047074982
1 changed files with 70 additions and 72 deletions

View File

@ -4,7 +4,6 @@ import java.io.File;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.List;
import tv.ouya.console.api.OuyaFacade;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.DialogInterface;
@ -351,81 +350,80 @@ public class MainActivity extends SlidingFragmentActivity implements
if (GenerateLogs.readOutput("uname -a").equals(getString(R.string.error_kernel))) {
Toast.makeText(MainActivity.this, R.string.unsupported,
Toast.LENGTH_SHORT).show();
} else {
String msg = null;
if (!isBiosExisting())
msg = getString(R.string.missing_bios, home_directory);
else if (!isFlashExisting())
msg = getString(R.string.missing_flash, home_directory);
}
String msg = null;
if (!isBiosExisting())
msg = getString(R.string.missing_bios, home_directory);
else if (!isFlashExisting())
msg = getString(R.string.missing_flash, home_directory);
if (msg != null) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
this);
if (msg != null) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
this);
// set title
alertDialogBuilder.setTitle("You have to provide the BIOS");
// set title
alertDialogBuilder.setTitle("You have to provide the BIOS");
// set dialog message
alertDialogBuilder
.setMessage(msg)
.setCancelable(false)
.setPositiveButton("Dismiss",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
// if this button is clicked, close
// current activity
// MainActivity.this.finish();
}
})
.setNegativeButton("Options",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
FileBrowser firstFragment = new FileBrowser();
Bundle args = new Bundle();
// args.putBoolean("ImgBrowse", false);
// specify ImgBrowse option. true = images,
// false = folders only
args.putString("browse_entry",
sdcard.toString());
// specify a path for selecting folder
// options
args.putBoolean("games_entry", false);
// selecting a BIOS folder, so this is not
// games
firstFragment.setArguments(args);
// In case this activity was started with
// special instructions from
// an Intent, pass the Intent's extras to
// the fragment as arguments
// firstFragment.setArguments(getIntent().getExtras());
// Add the fragment to the
// 'fragment_container' FrameLayout
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.fragment_container,
firstFragment,
"MAIN_BROWSER")
.addToBackStack(null).commit();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && !Config.nonative) {
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
GL2JNINative.class));
} else {
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
GL2JNIActivity.class));
// set dialog message
alertDialogBuilder
.setMessage(msg)
.setCancelable(false)
.setPositiveButton("Dismiss",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
// if this button is clicked, close
// current activity
// MainActivity.this.finish();
}
})
.setNegativeButton("Options",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
FileBrowser firstFragment = new FileBrowser();
Bundle args = new Bundle();
// args.putBoolean("ImgBrowse", false);
// specify ImgBrowse option. true = images,
// false = folders only
args.putString("browse_entry",
sdcard.toString());
// specify a path for selecting folder
// options
args.putBoolean("games_entry", false);
// selecting a BIOS folder, so this is not
// games
firstFragment.setArguments(args);
// In case this activity was started with
// special instructions from
// an Intent, pass the Intent's extras to
// the fragment as arguments
// firstFragment.setArguments(getIntent().getExtras());
// Add the fragment to the
// 'fragment_container' FrameLayout
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.fragment_container,
firstFragment,
"MAIN_BROWSER")
.addToBackStack(null).commit();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && !Config.nonative) {
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
GL2JNINative.class));
} else {
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
GL2JNIActivity.class));
}
}
}