Bug 880650 - Clean up hiding/showing VKB in the awesome screen. r=cpeterson
☠☠ backed out by c9f80387acd7 ☠ ☠
authorJim Chen <nchen@mozilla.com>
Tue, 11 Jun 2013 21:41:22 -0400
changeset 146223 9f76571216ff3ef1e4aaefa64b9458313cdeec75
parent 146222 2ccb9ec11a9f217a87ba87a2b75eee47dca81668
child 146224 e78d02f5e0f63fa426f3ba4eba6cf4c78181bbc0
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)
reviewerscpeterson
bugs880650
milestone24.0a1
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
Bug 880650 - Clean up hiding/showing VKB in the awesome screen. r=cpeterson
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="stateAlwaysVisible|adjustResize"/>
+                  android:windowSoftInputMode="stateUnspecified|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,18 +116,16 @@ 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));
@@ -141,17 +139,16 @@ 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);
@@ -215,17 +212,18 @@ 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);
                 }
             }
         });
@@ -466,18 +464,16 @@ 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,17 +11,16 @@ 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,17 +36,16 @@
           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"