Bug 698114 - Don't rebuild the app on orientation changes. r=blassey
authorWes Johnston <wjohnston@mozilla.com>
Mon, 31 Oct 2011 15:03:37 -0700
changeset 81702 7203d86d586839deaedb9b520bf3fd897f884659
parent 81701 87f63a09a74ee8ce131fa7a5e4b9a163332d9dc2
child 81703 e3b8b39807507f31cdcf92d828d44f53cf403779
push idunknown
push userunknown
push dateunknown
reviewersblassey
bugs698114
milestone10.0a1
Bug 698114 - Don't rebuild the app on orientation changes. r=blassey
embedding/android/AndroidManifest.xml.in
embedding/android/GeckoApp.java
embedding/android/PromptService.java
--- a/embedding/android/AndroidManifest.xml.in
+++ b/embedding/android/AndroidManifest.xml.in
@@ -39,17 +39,17 @@
 #if MOZILLA_OFFICIAL
 		 android:debuggable="false">
 #else
 		 android:debuggable="true">
 #endif
 
         <activity android:name="App"
                   android:label="@MOZ_APP_DISPLAYNAME@"
-                  android:configChanges="keyboard|keyboardHidden|mcc|mnc"
+                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation"
                   android:windowSoftInputMode="stateUnspecified|adjustResize"
                   android:launchMode="singleTask"
                   android:theme="@style/GreyTheme">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
 
--- a/embedding/android/GeckoApp.java
+++ b/embedding/android/GeckoApp.java
@@ -1271,22 +1271,16 @@ abstract public class GeckoApp
         // Undo whatever we did in onPause.
         super.onResume();
 
         // Just in case. Normally we start in onNewIntent
         if (checkLaunchState(LaunchState.Launching))
             onNewIntent(getIntent());
 
         registerReceiver(mConnectivityReceiver, mConnectivityFilter);
-
-        GeckoAppShell.getHandler().post(new Runnable() {
-            public void run() {
-                GeckoAppShell.getPromptService().onResume();
-            }
-        });
     }
 
     @Override
     public void onStop()
     {
         Log.i(LOG_NAME, "stop");
         // We're about to be stopped, potentially in preparation for
         // being destroyed.  We're killable after this point -- as I
@@ -1326,22 +1320,16 @@ abstract public class GeckoApp
     {
         Log.i(LOG_NAME, "destroy");
 
         // Tell Gecko to shutting down; we'll end up calling System.exit()
         // in onXreExit.
         if (isFinishing())
             GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_SHUTDOWN));
 
-        GeckoAppShell.getHandler().post(new Runnable() {
-            public void run() {
-                GeckoAppShell.getPromptService().onDestroy();
-            }
-        });
-       
         if (mTabsTray != null && mTabsTray.isShowing()) {
             hideTabs();
             mTabsTray = null;
         }
         
         GeckoAppShell.unregisterGeckoEventListener("DOMContentLoaded", GeckoApp.mAppContext);
         GeckoAppShell.unregisterGeckoEventListener("DOMTitleChanged", GeckoApp.mAppContext);
         GeckoAppShell.unregisterGeckoEventListener("DOMLinkAdded", GeckoApp.mAppContext);
--- a/embedding/android/PromptService.java
+++ b/embedding/android/PromptService.java
@@ -232,26 +232,16 @@ public class PromptService implements On
             builder.setNegativeButton(aButtons[2].label, this);
         }
 
         mDialog = builder.create();
         mDialog.setOnCancelListener(this);
         mDialog.show();
     }
 
-    public void onDestroy() {
-        if (mDialog != null)
-            mDialog.dismiss();
-    }
-
-    public void onResume() {
-        if (mDialog != null)
-            mDialog.show();
-    }
-
     public void onClick(DialogInterface aDialog, int aWhich) {
         JSONObject ret = new JSONObject();
         try {
             int button = -1;
             ListView list = mDialog.getListView();
             if (list != null || mSelected != null) {
                 button = aWhich;
                 if (mSelected != null) {