Bug 1423566 - Hide tabs tray when receiving an Assist App intent. r?nechen
We're still somewhat undecided on how to exactly handle external intents
arriving while the tabs tray is open, however in the case of Assist App intents
- opening a new tab in editing mode while the tabs tray remains open causes some
weird behaviour (the keyboard appears in front of the tabs tray and no matter
which tab is selected on the tabs tray, you first enter editing mode and then
always end up in the tab opened by the Assist App intent)
- the goal of our Assist App intent handling is to allow the user to enter a
search query or an address into the URL bar
hence we should hide the tabs tray (if open) when handling such an intent.
MozReview-Commit-ID: GpwrscdNjZP
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -1781,16 +1781,17 @@ public abstract class GeckoApp extends G
if (isFirstTab) {
flags |= Tabs.LOADURL_FIRST_AFTER_ACTIVITY_UNHIDDEN;
}
Tabs.getInstance().loadUrlWithIntentExtras(url, intent, flags);
}
});
} else if (Intent.ACTION_ASSIST.equals(action)) {
Tabs.getInstance().addTab(Tabs.LOADURL_START_EDITING | Tabs.LOADURL_EXTERNAL);
+ autoHideTabs();
} else if (ACTION_HOMESCREEN_SHORTCUT.equals(action)) {
final GeckoBundle data = new GeckoBundle(2);
data.putString("uri", uri);
data.putString("flags", "OPEN_SWITCHTAB");
getAppEventDispatcher().dispatch("Tab:OpenUri", data);
} else if (Intent.ACTION_SEARCH.equals(action)) {
final GeckoBundle data = new GeckoBundle(2);
data.putString("uri", uri);