Back out 9f76571216ff (bug 880650) for test failures
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 11 Jun 2013 20:43:00 -0700
changeset 146230 c9f80387acd7948c4419d4854be6320e4f24ba50
parent 146229 e856b38719c196bdbd73c00e6c7e804df4e86c06
child 146231 6a04dea9817f5af2f5f236d441c7f1fdc6393eb6
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs880650
milestone24.0a1
backs out9f76571216ff3ef1e4aaefa64b9458313cdeec75
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
Back out 9f76571216ff (bug 880650) for test failures CLOSED TREE
mobile/android/base/AndroidManifest.xml.in
mobile/android/base/AwesomeBar.java
mobile/android/base/AwesomeBarTabs.java
mobile/android/base/resources/layout/awesomebar_search.xml
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -223,17 +223,17 @@
             <intent-filter>
                 <action android:name="org.mozilla.gecko.PLAY_VIDEO" />
             </intent-filter>
         </activity>
 
         <activity android:name="org.mozilla.gecko.AwesomeBar"
                   android:theme="@style/Gecko.AwesomeBar"
                   android:configChanges="orientation|screenSize"
-                  android:windowSoftInputMode="stateUnspecified|adjustResize"/>
+                  android:windowSoftInputMode="stateAlwaysVisible|adjustResize"/>
 
         <activity android:name="org.mozilla.gecko.GeckoPreferences"
                   android:theme="@style/Gecko.Preferences"
                   android:label="@string/settings_title"
                   android:configChanges="orientation|screenSize"
                   android:excludeFromRecents="true"/>
 
         <provider android:name="org.mozilla.gecko.db.BrowserProvider"
--- a/mobile/android/base/AwesomeBar.java
+++ b/mobile/android/base/AwesomeBar.java
@@ -116,16 +116,18 @@ public class AwesomeBar extends GeckoAct
             @Override
             public void onEditSuggestion(final String text) {
                 ThreadUtils.postToUiThread(new Runnable() {
                     @Override
                     public void run() {
                         mText.setText(text);
                         mText.setSelection(mText.getText().length());
                         mText.requestFocus();
+                        InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+                        imm.showSoftInput(mText, InputMethodManager.SHOW_IMPLICIT);
                     }
                 });
             }
 
             @Override
             public void onSwitchToTab(final int tabId) {
                 Intent resultIntent = new Intent();
                 resultIntent.putExtra(TAB_KEY, Integer.toString(tabId));
@@ -139,16 +141,17 @@ public class AwesomeBar extends GeckoAct
                 openUserEnteredAndFinish(mText.getText().toString());
             }
         });
 
         Intent intent = getIntent();
         String currentUrl = intent.getStringExtra(CURRENT_URL_KEY);
         if (currentUrl != null) {
             mText.setText(currentUrl);
+            mText.selectAll();
         }
 
         mTarget = intent.getStringExtra(TARGET_KEY);
         if (mTarget.equals(Target.CURRENT_TAB.name())) {
             Tab tab = Tabs.getInstance().getSelectedTab();
             if (tab != null && tab.isPrivate()) {
                 BrowserToolbarBackground mAddressBarBg = (BrowserToolbarBackground) findViewById(R.id.address_bar_bg);
                 mAddressBarBg.setPrivateMode(true);
@@ -212,18 +215,17 @@ public class AwesomeBar extends GeckoAct
 
         mText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
             @Override
             public void onFocusChange(View v, boolean hasFocus) {
                 if (v == null || hasFocus) {
                     return;
                 }
 
-                InputMethodManager imm = (InputMethodManager)
-                    getSystemService(Context.INPUT_METHOD_SERVICE);
+                InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                 try {
                     imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
                 } catch (NullPointerException e) {
                     Log.e(LOGTAG, "InputMethodManagerService, why are you throwing"
                                   + " a NullPointerException? See bug 782096", e);
                 }
             }
         });
@@ -464,16 +466,18 @@ public class AwesomeBar extends GeckoAct
             keyCode == KeyEvent.KEYCODE_DPAD_CENTER ||
             keyCode == KeyEvent.KEYCODE_DEL ||
             keyCode == KeyEvent.KEYCODE_VOLUME_UP ||
             keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
             return super.onKeyDown(keyCode, event);
         } else if (keyCode == KeyEvent.KEYCODE_SEARCH) {
              mText.setText("");
              mText.requestFocus();
+             InputMethodManager imm = (InputMethodManager) mText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+             imm.showSoftInput(mText, InputMethodManager.SHOW_IMPLICIT);
              return true;
         } else {
             int prevSelStart = mText.getSelectionStart();
             int prevSelEnd = mText.getSelectionEnd();
 
             // Manually dispatch the key event to the AwesomeBar. If selection changed as
             // a result of the key event, then give focus back to mText
             mText.dispatchKeyEvent(event);
--- a/mobile/android/base/AwesomeBarTabs.java
+++ b/mobile/android/base/AwesomeBarTabs.java
@@ -11,16 +11,17 @@ import android.graphics.drawable.StateLi
 import android.support.v4.view.PagerAdapter;
 import android.support.v4.view.ViewPager;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
 import android.widget.TabHost;
 import android.widget.TabWidget;
 
 public class AwesomeBarTabs extends TabHost
                             implements LightweightTheme.OnChangeListener { 
     private static final String LOGTAG = "GeckoAwesomeBarTabs";
 
     private Context mContext;
--- a/mobile/android/base/resources/layout/awesomebar_search.xml
+++ b/mobile/android/base/resources/layout/awesomebar_search.xml
@@ -36,16 +36,17 @@
           android:textSelectHandleRight="@drawable/handle_end"
           android:textCursorDrawable="@null"
           android:inputType="textUri|textNoSuggestions"
           android:imeOptions="actionSearch|flagNoExtractUi|flagNoFullscreen"
           android:selectAllOnFocus="true"
           android:singleLine="true"
           android:gravity="center_vertical|left"
           gecko:autoUpdateTheme="false">
+              <requestFocus/>
     </view>
 
     <LinearLayout android:layout_width="4dp"
                   android:layout_height="fill_parent"
                   android:orientation="vertical"
                   android:layout_alignParentRight="true"/>
 
     <ImageButton android:id="@+id/awesomebar_button"