diff options
Diffstat (limited to 'core/java/android/view/ViewRoot.java')
-rw-r--r-- | core/java/android/view/ViewRoot.java | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index de64d0e..3cfaf1b 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -143,7 +143,6 @@ public final class ViewRoot extends Handler implements ViewParent, boolean mFullRedrawNeeded; boolean mNewSurfaceNeeded; boolean mHasHadWindowFocus; - boolean mLastWasImTarget; boolean mWindowAttributesChanged = false; @@ -999,21 +998,6 @@ public final class ViewRoot extends Handler implements ViewParent, mNewSurfaceNeeded = false; mViewVisibility = viewVisibility; - if (mAttachInfo.mHasWindowFocus) { - final boolean imTarget = WindowManager.LayoutParams - .mayUseInputMethod(mWindowAttributes.flags); - if (imTarget != mLastWasImTarget) { - mLastWasImTarget = imTarget; - InputMethodManager imm = InputMethodManager.peekInstance(); - if (imm != null && imTarget) { - imm.startGettingWindowFocus(mView); - imm.onWindowFocus(mView, mView.findFocus(), - mWindowAttributes.softInputMode, - !mHasHadWindowFocus, mWindowAttributes.flags); - } - } - } - boolean cancelDraw = attachInfo.mTreeObserver.dispatchOnPreDraw(); if (!cancelDraw && !newSurface) { @@ -1192,7 +1176,7 @@ public final class ViewRoot extends Handler implements ViewParent, // properly re-composite its drawing on a transparent // background. This automatically respects the clip/dirty region if (!canvas.isOpaque()) { - canvas.drawColor(0x00000000, PorterDuff.Mode.CLEAR); + canvas.drawColor(0xff0000ff, PorterDuff.Mode.CLEAR); } else if (yoff != 0) { // If we are applying an offset, we need to clear the area // where the offset doesn't appear to avoid having garbage @@ -1624,13 +1608,10 @@ public final class ViewRoot extends Handler implements ViewParent, } } - mLastWasImTarget = WindowManager.LayoutParams - .mayUseInputMethod(mWindowAttributes.flags); - InputMethodManager imm = InputMethodManager.peekInstance(); if (mView != null) { - if (hasWindowFocus && imm != null && mLastWasImTarget) { - imm.startGettingWindowFocus(mView); + if (hasWindowFocus && imm != null) { + imm.startGettingWindowFocus(); } mView.dispatchWindowFocusChanged(hasWindowFocus); } @@ -1638,7 +1619,7 @@ public final class ViewRoot extends Handler implements ViewParent, // Note: must be done after the focus change callbacks, // so all of the view state is set up correctly. if (hasWindowFocus) { - if (imm != null && mLastWasImTarget) { + if (imm != null) { imm.onWindowFocus(mView, mView.findFocus(), mWindowAttributes.softInputMode, !mHasHadWindowFocus, mWindowAttributes.flags); @@ -1995,9 +1976,6 @@ public final class ViewRoot extends Handler implements ViewParent, if (event.getAction() != KeyEvent.ACTION_DOWN) { return false; } - if ((event.getFlags()&KeyEvent.FLAG_KEEP_TOUCH_MODE) != 0) { - return false; - } // only relevant if we are in touch mode if (!mAttachInfo.mInTouchMode) { @@ -2117,7 +2095,8 @@ public final class ViewRoot extends Handler implements ViewParent, // If it is possible for this window to interact with the input // method window, then we want to first dispatch our key events // to the input method. - if (mLastWasImTarget) { + if (WindowManager.LayoutParams.mayUseInputMethod( + mWindowAttributes.flags)) { InputMethodManager imm = InputMethodManager.peekInstance(); if (imm != null && mView != null) { int seq = enqueuePendingEvent(event, sendDone); @@ -2147,10 +2126,6 @@ public final class ViewRoot extends Handler implements ViewParent, sWindowSession.finishKey(mWindow); } catch (RemoteException e) { } - } else { - Log.w("ViewRoot", "handleFinishedEvent(seq=" + seq - + " handled=" + handled + " ev=" + event - + ") neither delivering nor finishing key"); } } } @@ -2473,8 +2448,6 @@ public final class ViewRoot extends Handler implements ViewParent, final ViewRoot viewRoot = mViewRoot.get(); if (viewRoot != null) { viewRoot.dispatchKey(event); - } else { - Log.w("ViewRoot.W", "Key event " + event + " but no ViewRoot available!"); } } |