Browser: fix can not search with browser

If the current search engine is not the default engine,
it will finish the current activity but not start a new
activity, this make the user can not search with browser.

If the search engine is a instance of DefaultSearchEngine,
we finish the current activity, otherwise, the activity
should not be finished.

CRs-Fixed: 535416

Change-Id: Ieb323dafea834e47d1c35c1dff929d638c47f31d
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index b35ca04..a58e2a4 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -40,6 +40,8 @@
 import android.webkit.JavascriptInterface;
 
 import com.android.browser.UI.ComboViews;
+import com.android.browser.search.DefaultSearchEngine;
+import com.android.browser.search.SearchEngine;
 import com.android.browser.stub.NullController;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -88,7 +90,9 @@
 
         // If this was a web search request, pass it on to the default web
         // search provider and finish this activity.
-        if (IntentHandler.handleWebSearchIntent(this, null, getIntent())) {
+        SearchEngine searchEngine = BrowserSettings.getInstance().getSearchEngine();
+        boolean result = IntentHandler.handleWebSearchIntent(this, null, getIntent());
+        if (result && (searchEngine instanceof DefaultSearchEngine)) {
             finish();
             return;
         }