/** Disconnect any existing input connection, clearing the served view. */
  void finishInputLocked() {
    mNextServedView = null;
    if (mServedView != null) {
      if (DEBUG) Log.v(TAG, "FINISH INPUT: " + mServedView);

      if (mCurrentTextBoxAttribute != null) {
        try {
          mService.finishInput(mClient);
        } catch (RemoteException e) {
        }
      }

      if (mServedInputConnection != null) {
        // We need to tell the previously served view that it is no
        // longer the input target, so it can reset its state.  Schedule
        // this call on its window's Handler so it will be on the correct
        // thread and outside of our lock.
        Handler vh = mServedView.getHandler();
        if (vh != null) {
          // This will result in a call to reportFinishInputConnection()
          // below.
          vh.sendMessage(
              vh.obtainMessage(ViewRoot.FINISH_INPUT_CONNECTION, mServedInputConnection));
        }
      }

      mServedView = null;
      mCompletions = null;
      mServedConnecting = false;
      clearConnectionLocked();
    }
  }
 /** Reset all of the state associated with being bound to an input method. */
 void clearBindingLocked() {
   clearConnectionLocked();
   mBindSequence = -1;
   mCurId = null;
   mCurMethod = null;
 }