Bug 906041 - Part 2: Dismiss editing mode if the user is loading a URL from an external app. r=lucasr, a=lsblakk
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 17 Sep 2013 09:14:00 -0400
changeset 155405 3a26eee37c0d
parent 155404 de6a9e752331
child 155406 73a6fb82f2a8
push id4271
push userryanvm@gmail.com
push dateThu, 19 Sep 2013 17:54:57 +0000
treeherdermozilla-aurora@3a26eee37c0d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, lsblakk
bugs906041
milestone26.0a2
Bug 906041 - Part 2: Dismiss editing mode if the user is loading a URL from an external app. r=lucasr, a=lsblakk
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -2132,17 +2132,28 @@ abstract public class BrowserApp extends
 
         String action = intent.getAction();
 
         if (AppConstants.MOZ_ANDROID_BEAM && Build.VERSION.SDK_INT >= 10 && NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {
             String uri = intent.getDataString();
             GeckoAppShell.sendEventToGecko(GeckoEvent.createURILoadEvent(uri));
         }
 
-        if (!Intent.ACTION_MAIN.equals(action) || !mInitialized) {
+        if (!mInitialized) {
+            return;
+        }
+
+        // Dismiss editing mode if the user is loading a URL from an external app.
+        if (Intent.ACTION_VIEW.equals(action)) {
+            dismissEditingMode();
+            return;
+        }
+
+        // Only solicit feedback when the app has been launched from the icon shortcut.
+        if (!Intent.ACTION_MAIN.equals(action)) {
             return;
         }
 
         (new UiAsyncTask<Void, Void, Boolean>(ThreadUtils.getBackgroundHandler()) {
             @Override
             public synchronized Boolean doInBackground(Void... params) {
                 // Check to see how many times the app has been launched.
                 SharedPreferences settings = getPreferences(Activity.MODE_PRIVATE);