Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug 769269 - Show dialog if "Don't keep activities" is enabled r=blas…

…sey a=akeybl
  • Loading branch information...
commit d7a48196d59cc030c4ae2e7afe50c8bce61cf4bd 1 parent 264e06d
@thebnich thebnich authored
View
30 mobile/android/base/GeckoApp.java
@@ -1725,7 +1725,35 @@ private void initialize() {
passedUri = "about:empty";
}
- sGeckoThread = new GeckoThread(intent, passedUri, mRestoreMode);
+ if (sGeckoThread == null) {
+ sGeckoThread = new GeckoThread(intent, passedUri, mRestoreMode);
+ } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle(R.string.ics_dumbness_title);
+ builder.setMessage(R.string.ics_dumbness_message);
+ builder.setPositiveButton(R.string.ics_dumbness_ok, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ final String ACTION = "android.intent.action.MAIN";
+ final String PACKAGE = "com.android.settings";
+ final String CLASS = PACKAGE + ".DevelopmentSettings";
+ Intent intent = new Intent(ACTION);
+ intent.setComponent(new ComponentName(PACKAGE, CLASS));
+ startActivity(intent);
+ }
+ });
+ builder.setNegativeButton(R.string.button_cancel, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ }
+ });
+ AlertDialog dialog = builder.create();
+ dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
+ public void onDismiss(DialogInterface dialog) {
+ System.exit(0);
+ }
+ });
+ dialog.show();
+ }
+
if (!ACTION_DEBUG.equals(action) &&
checkAndSetLaunchState(LaunchState.Launching, LaunchState.Launched)) {
sGeckoThread.start();
View
4 mobile/android/base/locales/en-US/android_strings.dtd
@@ -125,3 +125,7 @@
<!ENTITY filepicker_audio_title "Choose or record a sound">
<!ENTITY filepicker_image_title "Choose or take a picture">
<!ENTITY filepicker_video_title "Choose or record a video">
+
+<!ENTITY ics_dumbness_title "There\'s a Problem">
+<!ENTITY ics_dumbness_message "\&quot;Don\'t keep activities\&quot; is turned on. Please turn it off in Settings > Developer options.">
+<!ENTITY ics_dumbness_ok "Settings">
View
6 mobile/android/base/strings.xml.in
@@ -147,4 +147,10 @@
<string name="bookmarkdefaults_title_abouthome">@bookmarks_aboutHome@</string>
<string name="bookmarkdefaults_url_abouthome">about:home</string>
+
+ <!-- Don't keep activities prompt -->
+ <string name="ics_dumbness_title">&ics_dumbness_title;</string>
+ <string name="ics_dumbness_message">&ics_dumbness_message;</string>
+ <string name="ics_dumbness_ok">&ics_dumbness_ok;</string>
+
</resources>
Please sign in to comment.
Something went wrong with that request. Please try again.