Loading core/java/android/view/ViewRootImpl.java +40 −38 Original line number Diff line number Diff line Loading @@ -3799,9 +3799,45 @@ public final class ViewRootImpl implements ViewParent, } if (mAdded) { profileRendering(hasWindowFocus); dispatchFocusEvent(hasWindowFocus); // Note: must be done after the focus change callbacks, // so all of the view state is set up correctly. mImeFocusController.onPostWindowFocus( getFocusedViewOrNull(), hasWindowFocus, mWindowAttributes); if (hasWindowFocus) { if (mAttachInfo.mThreadedRenderer != null && mSurface.isValid()) { // Clear the forward bit. We can just do this directly, since // the window manager doesn't care about it. mWindowAttributes.softInputMode &= ~WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION; ((WindowManager.LayoutParams) mView.getLayoutParams()) .softInputMode &= ~WindowManager.LayoutParams .SOFT_INPUT_IS_FORWARD_NAVIGATION; // Refocusing a window that has a focused view should fire a // focus event for the view since the global focused view changed. fireAccessibilityFocusEventIfHasFocusedNode(); } else { if (mPointerCapture) { handlePointerCaptureChanged(false); } } } mFirstInputStage.onWindowFocusChanged(hasWindowFocus); // NOTE: there's no view visibility (appeared / disapparead) events when the windows focus // is lost, so we don't need to to force a flush - there might be other events such as // text changes, but these should be flushed independently. if (hasWindowFocus) { handleContentCaptureFlush(); } } private void dispatchFocusEvent(boolean hasWindowFocus) { profileRendering(hasWindowFocus); if (hasWindowFocus && mAttachInfo.mThreadedRenderer != null && mSurface.isValid()) { mFullRedrawNeeded = true; try { final Rect surfaceInsets = mWindowAttributes.surfaceInsets; Loading @@ -3823,7 +3859,6 @@ public final class ViewRootImpl implements ViewParent, return; } } } mAttachInfo.mHasWindowFocus = hasWindowFocus; mImeFocusController.updateImeFocusable(mWindowAttributes, true /* force */); Loading @@ -3837,39 +3872,6 @@ public final class ViewRootImpl implements ViewParent, mAttachInfo.mTooltipHost.hideTooltip(); } } // Note: must be done after the focus change callbacks, // so all of the view state is set up correctly. mImeFocusController.onPostWindowFocus( getFocusedViewOrNull(), hasWindowFocus, mWindowAttributes); if (hasWindowFocus) { // Clear the forward bit. We can just do this directly, since // the window manager doesn't care about it. mWindowAttributes.softInputMode &= ~WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION; ((WindowManager.LayoutParams) mView.getLayoutParams()) .softInputMode &= ~WindowManager.LayoutParams .SOFT_INPUT_IS_FORWARD_NAVIGATION; // Refocusing a window that has a focused view should fire a // focus event for the view since the global focused view changed. fireAccessibilityFocusEventIfHasFocusedNode(); } else { if (mPointerCapture) { handlePointerCaptureChanged(false); } } } mFirstInputStage.onWindowFocusChanged(hasWindowFocus); // NOTE: there's no view visibility (appeared / disapparead) events when the windows focus // is lost, so we don't need to to force a flush - there might be other events such as // text changes, but these should be flushed independently. if (hasWindowFocus) { handleContentCaptureFlush(); } } private void handleWindowTouchModeChanged() { Loading Loading
core/java/android/view/ViewRootImpl.java +40 −38 Original line number Diff line number Diff line Loading @@ -3799,9 +3799,45 @@ public final class ViewRootImpl implements ViewParent, } if (mAdded) { profileRendering(hasWindowFocus); dispatchFocusEvent(hasWindowFocus); // Note: must be done after the focus change callbacks, // so all of the view state is set up correctly. mImeFocusController.onPostWindowFocus( getFocusedViewOrNull(), hasWindowFocus, mWindowAttributes); if (hasWindowFocus) { if (mAttachInfo.mThreadedRenderer != null && mSurface.isValid()) { // Clear the forward bit. We can just do this directly, since // the window manager doesn't care about it. mWindowAttributes.softInputMode &= ~WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION; ((WindowManager.LayoutParams) mView.getLayoutParams()) .softInputMode &= ~WindowManager.LayoutParams .SOFT_INPUT_IS_FORWARD_NAVIGATION; // Refocusing a window that has a focused view should fire a // focus event for the view since the global focused view changed. fireAccessibilityFocusEventIfHasFocusedNode(); } else { if (mPointerCapture) { handlePointerCaptureChanged(false); } } } mFirstInputStage.onWindowFocusChanged(hasWindowFocus); // NOTE: there's no view visibility (appeared / disapparead) events when the windows focus // is lost, so we don't need to to force a flush - there might be other events such as // text changes, but these should be flushed independently. if (hasWindowFocus) { handleContentCaptureFlush(); } } private void dispatchFocusEvent(boolean hasWindowFocus) { profileRendering(hasWindowFocus); if (hasWindowFocus && mAttachInfo.mThreadedRenderer != null && mSurface.isValid()) { mFullRedrawNeeded = true; try { final Rect surfaceInsets = mWindowAttributes.surfaceInsets; Loading @@ -3823,7 +3859,6 @@ public final class ViewRootImpl implements ViewParent, return; } } } mAttachInfo.mHasWindowFocus = hasWindowFocus; mImeFocusController.updateImeFocusable(mWindowAttributes, true /* force */); Loading @@ -3837,39 +3872,6 @@ public final class ViewRootImpl implements ViewParent, mAttachInfo.mTooltipHost.hideTooltip(); } } // Note: must be done after the focus change callbacks, // so all of the view state is set up correctly. mImeFocusController.onPostWindowFocus( getFocusedViewOrNull(), hasWindowFocus, mWindowAttributes); if (hasWindowFocus) { // Clear the forward bit. We can just do this directly, since // the window manager doesn't care about it. mWindowAttributes.softInputMode &= ~WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION; ((WindowManager.LayoutParams) mView.getLayoutParams()) .softInputMode &= ~WindowManager.LayoutParams .SOFT_INPUT_IS_FORWARD_NAVIGATION; // Refocusing a window that has a focused view should fire a // focus event for the view since the global focused view changed. fireAccessibilityFocusEventIfHasFocusedNode(); } else { if (mPointerCapture) { handlePointerCaptureChanged(false); } } } mFirstInputStage.onWindowFocusChanged(hasWindowFocus); // NOTE: there's no view visibility (appeared / disapparead) events when the windows focus // is lost, so we don't need to to force a flush - there might be other events such as // text changes, but these should be flushed independently. if (hasWindowFocus) { handleContentCaptureFlush(); } } private void handleWindowTouchModeChanged() { Loading