Bug 644613 - NPE in setComposingText when using VKB. r=mwu a=bsmedberg
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 13 Apr 2011 15:09:51 -0700
changeset 68036 5eb3152040936ef146c8f0ac08b4ba536e707e42
parent 68035 8ed51ba58b0813dad7808223c4b0d09abb7cde0e
child 68038 846bd98c5fe42de2c5f104c4c4294fd855379971
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwu, bsmedberg
bugs644613
milestone5.0a2
Bug 644613 - NPE in setComposingText when using VKB. r=mwu a=bsmedberg
embedding/android/GeckoInputConnection.java
--- a/embedding/android/GeckoInputConnection.java
+++ b/embedding/android/GeckoInputConnection.java
@@ -152,17 +152,17 @@ public class GeckoInputConnection
             // Set style to none
             GeckoAppShell.sendEventToGecko(
                 new GeckoEvent(0, mComposingText.length(),
                                GeckoEvent.IME_RANGE_RAWINPUT, 0, 0, 0,
                                mComposingText));
             GeckoAppShell.sendEventToGecko(
                 new GeckoEvent(GeckoEvent.IME_COMPOSITION_END, 0, 0));
             mComposing = false;
-            mComposingText = null;
+            mComposingText = "";
 
             // Make sure caret stays at the same position
             GeckoAppShell.sendEventToGecko(
                 new GeckoEvent(GeckoEvent.IME_SET_SELECTION,
                                mCompositionStart + mCompositionSelStart, 0));
         }
         return true;
     }
@@ -527,17 +527,17 @@ public class GeckoInputConnection
         int maxLen = GeckoApp.surfaceView.mEditable.length();
         Selection.setSelection(GeckoApp.surfaceView.mEditable, 
                                Math.min(start, maxLen),
                                Math.min(end, maxLen));
     }
 
     public void reset() {
         mComposing = false;
-        mComposingText = null;
+        mComposingText = "";
         mUpdateRequest = null;
     }
 
     // TextWatcher
     public void onTextChanged(CharSequence s, int start, int before, int count)
     {
         GeckoAppShell.sendEventToGecko(
             new GeckoEvent(GeckoEvent.IME_SET_SELECTION, start, before));
@@ -573,17 +573,17 @@ public class GeckoInputConnection
 
     public void beforeTextChanged(CharSequence s, int start, int count, int after)
     {
     }
 
     // Is a composition active?
     boolean mComposing;
     // Composition text when a composition is active
-    String mComposingText;
+    String mComposingText = "";
     // Start index of the composition within the text body
     int mCompositionStart;
     /* During a composition, we should not alter the real selection,
         therefore we keep our own offsets to emulate selection */
     // Start of fake selection, relative to start of composition
     int mCompositionSelStart;
     // Length of fake selection
     int mCompositionSelLen;