bug 632649 - Warn users on devices with 256mb of RAM or less that they are on an unsupported device r=dougt ui-r=madhava a=blocking-fennec

This commit is contained in:
Brad Lassey 2011-02-11 17:35:50 -05:00
Родитель 805426c11e
Коммит eaaea36dd3
3 изменённых файлов: 26 добавлений и 1 удалений

Просмотреть файл

@ -106,12 +106,13 @@ abstract public class GeckoApp
new AlertDialog.Builder(this)
.setMessage(message)
.setCancelable(false)
.setPositiveButton(getResources().getString(R.string.exit_label),
.setPositiveButton(R.string.exit_label,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id)
{
GeckoApp.this.finish();
System.exit(0);
}
}).show();
}
@ -222,6 +223,25 @@ abstract public class GeckoApp
surfaceView.mSplashStatusMsg =
getResources().getString(R.string.splash_screen_label);
mLibLoadThread.start();
// We don't currently support devices with less than 256Mb of RAM, warn on first run
if (Runtime.getRuntime().totalMemory() <= 262144L && !new File(sGREDir, "application.ini").exists()) {
new AlertDialog.Builder(this)
.setMessage(R.string.incompatable_device)
.setCancelable(false)
.setPositiveButton(R.string.continue_label, null)
.setNegativeButton(R.string.exit_label,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id)
{
GeckoApp.this.finish();
System.exit(0);
}
})
.show();
}
}
@Override

Просмотреть файл

@ -13,3 +13,6 @@
<!ENTITY crash_restart_label "Restart &brandShortName;">
<!ENTITY sending_crash_report "Sending crash report\u2026">
<!ENTITY exit_label "Exit">
<!ENTITY incompatable_device "&brandShortName; does not support this device and you may experience
problems.">
<!ENTITY continue_label "Continue">

Просмотреть файл

@ -19,4 +19,6 @@
<string name="crash_restart_label">&crash_restart_label;</string>
<string name="sending_crash_report">&sending_crash_report;</string>
<string name="exit_label">&exit_label;</string>
<string name="incompatable_device">&incompatable_device;</string>
<string name="continue_label">&continue_label;</string>
</resources>