Bug 573153 - Opening links from other apps is broken on Android; error in getMostRecentBookmarkForURI, r=blassey
authorMichael Wu <mwu@mozilla.com>
Tue, 22 Jun 2010 17:13:23 -0700
changeset 44157 e43fc12b3b82771ad191a92a6dcd130fede1d1f2
parent 44156 367e073a2dfe7abedaf87cfc170b32e6c8baeb60
child 44158 7a66915cab32989699f46f04aecf14c141707578
push id13999
push usermwu@mozilla.com
push dateWed, 23 Jun 2010 00:20:15 +0000
treeherdermozilla-central@aa45303615c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs573153
milestone1.9.3a6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 573153 - Opening links from other apps is broken on Android; error in getMostRecentBookmarkForURI, r=blassey
widget/src/android/nsAppShell.cpp
--- a/widget/src/android/nsAppShell.cpp
+++ b/widget/src/android/nsAppShell.cpp
@@ -38,16 +38,17 @@
 
 #include "nsAppShell.h"
 #include "nsWindow.h"
 #include "nsThreadUtils.h"
 #include "nsICommandLineRunner.h"
 #include "nsIObserverService.h"
 #include "nsIAppStartup.h"
 #include "nsIGeolocationProvider.h"
+#include "nsIPrefService.h"
 
 #include "mozilla/Services.h"
 #include "prenv.h"
 
 #include "AndroidBridge.h"
 #include "nsAccelerometerAndroid.h"
 #include <android/log.h>
 #include <pthread.h>
@@ -237,30 +238,32 @@ nsAppShell::ProcessNextNativeEvent(PRBoo
         break;
 
     case AndroidGeckoEvent::ACTIVITY_STOPPING: {
         nsCOMPtr<nsIObserverService> obsServ =
           mozilla::services::GetObserverService();
         NS_NAMED_LITERAL_STRING(context, "shutdown-persist");
         obsServ->NotifyObservers(nsnull, "quit-application-granted", nsnull);
         obsServ->NotifyObservers(nsnull, "quit-application-forced", nsnull);
-        obsServ->NotifyObservers(nsnull, "quit-application", nsnull);
         obsServ->NotifyObservers(nsnull, "profile-change-net-teardown", context.get());
         obsServ->NotifyObservers(nsnull, "profile-change-teardown", context.get());
         obsServ->NotifyObservers(nsnull, "profile-before-change", context.get());
         nsCOMPtr<nsIAppStartup> appSvc = do_GetService("@mozilla.org/toolkit/app-startup;1");
         if (appSvc)
             appSvc->Quit(nsIAppStartup::eForceQuit);
         break;
     }
 
     case AndroidGeckoEvent::ACTIVITY_PAUSING: {
-        nsCOMPtr<nsIObserverService> obsServ =
-          mozilla::services::GetObserverService();
-        obsServ->NotifyObservers(nsnull, "profile-before-change", nsnull);
+        // We really want to send a notification like profile-before-change,
+        // but profile-before-change ends up shutting some things down instead
+        // of flushing data
+        nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
+        if (prefs)
+            prefs->SavePrefFile(nsnull);
 
         // The OS is sending us to the background, block this thread until 
         // onResume is called to signal that we're back in the foreground
         PR_WaitCondVar(mPaused, PR_INTERVAL_NO_TIMEOUT);
         break;
     }
 
     case AndroidGeckoEvent::LOAD_URI: {