Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Bug 769269 - Show dialog if "Don't keep activities" is enabled r=blas…
Browse files Browse the repository at this point in the history
…sey a=akeybl
  • Loading branch information
thebnich committed Jul 10, 2012
1 parent 264e06d commit d7a4819
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
30 changes: 29 additions & 1 deletion mobile/android/base/GeckoApp.java
Expand Up @@ -1725,7 +1725,35 @@ private void initialize() {
passedUri = "about:empty"; 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) && if (!ACTION_DEBUG.equals(action) &&
checkAndSetLaunchState(LaunchState.Launching, LaunchState.Launched)) { checkAndSetLaunchState(LaunchState.Launching, LaunchState.Launched)) {
sGeckoThread.start(); sGeckoThread.start();
Expand Down
4 changes: 4 additions & 0 deletions mobile/android/base/locales/en-US/android_strings.dtd
Expand Up @@ -125,3 +125,7 @@
<!ENTITY filepicker_audio_title "Choose or record a sound"> <!ENTITY filepicker_audio_title "Choose or record a sound">
<!ENTITY filepicker_image_title "Choose or take a picture"> <!ENTITY filepicker_image_title "Choose or take a picture">
<!ENTITY filepicker_video_title "Choose or record a video"> <!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">
6 changes: 6 additions & 0 deletions mobile/android/base/strings.xml.in
Expand Up @@ -147,4 +147,10 @@


<string name="bookmarkdefaults_title_abouthome">@bookmarks_aboutHome@</string> <string name="bookmarkdefaults_title_abouthome">@bookmarks_aboutHome@</string>
<string name="bookmarkdefaults_url_abouthome">about:home</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> </resources>

0 comments on commit d7a4819

Please sign in to comment.