Reduce use of static variables in window manager unit tests
This was causing test cross-contamination since different test might
expect different states from the variables.
Bug: 37682538
Test: tons of it!
Change-Id: Ie8a1ea400695b6346d7dfa3369b5c44bb467a33d
diff --git a/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java b/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java
index 9392e8e..be53667 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java
@@ -23,7 +23,6 @@
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.doAnswer;
-import android.content.pm.ActivityInfo;
import android.os.PowerSaveState;
import org.mockito.invocation.InvocationOnMock;
@@ -199,7 +198,7 @@
final com.android.server.wm.WindowState window;
final AppWindowToken atoken;
synchronized (sWm.mWindowMap) {
- atoken = WindowTestsBase.sDisplayContent.getAppWindowToken(appToken);
+ atoken = sWm.mRoot.getAppWindowToken(appToken);
window = WindowTestsBase.createWindow(null, TYPE_APPLICATION_STARTING, atoken,
"Starting window");
atoken.startingWindow = window;