Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1500804c authored by luanzhuang's avatar luanzhuang Committed by zhuang luan
Browse files

Cache w.canReceiveKeys().



Bug: none
Flag: EXEMPT minor optimization

Change-Id: I46f503c8ed43c46438751cb27c11b42729d2e7e5
Signed-off-by: default avatarluanzhuang <luanzhuang@xiaomi.corp-partner.google.com>
parent aee9a780
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -835,11 +835,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
     */
    private final ToBooleanFunction<WindowState> mFindFocusedWindow = w -> {
        final ActivityRecord focusedApp = mFocusedApp;
        final boolean canReceiveKeys = w.canReceiveKeys();
        ProtoLog.v(WM_DEBUG_FOCUS, "Looking for focus: %s, flags=%d, canReceive=%b, reason=%s",
                w, w.mAttrs.flags, w.canReceiveKeys(),
                w, w.mAttrs.flags, canReceiveKeys,
                w.canReceiveKeysReason(false /* fromUserTouch */));

        if (!w.canReceiveKeys()) {
        if (!canReceiveKeys) {
            return false;
        }