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

Commit a559286f authored by Bryce Lee's avatar Bryce Lee
Browse files

Make Session package private.

This change requires moving initialization of the mock session until
after the dex flags and mock infrastructure has been set up.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowLayersControllerTests
Change-Id: Icb469d09d8f591da6bb6a81a3741e508a3a03bd5
parent 1eb19a3b
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -68,9 +68,7 @@ import java.util.Set;
 * This class represents an active client session.  There is generally one
 * Session object per process that is interacting with the window manager.
 */
// Needs to be public and not final so we can mock during tests...sucks I know :(
public class Session extends IWindowSession.Stub
        implements IBinder.DeathRecipient {
class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
    final WindowManagerService mService;
    final IWindowSessionCallback mCallback;
    final IInputMethodClient mClient;
+2 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ import java.util.LinkedList;
class WindowTestsBase {
    static WindowManagerService sWm = null;
    private static final IWindow sIWindow = new TestIWindow();
    private static final Session sMockSession = mock(Session.class);
    private static Session sMockSession;
    // The default display is removed in {@link #setUp} and then we iterate over all displays to
    // make sure we don't collide with any existing display. If we run into no other display, the
    // added display should be treated as default. This cannot be the default display
@@ -93,6 +93,7 @@ class WindowTestsBase {
            // Allows to mock package local classes and methods
            System.setProperty("dexmaker.share_classloader", "true");
            MockitoAnnotations.initMocks(this);
            sMockSession = mock(Session.class);
        }

        final Context context = InstrumentationRegistry.getTargetContext();