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

Commit aee2a216 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Reduce unnecessary string operation for input info

WindowState#getName always creates a new string that
concatenates hashcode and layout parameter title.
If the title is not changed, it is unnecessary to update
every time for all windows when updating input info.

Bug: 442747045
Flag: EXEMPT Only relevant for logging
Test: Show a dialog. Change the title by Dialog#setTitle
      (which calls WindowManager.LayoutParams#setTitle).
      The new name should be shown in "adb shell dumpsys input".
Change-Id: I2b0c92aea1b73979e6e87198c6b981c02fe72e26
parent e58b13fc
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -259,8 +259,6 @@ final class InputMonitor {
        inputWindowHandle.setPaused(w.mActivityRecord != null && w.mActivityRecord.paused);
        inputWindowHandle.setWindowToken(w.mClient.asBinder());

        inputWindowHandle.setName(w.getName());

        // Update layout params flags to force the window to be not touch modal. We do this to
        // restrict the window's touchable region to the task even if it requests touches outside
        // its window bounds. An example is a dialog in primary split should get touches outside its
+3 −0
Original line number Diff line number Diff line
@@ -2616,6 +2616,9 @@ public class WindowManagerService extends IWindowManager.Stub
            if ((attrChanges & WindowManager.LayoutParams.ALPHA_CHANGED) != 0) {
                winAnimator.mAlpha = attrs.alpha;
            }
            if ((attrChanges & WindowManager.LayoutParams.TITLE_CHANGED) != 0) {
                win.mInputWindowHandle.setName(win.getName());
            }
            win.setWindowScale(win.mRequestedWidth, win.mRequestedHeight);

            if (win.mAttrs.surfaceInsets.left != 0