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

Commit a10e2189 authored by Charles Chen's avatar Charles Chen Committed by Android (Google) Code Review
Browse files

Merge "Avoid IMS uses overridden configuration" into main

parents 9fd72556 b95199a2
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -165,7 +165,8 @@ public class WindowTokenClient extends Binder {
            Log.d(TAG, "Configuration not dispatch to IME because configuration is up"
                    + " to date. Current config=" + context.getResources().getConfiguration()
                    + ", reported config=" + currentConfig
                    + ", updated config=" + newConfig);
                    + ", updated config=" + newConfig
                    + ", updated display ID=" + newDisplayId);
        }
        // Update display first. In case callers want to obtain display information(
        // ex: DisplayMetrics) in #onConfigurationChanged callback.
@@ -190,13 +191,18 @@ public class WindowTokenClient extends Binder {
            if (mShouldDumpConfigForIme) {
                if (!shouldReportConfigChange) {
                    Log.d(TAG, "Only apply configuration update to Resources because "
                            + "shouldReportConfigChange is false.\n" + Debug.getCallers(5));
                            + "shouldReportConfigChange is false. "
                            + "context=" + context
                            + ", config=" + context.getResources().getConfiguration()
                            + ", display ID=" + context.getDisplayId() + "\n"
                            + Debug.getCallers(5));
                } else if (diff == 0) {
                    Log.d(TAG, "Configuration not dispatch to IME because configuration has no "
                            + " public difference with updated config. "
                            + " Current config=" + context.getResources().getConfiguration()
                            + ", reported config=" + currentConfig
                            + ", updated config=" + newConfig);
                            + ", updated config=" + newConfig
                            + ", display ID=" + context.getDisplayId());
                }
            }
        }
+0 −23
Original line number Diff line number Diff line
@@ -5682,29 +5682,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        throw e;
    }

    /**
     * Sets the corresponding {@link DisplayArea} information for the process global
     * configuration. To be called when we need to show IME on a different {@link DisplayArea}
     * or display.
     *
     * @param pid The process id associated with the IME window.
     * @param imeContainer The DisplayArea that contains the IME window.
     */
    void onImeWindowSetOnDisplayArea(final int pid, @NonNull final DisplayArea imeContainer) {
        if (pid == MY_PID || pid < 0) {
            ProtoLog.w(WM_DEBUG_CONFIGURATION,
                    "Trying to update display configuration for system/invalid process.");
            return;
        }
        final WindowProcessController process = mProcessMap.getProcess(pid);
        if (process == null) {
            ProtoLog.w(WM_DEBUG_CONFIGURATION, "Trying to update display "
                    + "configuration for invalid process, pid=%d", pid);
            return;
        }
        process.registerDisplayAreaConfigurationListener(imeContainer);
    }

    @Override
    public void setRunningRemoteTransitionDelegate(IApplicationThread delegate) {
        final TransitionController controller = getTransitionController();
+0 −5
Original line number Diff line number Diff line
@@ -4171,11 +4171,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
     */
    void setInputMethodWindowLocked(WindowState win) {
        mInputMethodWindow = win;
        // Update display configuration for IME process.
        if (mInputMethodWindow != null) {
            final int imePid = mInputMethodWindow.mSession.mPid;
            mAtmService.onImeWindowSetOnDisplayArea(imePid, mImeWindowsContainer);
        }
        mInsetsStateController.getImeSourceProvider().setWindowContainer(win,
                mDisplayPolicy.getImeSourceFrameProvider(), null);
        computeImeTarget(true /* updateImeTarget */);
+0 −10
Original line number Diff line number Diff line
@@ -1068,16 +1068,6 @@ public class DisplayContentTests extends WindowTestsBase {
                mDisplayContent.getImeTarget(IME_TARGET_LAYERING));
    }

    @SetupWindows(addWindows = W_INPUT_METHOD)
    @Test
    public void testInputMethodSet_listenOnDisplayAreaConfigurationChanged() {
        spyOn(mAtm);
        mDisplayContent.setInputMethodWindowLocked(mImeWindow);

        verify(mAtm).onImeWindowSetOnDisplayArea(
                mImeWindow.mSession.mPid, mDisplayContent.getImeContainer());
    }

    @Test
    public void testAllowsTopmostFullscreenOrientation() {
        final DisplayContent dc = createNewDisplay();