Bug 906041 - (Part 2) Dismiss editing mode if the user is loading a URL from an external app. r=lucasr
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 17 Sep 2013 09:14:00 -0400
changeset 147395 68a3dd6385c0
parent 147394 a61effc0c5c5
child 147396 dea697e42d70
push id2693
push usermleibovic@mozilla.com
push dateTue, 17 Sep 2013 13:14:34 +0000
treeherderfx-team@dea697e42d70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs906041
milestone26.0a1
Bug 906041 - (Part 2) Dismiss editing mode if the user is loading a URL from an external app. r=lucasr
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);