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

Commit 47410847 authored by Charles Chen's avatar Charles Chen
Browse files

Fix AccessibilityInputFilterTest

The root cause is that we use WM#getCurrentMetrics(New API) instead of
Display#getSize in ViewConfiguration .
However, we use a stub display in AccessibilityInputFilterTest, which
don't have a corresponding DisplayContent in WMS.
Use getDisplayContentOrCreate to create a DisplayContent if it is not
yet created, and throws exception if display object is invalid.

fixes: 148823816
Test: atest AccessibilityInputFilterTest
Test: atest WindowMetricsTests

Change-Id: I36c6b020faafebbf609a46dfdeb0c9580e115e01
parent f8df902c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ public final class WindowManagerImpl implements WindowManager {
                    .setStableInsets(Insets.of(stableInsets))
                    .setDisplayCutout(displayCutout.get()).build();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
        return null;
    }
}
+5 −1
Original line number Diff line number Diff line
@@ -8015,7 +8015,11 @@ public class WindowManagerService extends IWindowManager.Stub
            int displayId, Rect outContentInsets, Rect outStableInsets,
            DisplayCutout.ParcelableWrapper displayCutout) {
        synchronized (mGlobalLock) {
            final DisplayContent dc = mRoot.getDisplayContent(displayId);
            final DisplayContent dc = mRoot.getDisplayContentOrCreate(displayId);
            if (dc == null) {
                throw new WindowManager.InvalidDisplayException("Display#" + displayId
                        + "could not be found!");
            }
            final WindowToken windowToken = dc.getWindowToken(attrs.token);
            final ActivityRecord activity;
            if (windowToken != null && windowToken.asActivityRecord() != null) {