Revert "DO NOT MERGE: Move AM/WM unit tests out of FrameworksServicesTests to WmTests"

This reverts commit dee5a4dc2a5a6829e5509fc0e94903e30dcc238f.

Reason for revert: CLs on upstream branch are on hold.

Change-Id: I253294d080efdfd1dbf377812f12880e03dff1f6
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityLaunchParamsModifierTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityLaunchParamsModifierTests.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/am/ActivityLaunchParamsModifierTests.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityLaunchParamsModifierTests.java
index 089dc61..f741c70 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityLaunchParamsModifierTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityLaunchParamsModifierTests.java
@@ -16,16 +16,6 @@
 
 package com.android.server.am;
 
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
-import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
-
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 import android.app.ActivityOptions;
 import android.content.pm.ActivityInfo;
 import android.graphics.Rect;
@@ -34,16 +24,26 @@
 import android.support.test.runner.AndroidJUnit4;
 
 import com.android.server.am.LaunchParamsController.LaunchParams;
-
+import org.junit.runner.RunWith;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
+
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.doAnswer;
+
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
 
 /**
  * Tests for exercising resizing bounds due to activity options.
  *
  * Build/Install/Run:
- *  atest WmTests:ActivityLaunchParamsModifierTests
+ *  atest FrameworksServicesTests:ActivityLaunchParamsModifierTests
  */
 @MediumTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityManagerInternalTest.java b/services/tests/servicestests/src/com/android/server/am/ActivityManagerInternalTest.java
similarity index 93%
rename from services/tests/wmtests/src/com/android/server/am/ActivityManagerInternalTest.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityManagerInternalTest.java
index f393d14..bce87dc 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityManagerInternalTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityManagerInternalTest.java
@@ -33,8 +33,17 @@
 /**
  * Test class for {@link ActivityManagerInternal}.
  *
- * Build/Install/Run:
- *  atest WmTests:ActivityManagerInternalTest
+ * To run the tests, use
+ *
+ * runtest -c com.android.server.am.ActivityManagerInternalTest frameworks-services
+ *
+ * or the following steps:
+ *
+ * Build: m FrameworksServicesTests
+ * Install: adb install -r \
+ *     ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
+ * Run: adb shell am instrument -e class com.android.server.am.ActivityManagerInternalTest -w \
+ *     com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
  */
 @RunWith(AndroidJUnit4.class)
 public class ActivityManagerInternalTest {
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/am/ActivityManagerServiceTest.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
index c41197d..c70d1e1 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
@@ -28,7 +28,6 @@
 import static android.app.ActivityManager.PROCESS_STATE_SERVICE;
 import static android.app.ActivityManager.PROCESS_STATE_TOP;
 import static android.util.DebugUtils.valueToString;
-
 import static com.android.server.am.ActivityManagerInternalTest.CustomThread;
 import static com.android.server.am.ActivityManagerService.DISPATCH_UIDS_CHANGED_UI_MSG;
 import static com.android.server.am.ActivityManagerService.Injector;
@@ -89,8 +88,17 @@
 /**
  * Test class for {@link ActivityManagerService}.
  *
- * Build/Install/Run:
- *  atest WmTests:ActivityManagerServiceTest
+ * To run the tests, use
+ *
+ * runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
+ *
+ * or the following steps:
+ *
+ * Build: m FrameworksServicesTests
+ * Install: adb install -r \
+ *     ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
+ * Run: adb shell am instrument -e class com.android.server.am.ActivityManagerServiceTest -w \
+ *     com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
  */
 @SmallTest
 @RunWith(AndroidJUnit4.class)
@@ -822,4 +830,4 @@
             mRestricted = restricted;
         }
     }
-}
+}
\ No newline at end of file
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityManagerTest.java b/services/tests/servicestests/src/com/android/server/am/ActivityManagerTest.java
similarity index 94%
rename from services/tests/wmtests/src/com/android/server/am/ActivityManagerTest.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityManagerTest.java
index a2f942e..ba25b16 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityManagerTest.java
@@ -18,18 +18,13 @@
 
 import android.app.ActivityManager;
 import android.app.IActivityManager;
-import android.os.RemoteException;
+import android.os.ServiceManager;
 import android.os.UserHandle;
+import android.os.RemoteException;
 import android.test.AndroidTestCase;
 
 import java.util.List;
 
-/**
- * Tests for {@link ActivityManager}.
- *
- * Build/Install/Run:
- *  atest WmTests:ActivityManagerTest
- */
 public class ActivityManagerTest extends AndroidTestCase {
 
     IActivityManager service;
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityRecordTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java
similarity index 96%
rename from services/tests/wmtests/src/com/android/server/am/ActivityRecordTests.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java
index 616cc0f..5ee1c40 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityRecordTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java
@@ -22,7 +22,11 @@
 import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
 import static android.view.Display.DEFAULT_DISPLAY;
 
+import static com.android.server.am.ActivityStack.ActivityState.DESTROYED;
+import static com.android.server.am.ActivityStack.ActivityState.DESTROYING;
+import static com.android.server.am.ActivityStack.ActivityState.FINISHING;
 import static com.android.server.am.ActivityStack.ActivityState.INITIALIZING;
+import static com.android.server.am.ActivityStack.ActivityState.PAUSED;
 import static com.android.server.am.ActivityStack.ActivityState.PAUSING;
 import static com.android.server.am.ActivityStack.ActivityState.STOPPED;
 import static com.android.server.am.ActivityStack.REMOVE_TASK_MODE_MOVING;
@@ -53,16 +57,17 @@
 import android.support.test.runner.AndroidJUnit4;
 import android.util.MutableBoolean;
 
-import org.junit.Before;
-import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
 import org.mockito.invocation.InvocationOnMock;
 
 /**
  * Tests for the {@link ActivityRecord} class.
  *
  * Build/Install/Run:
- *  atest WmTests:com.android.server.am.ActivityRecordTests
+ *  atest FrameworksServicesTests:com.android.server.am.ActivityRecordTests
  */
 @MediumTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityStackSupervisorTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/am/ActivityStackSupervisorTests.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java
index 2209b66..1ce41a6 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityStackSupervisorTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java
@@ -62,7 +62,7 @@
  * Tests for the {@link ActivityStackSupervisor} class.
  *
  * Build/Install/Run:
- *  atest WmTests:ActivityStackSupervisorTests
+ *  atest FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests
  */
 @MediumTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityStackTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/am/ActivityStackTests.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java
index cac264b..01425ed 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityStackTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java
@@ -33,9 +33,13 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.anyInt;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
 
 import android.content.pm.ActivityInfo;
 import android.os.UserHandle;
@@ -43,15 +47,15 @@
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
+import org.junit.runner.RunWith;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
 
 /**
  * Tests for the {@link ActivityStack} class.
  *
  * Build/Install/Run:
- *  atest WmTests:ActivityStackTests
+ *  atest FrameworksServicesTests:com.android.server.am.ActivityStackTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityStartControllerTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStartControllerTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/am/ActivityStartControllerTests.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityStartControllerTests.java
index 37a5a17..7948e4c 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityStartControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStartControllerTests.java
@@ -19,13 +19,6 @@
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
 
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
 import android.content.Intent;
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
@@ -34,8 +27,15 @@
 import com.android.server.am.ActivityStackSupervisor.PendingActivityLaunch;
 import com.android.server.am.ActivityStarter.Factory;
 
-import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.junit.Test;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.times;
 
 import java.util.Random;
 
@@ -43,7 +43,7 @@
  * Tests for the {@link ActivityStartController} class.
  *
  * Build/Install/Run:
- *  atest WmTests:ActivityStartControllerTests
+ *  atest FrameworksServicesTests:ActivityStartControllerTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityStartInterceptorTest.java b/services/tests/servicestests/src/com/android/server/am/ActivityStartInterceptorTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/am/ActivityStartInterceptorTest.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityStartInterceptorTest.java
index 8f2d284..b4b34c5 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityStartInterceptorTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStartInterceptorTest.java
@@ -55,7 +55,7 @@
  * Unit tests for {@link ActivityStartInterceptorTest}.
  *
  * Build/Install/Run:
- *  bit WmTests:ActivityStartInterceptorTest
+ *  bit FrameworksServicesTests:com.android.server.am.ActivityStartInterceptorTest
  */
 @SmallTest
 public class ActivityStartInterceptorTest {
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityStarterTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/am/ActivityStarterTests.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java
index 048df43..1520859 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityStarterTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java
@@ -32,26 +32,10 @@
 import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
 import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
 import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
-import static android.content.Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED;
-
-import static com.android.server.am.ActivityManagerService.ANIMATE;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.anyBoolean;
-import static org.mockito.Mockito.anyInt;
-import static org.mockito.Mockito.anyObject;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
 
 import android.app.ActivityOptions;
 import android.app.IApplicationThread;
+import android.content.ComponentName;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
 import android.content.pm.ActivityInfo.WindowLayout;
@@ -66,18 +50,39 @@
 import android.support.test.runner.AndroidJUnit4;
 import android.view.Gravity;
 
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+import static android.content.Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED;
+import static com.android.server.am.ActivityManagerService.ANIMATE;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyBoolean;
+import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.anyObject;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.times;
+
 import com.android.internal.os.BatteryStatsImpl;
+import com.android.server.am.ActivityStarter.Factory;
 import com.android.server.am.LaunchParamsController.LaunchParamsModifier;
 import com.android.server.am.TaskRecord.TaskRecordFactory;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import java.util.ArrayList;
 
 /**
  * Tests for the {@link ActivityStarter} class.
  *
  * Build/Install/Run:
- *  atest WmTests:ActivityStarterTests
+ *  atest FrameworksServicesTests:ActivityStarterTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/ActivityTestsBase.java b/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/am/ActivityTestsBase.java
rename to services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
index d9a346b..1cd111f 100644
--- a/services/tests/wmtests/src/com/android/server/am/ActivityTestsBase.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
@@ -21,17 +21,21 @@
 import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
 import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
 import static android.view.Display.DEFAULT_DISPLAY;
-
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.anyBoolean;
 import static org.mockito.Mockito.anyInt;
 import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 
 import android.app.ActivityOptions;
+import com.android.server.wm.DisplayWindowController;
+
+import org.junit.Rule;
+import org.mockito.invocation.InvocationOnMock;
+
 import android.app.IApplicationThread;
 import android.content.ComponentName;
 import android.content.Context;
@@ -48,21 +52,20 @@
 import android.support.test.InstrumentationRegistry;
 import android.testing.DexmakerShareClassLoaderRule;
 
+
 import com.android.internal.app.IVoiceInteractor;
+
 import com.android.server.AttributeCache;
 import com.android.server.wm.AppWindowContainerController;
-import com.android.server.wm.DisplayWindowController;
 import com.android.server.wm.PinnedStackWindowController;
 import com.android.server.wm.StackWindowController;
 import com.android.server.wm.TaskWindowContainerController;
 import com.android.server.wm.WindowManagerService;
 import com.android.server.wm.WindowTestUtils;
-
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Rule;
 import org.mockito.MockitoAnnotations;
-import org.mockito.invocation.InvocationOnMock;
+
 
 /**
  * A base class to handle common operations in activity related unit tests.
diff --git a/services/tests/wmtests/src/com/android/server/am/AppErrorDialogTest.java b/services/tests/servicestests/src/com/android/server/am/AppErrorDialogTest.java
similarity index 95%
rename from services/tests/wmtests/src/com/android/server/am/AppErrorDialogTest.java
rename to services/tests/servicestests/src/com/android/server/am/AppErrorDialogTest.java
index 2289dfc..3d11c4c 100644
--- a/services/tests/wmtests/src/com/android/server/am/AppErrorDialogTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/AppErrorDialogTest.java
@@ -32,10 +32,7 @@
 import java.io.File;
 
 /**
- * Tests for {@link AppErrorDialog}.
- *
- * Build/Install/Run:
- *  atest WmTests:AppErrorDialogTest
+ * runtest -c com.android.server.am.AppErrorDialogTest frameworks-services
  */
 @RunWith(AndroidJUnit4.class)
 @SmallTest
diff --git a/services/tests/wmtests/src/com/android/server/am/AssistDataRequesterTest.java b/services/tests/servicestests/src/com/android/server/am/AssistDataRequesterTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/am/AssistDataRequesterTest.java
rename to services/tests/servicestests/src/com/android/server/am/AssistDataRequesterTest.java
index 285a84f..ce88d84 100644
--- a/services/tests/wmtests/src/com/android/server/am/AssistDataRequesterTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/AssistDataRequesterTest.java
@@ -62,8 +62,7 @@
  * Note: Currently, we only support fetching the screenshot for the current application, so the
  * screenshot checks are hardcoded accordingly.
  *
- * Build/Install/Run:
- *  atest WmTests:AssistDataRequesterTest
+ * runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/AssistDataRequesterTest.java
  */
 @MediumTest
 @RunWith(AndroidJUnit4.class)
diff --git a/services/tests/wmtests/src/com/android/server/am/ClientLifecycleManagerTests.java b/services/tests/servicestests/src/com/android/server/am/ClientLifecycleManagerTests.java
similarity index 66%
rename from services/tests/wmtests/src/com/android/server/am/ClientLifecycleManagerTests.java
rename to services/tests/servicestests/src/com/android/server/am/ClientLifecycleManagerTests.java
index 3098db2..ef6d5e8 100644
--- a/services/tests/wmtests/src/com/android/server/am/ClientLifecycleManagerTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ClientLifecycleManagerTests.java
@@ -1,19 +1,3 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
 package com.android.server.am;
 
 import static org.mockito.Mockito.mock;
@@ -31,12 +15,6 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-/**
- * Test class for {@link ClientLifecycleManager}.
- *
- * Build/Install/Run:
- *  atest WmTests:ClientLifecycleManagerTests
- */
 @RunWith(AndroidJUnit4.class)
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/CoreSettingsObserverTest.java b/services/tests/servicestests/src/com/android/server/am/CoreSettingsObserverTest.java
similarity index 91%
rename from services/tests/wmtests/src/com/android/server/am/CoreSettingsObserverTest.java
rename to services/tests/servicestests/src/com/android/server/am/CoreSettingsObserverTest.java
index adf3f94..da30c11 100644
--- a/services/tests/wmtests/src/com/android/server/am/CoreSettingsObserverTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/CoreSettingsObserverTest.java
@@ -37,6 +37,7 @@
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -47,8 +48,17 @@
 /**
  * Test class for {@link CoreSettingsObserver}.
  *
- * Build/Install/Run:
- *  atest WmTests:CoreSettingsObserverTest
+ * To run the tests, use
+ *
+ * runtest -c com.android.server.am.CoreSettingsObserverTest frameworks-services
+ *
+ * or the following steps:
+ *
+ * Build: m FrameworksServicesTests
+ * Install: adb install -r \
+ *     ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
+ * Run: adb shell am instrument -e class com.android.server.am.CoreSettingsObserverTest -w \
+ *     com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
  */
 @SmallTest
 @RunWith(AndroidJUnit4.class)
diff --git a/services/tests/wmtests/src/com/android/server/am/GlobalSettingsToPropertiesMapperTest.java b/services/tests/servicestests/src/com/android/server/am/GlobalSettingsToPropertiesMapperTest.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/am/GlobalSettingsToPropertiesMapperTest.java
rename to services/tests/servicestests/src/com/android/server/am/GlobalSettingsToPropertiesMapperTest.java
index b1e0b51..d9b3e1c 100644
--- a/services/tests/wmtests/src/com/android/server/am/GlobalSettingsToPropertiesMapperTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/GlobalSettingsToPropertiesMapperTest.java
@@ -36,9 +36,6 @@
 
 /**
  * Tests for {@link GlobalSettingsToPropertiesMapper}
- *
- * Build/Install/Run:
- *  atest WmTests:GlobalSettingsToPropertiesMapperTest
  */
 @RunWith(AndroidJUnit4.class)
 @SmallTest
diff --git a/services/tests/wmtests/src/com/android/server/am/LaunchParamsControllerTests.java b/services/tests/servicestests/src/com/android/server/am/LaunchParamsControllerTests.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/am/LaunchParamsControllerTests.java
rename to services/tests/servicestests/src/com/android/server/am/LaunchParamsControllerTests.java
index 5f2bc4d..161c287 100644
--- a/services/tests/wmtests/src/com/android/server/am/LaunchParamsControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/LaunchParamsControllerTests.java
@@ -16,14 +16,20 @@
 
 package com.android.server.am;
 
+import android.app.ActivityOptions;
+import android.content.pm.ActivityInfo.WindowLayout;
+import android.platform.test.annotations.Presubmit;
+import android.support.test.filters.MediumTest;
+import android.support.test.runner.AndroidJUnit4;
+
+import com.android.server.am.LaunchParamsController.LaunchParams;
+import org.junit.runner.RunWith;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.android.server.am.LaunchParamsController.LaunchParamsModifier;
+
 import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
-
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
 import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.anyInt;
 import static org.mockito.Mockito.doNothing;
@@ -34,24 +40,18 @@
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
-import android.app.ActivityOptions;
-import android.content.pm.ActivityInfo.WindowLayout;
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.MediumTest;
-import android.support.test.runner.AndroidJUnit4;
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
 
-import com.android.server.am.LaunchParamsController.LaunchParams;
-import com.android.server.am.LaunchParamsController.LaunchParamsModifier;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
 
 /**
  * Tests for exercising {@link LaunchParamsController}.
  *
  * Build/Install/Run:
- *  atest WmTests:LaunchParamsControllerTests
+ *  atest FrameworksServicesTests:LaunchParamsControllerTests
  */
 @MediumTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/LockTaskControllerTest.java b/services/tests/servicestests/src/com/android/server/am/LockTaskControllerTest.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/am/LockTaskControllerTest.java
rename to services/tests/servicestests/src/com/android/server/am/LockTaskControllerTest.java
index a2e9769..f46d712 100644
--- a/services/tests/wmtests/src/com/android/server/am/LockTaskControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/LockTaskControllerTest.java
@@ -35,20 +35,9 @@
 import static com.android.server.am.LockTaskController.STATUS_BAR_MASK_LOCKED;
 import static com.android.server.am.LockTaskController.STATUS_BAR_MASK_PINNED;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.*;
+import static org.mockito.Mockito.*;
 
 import android.app.StatusBarManager;
 import android.app.admin.DevicePolicyManager;
@@ -87,7 +76,7 @@
  * Unit tests for {@link LockTaskController}.
  *
  * Build/Install/Run:
- *  bit WmTests:LockTaskControllerTest
+ *  bit FrameworksServicesTests:com.android.server.am.LockTaskControllerTest
  */
 @Presubmit
 @SmallTest
diff --git a/services/tests/wmtests/src/com/android/server/am/MemoryStatUtilTest.java b/services/tests/servicestests/src/com/android/server/am/MemoryStatUtilTest.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/am/MemoryStatUtilTest.java
rename to services/tests/servicestests/src/com/android/server/am/MemoryStatUtilTest.java
index 18b0988..5518ca5 100644
--- a/services/tests/wmtests/src/com/android/server/am/MemoryStatUtilTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/MemoryStatUtilTest.java
@@ -16,9 +16,9 @@
 
 package com.android.server.am;
 
-import static com.android.server.am.MemoryStatUtil.MemoryStat;
 import static com.android.server.am.MemoryStatUtil.parseMemoryStatFromMemcg;
 import static com.android.server.am.MemoryStatUtil.parseMemoryStatFromProcfs;
+import static com.android.server.am.MemoryStatUtil.MemoryStat;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
@@ -29,12 +29,6 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-/**
- * Tests for {@link MemoryStatUtil}.
- *
- * Build/Install/Run:
- *  atest WmTests:MemoryStatUtilTest
- */
 @RunWith(AndroidJUnit4.class)
 @SmallTest
 public class MemoryStatUtilTest {
diff --git a/services/tests/wmtests/src/com/android/server/am/PendingRemoteAnimationRegistryTest.java b/services/tests/servicestests/src/com/android/server/am/PendingRemoteAnimationRegistryTest.java
similarity index 96%
rename from services/tests/wmtests/src/com/android/server/am/PendingRemoteAnimationRegistryTest.java
rename to services/tests/servicestests/src/com/android/server/am/PendingRemoteAnimationRegistryTest.java
index f812ee6..2baf995 100644
--- a/services/tests/wmtests/src/com/android/server/am/PendingRemoteAnimationRegistryTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/PendingRemoteAnimationRegistryTest.java
@@ -20,11 +20,14 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
+import android.annotation.Nullable;
 import android.app.ActivityOptions;
+import android.os.Handler;
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.FlakyTest;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
+import android.util.ArrayMap;
 import android.view.RemoteAnimationAdapter;
 
 import com.android.server.testutils.OffsettableClock;
@@ -37,10 +40,7 @@
 import org.mockito.MockitoAnnotations;
 
 /**
- * Tests for {@link PendingRemoteAnimationRegistry}.
- *
- * Build/Install/Run:
- *  atest WmTests:PendingRemoteAnimationRegistryTest
+ * atest PendingRemoteAnimationRegistryTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/PersistentConnectionTest.java b/services/tests/servicestests/src/com/android/server/am/PersistentConnectionTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/am/PersistentConnectionTest.java
rename to services/tests/servicestests/src/com/android/server/am/PersistentConnectionTest.java
index 5c42081..54f93a8 100644
--- a/services/tests/wmtests/src/com/android/server/am/PersistentConnectionTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/PersistentConnectionTest.java
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package com.android.server.am;
 
 import static org.mockito.ArgumentMatchers.any;
@@ -42,12 +41,6 @@
 import java.util.Arrays;
 import java.util.Collections;
 
-/**
- * Tests for {@link PersistentConnection}.
- *
- * Build/Install/Run:
- *  atest WmTests:PersistentConnectionTest
- */
 @SmallTest
 public class PersistentConnectionTest extends AndroidTestCase {
     private static class MyConnection extends PersistentConnection<IDeviceAdminService> {
diff --git a/services/tests/wmtests/src/com/android/server/am/RecentTasksTest.java b/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/am/RecentTasksTest.java
rename to services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
index 739467a..b73ac89 100644
--- a/services/tests/wmtests/src/com/android/server/am/RecentTasksTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
@@ -35,12 +35,16 @@
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
 
 import static java.lang.Integer.MAX_VALUE;
 
+import android.annotation.TestApi;
 import android.app.ActivityManager;
 import android.app.ActivityManager.RecentTaskInfo;
 import android.app.ActivityManager.RunningTaskInfo;
+import android.app.WindowConfiguration;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.pm.PackageManager;
@@ -49,6 +53,7 @@
 import android.content.res.Configuration;
 import android.graphics.Rect;
 import android.os.Bundle;
+import android.os.Debug;
 import android.os.Looper;
 import android.os.RemoteException;
 import android.os.SystemClock;
@@ -75,10 +80,7 @@
 import java.util.Set;
 
 /**
- * Tests for {@link RecentTasks}.
- *
- * Build/Install/Run:
- *  atest WmTests:RecentTasksTest
+ * atest FrameworksServicesTests:RecentTasksTest
  */
 @MediumTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/RecentsAnimationTest.java b/services/tests/servicestests/src/com/android/server/am/RecentsAnimationTest.java
similarity index 93%
rename from services/tests/wmtests/src/com/android/server/am/RecentsAnimationTest.java
rename to services/tests/servicestests/src/com/android/server/am/RecentsAnimationTest.java
index ee576e3..eefd973 100644
--- a/services/tests/wmtests/src/com/android/server/am/RecentsAnimationTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/RecentsAnimationTest.java
@@ -16,13 +16,15 @@
 
 package com.android.server.am;
 
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
-
+import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
+import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
 import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
-
 import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyInt;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.eq;
 import static org.mockito.Mockito.mock;
@@ -37,18 +39,13 @@
 import android.support.test.filters.MediumTest;
 import android.support.test.runner.AndroidJUnit4;
 import android.view.IRecentsAnimationRunner;
-
 import com.android.server.AttributeCache;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 /**
- * Tests for {@link RecentsAnimation}.
- *
- * Build/Install/Run:
- *  atest WmTests:RecentsAnimationTest
+ * atest FrameworksServicesTests:RecentsAnimationTest
  */
 @MediumTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/RunningTasksTest.java b/services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/am/RunningTasksTest.java
rename to services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java
index 4e5fbd8..c6ce7e1 100644
--- a/services/tests/wmtests/src/com/android/server/am/RunningTasksTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java
@@ -41,11 +41,8 @@
 
 import java.util.ArrayList;
 
- /**
- * Tests for {@link RunningTasks}.
- *
- * Build/Install/Run:
- *  atest WmTests:RunningTasksTest
+/**
+ * runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java
  */
 @MediumTest
 @Presubmit
@@ -126,4 +123,4 @@
                 .build();
         return task;
     }
-}
+}
\ No newline at end of file
diff --git a/services/tests/wmtests/src/com/android/server/am/SafeActivityOptionsTest.java b/services/tests/servicestests/src/com/android/server/am/SafeActivityOptionsTest.java
similarity index 92%
rename from services/tests/wmtests/src/com/android/server/am/SafeActivityOptionsTest.java
rename to services/tests/servicestests/src/com/android/server/am/SafeActivityOptionsTest.java
index 3f05c8c..168bc17 100644
--- a/services/tests/wmtests/src/com/android/server/am/SafeActivityOptionsTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/SafeActivityOptionsTest.java
@@ -27,12 +27,6 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-/**
- * Tests for {@link SafeActivityOptions}.
- *
- * Build/Install/Run:
- *  atest WmTests:SafeActivityOptionsTest
- */
 @MediumTest
 @Presubmit
 @FlakyTest
diff --git a/services/tests/wmtests/src/com/android/server/am/TaskLaunchParamsModifierTests.java b/services/tests/servicestests/src/com/android/server/am/TaskLaunchParamsModifierTests.java
similarity index 96%
rename from services/tests/wmtests/src/com/android/server/am/TaskLaunchParamsModifierTests.java
rename to services/tests/servicestests/src/com/android/server/am/TaskLaunchParamsModifierTests.java
index 7fb63d3..3d323f0 100644
--- a/services/tests/wmtests/src/com/android/server/am/TaskLaunchParamsModifierTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/TaskLaunchParamsModifierTests.java
@@ -16,29 +16,37 @@
 
 package com.android.server.am;
 
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
-import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
-
-import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
-
-import static org.junit.Assert.assertEquals;
-
 import android.content.pm.ActivityInfo.WindowLayout;
 import android.graphics.Rect;
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.MediumTest;
 import android.support.test.runner.AndroidJUnit4;
+
 import android.view.Gravity;
 
+import org.junit.runner.RunWith;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
+
+import org.mockito.invocation.InvocationOnMock;
+
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
+
+import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
+
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.doAnswer;
+import static org.junit.Assert.assertEquals;
+
 
 /**
  * Tests for exercising resizing task bounds.
  *
  * Build/Install/Run:
- *  atest WmTests:TaskLaunchParamsModifierTests
+ *  atest FrameworksServicesTests:TaskLaunchParamsModifierTests
  */
 @MediumTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/TaskPersisterTest.java b/services/tests/servicestests/src/com/android/server/am/TaskPersisterTest.java
similarity index 93%
rename from services/tests/wmtests/src/com/android/server/am/TaskPersisterTest.java
rename to services/tests/servicestests/src/com/android/server/am/TaskPersisterTest.java
index cdafb52..9e6055d 100644
--- a/services/tests/wmtests/src/com/android/server/am/TaskPersisterTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/TaskPersisterTest.java
@@ -17,16 +17,20 @@
 package com.android.server.am;
 
 import android.content.pm.UserInfo;
+import android.os.Environment;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.test.AndroidTestCase;
+import android.util.Log;
 import android.util.SparseBooleanArray;
 
+import com.android.server.am.TaskPersister;
+
+import java.io.File;
+import java.util.Random;
+
 /**
- * Tests for {@link TaskPersister}.
- *
- * Build/Install/Run:
- *  atest WmTests:TaskPersisterTest
+ * atest FrameworksServicesTests:TaskPersisterTest
  */
 public class TaskPersisterTest extends AndroidTestCase {
     private static final String TEST_USER_NAME = "AM-Test-User";
diff --git a/services/tests/wmtests/src/com/android/server/am/TaskRecordTests.java b/services/tests/servicestests/src/com/android/server/am/TaskRecordTests.java
similarity index 95%
rename from services/tests/wmtests/src/com/android/server/am/TaskRecordTests.java
rename to services/tests/servicestests/src/com/android/server/am/TaskRecordTests.java
index dbb3e7e..057fdc8 100644
--- a/services/tests/wmtests/src/com/android/server/am/TaskRecordTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/TaskRecordTests.java
@@ -29,16 +29,20 @@
 import android.content.ComponentName;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
+import android.content.res.XmlResourceParser;
 import android.graphics.Rect;
 import android.platform.test.annotations.Presubmit;
 import android.service.voice.IVoiceInteractionSession;
+import android.support.test.InstrumentationRegistry;
 import android.support.test.filters.MediumTest;
 import android.support.test.runner.AndroidJUnit4;
 import android.util.Xml;
 
+import com.android.frameworks.servicestests.R;
 import com.android.internal.app.IVoiceInteractor;
 import com.android.server.am.TaskRecord.TaskRecordFactory;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -53,13 +57,15 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.Reader;
+import java.nio.file.Files;
 import java.util.ArrayList;
+import java.util.Comparator;
 
 /**
  * Tests for exercising {@link TaskRecord}.
  *
  * Build/Install/Run:
- *  atest WmTests:TaskRecordTests
+ *  atest FrameworksServicesTests:com.android.server.am.TaskRecordTests
  */
 @MediumTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/am/TaskStackChangedListenerTest.java b/services/tests/servicestests/src/com/android/server/am/TaskStackChangedListenerTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/am/TaskStackChangedListenerTest.java
rename to services/tests/servicestests/src/com/android/server/am/TaskStackChangedListenerTest.java
index 28689cb..0359096 100644
--- a/services/tests/wmtests/src/com/android/server/am/TaskStackChangedListenerTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/TaskStackChangedListenerTest.java
@@ -17,7 +17,6 @@
 package com.android.server.am;
 
 import static android.support.test.InstrumentationRegistry.getInstrumentation;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -33,30 +32,23 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
+import android.content.res.Resources.Theme;
 import android.os.RemoteException;
 import android.support.test.InstrumentationRegistry;
 import android.support.test.filters.MediumTest;
 import android.support.test.runner.AndroidJUnit4;
 import android.support.test.uiautomator.UiDevice;
 import android.text.TextUtils;
-
+import android.util.Pair;
 import com.android.internal.annotations.GuardedBy;
-
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Tests for {@link TaskStackListener}.
- *
- * Build/Install/Run:
- *  atest WmTests:TaskStackChangedListenerTest
- */
 @MediumTest
 @RunWith(AndroidJUnit4.class)
 public class TaskStackChangedListenerTest {
diff --git a/services/tests/wmtests/src/com/android/server/am/UserControllerTest.java b/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/am/UserControllerTest.java
rename to services/tests/servicestests/src/com/android/server/am/UserControllerTest.java
index fb5ded5..cc4f519 100644
--- a/services/tests/wmtests/src/com/android/server/am/UserControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java
@@ -16,30 +16,6 @@
 
 package com.android.server.am;
 
-import static android.content.pm.PackageManager.PERMISSION_GRANTED;
-import static android.testing.DexmakerShareClassLoaderRule.runWithDexmakerShareClassLoader;
-
-import static com.android.server.am.UserController.CONTINUE_USER_SWITCH_MSG;
-import static com.android.server.am.UserController.REPORT_LOCKED_BOOT_COMPLETE_MSG;
-import static com.android.server.am.UserController.REPORT_USER_SWITCH_COMPLETE_MSG;
-import static com.android.server.am.UserController.REPORT_USER_SWITCH_MSG;
-import static com.android.server.am.UserController.SYSTEM_USER_CURRENT_MSG;
-import static com.android.server.am.UserController.SYSTEM_USER_START_MSG;
-import static com.android.server.am.UserController.USER_SWITCH_TIMEOUT_MSG;
-
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.when;
-
 import android.app.IUserSwitchObserver;
 import android.content.Context;
 import android.content.IIntentReceiver;
@@ -72,11 +48,30 @@
 import java.util.List;
 import java.util.Set;
 
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+import static android.testing.DexmakerShareClassLoaderRule.runWithDexmakerShareClassLoader;
+import static com.android.server.am.UserController.CONTINUE_USER_SWITCH_MSG;
+import static com.android.server.am.UserController.REPORT_LOCKED_BOOT_COMPLETE_MSG;
+import static com.android.server.am.UserController.REPORT_USER_SWITCH_COMPLETE_MSG;
+import static com.android.server.am.UserController.REPORT_USER_SWITCH_MSG;
+import static com.android.server.am.UserController.SYSTEM_USER_CURRENT_MSG;
+import static com.android.server.am.UserController.SYSTEM_USER_START_MSG;
+import static com.android.server.am.UserController.USER_SWITCH_TIMEOUT_MSG;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.when;
+
 /**
- * Tests for {@link UserController}.
- *
- * Build/Install/Run:
- *  atest WmTests:UserControllerTest
+ * Usage: bit FrameworksServicesTests:com.android.server.am.UserControllerTest
  */
 @Presubmit
 public class UserControllerTest extends AndroidTestCase {
diff --git a/services/tests/wmtests/src/com/android/server/policy/FakeWindowState.java b/services/tests/servicestests/src/com/android/server/policy/FakeWindowState.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/policy/FakeWindowState.java
rename to services/tests/servicestests/src/com/android/server/policy/FakeWindowState.java
diff --git a/services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java
rename to services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java
diff --git a/services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java
rename to services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java
diff --git a/services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerTest.java b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTest.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerTest.java
rename to services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTest.java
diff --git a/services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerTestBase.java b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTestBase.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerTestBase.java
rename to services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTestBase.java
diff --git a/services/tests/wmtests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java b/services/tests/servicestests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java
similarity index 89%
rename from services/tests/wmtests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java
rename to services/tests/servicestests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java
index a396946..164c80b 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java
@@ -18,10 +18,13 @@
 
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
-
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
 import static junit.framework.Assert.assertFalse;
 import static junit.framework.Assert.assertTrue;
-
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyZeroInteractions;
 
@@ -30,9 +33,12 @@
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
+import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 
@@ -40,7 +46,7 @@
  * Tests for the {@link TaskStack} class.
  *
  * Build/Install/Run:
- *  atest WmTests:AnimatingAppWindowTokenRegistryTest
+ *  atest FrameworksServicesTests:com.android.server.wm.AnimatingAppWindowTokenRegistryTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/AppTransitionTests.java b/services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/AppTransitionTests.java
rename to services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java
index 6b3266d..be7d781 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AppTransitionTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java
@@ -20,7 +20,6 @@
 import static android.view.WindowManager.TRANSIT_CRASHING_ACTIVITY_CLOSE;
 import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
 import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
-
 import static org.junit.Assert.assertEquals;
 
 import android.content.Context;
@@ -37,8 +36,7 @@
 /**
  * Test class for {@link AppTransition}.
  *
- * Build/Install/Run:
- *  atest WmTests:AppTransitionTests
+ * atest AppTransitionTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/AppWindowContainerControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/AppWindowContainerControllerTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/AppWindowContainerControllerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/AppWindowContainerControllerTests.java
index 09a0847..e0645b1 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AppWindowContainerControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/AppWindowContainerControllerTests.java
@@ -16,32 +16,30 @@
 
 package com.android.server.wm;
 
+import android.support.test.filters.FlakyTest;
+import org.junit.Test;
+
+import android.platform.test.annotations.Presubmit;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
 import static android.content.res.Configuration.EMPTY;
 import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
 
-import android.platform.test.annotations.Presubmit;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
 import com.android.server.wm.WindowTestUtils.TestTaskWindowContainerController;
 
-import org.junit.Test;
-
 /**
  * Test class for {@link AppWindowContainerController}.
  *
- * Build/Install/Run:
- *  atest WmTests:AppWindowContainerControllerTests
+ * atest FrameworksServicesTests:com.android.server.wm.AppWindowContainerControllerTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/AppWindowTokenTests.java b/services/tests/servicestests/src/com/android/server/wm/AppWindowTokenTests.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/wm/AppWindowTokenTests.java
rename to services/tests/servicestests/src/com/android/server/wm/AppWindowTokenTests.java
index 8dedb584a..f6599dc 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AppWindowTokenTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/AppWindowTokenTests.java
@@ -16,6 +16,16 @@
 
 package com.android.server.wm;
 
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import android.platform.test.annotations.Presubmit;
+import android.support.test.filters.FlakyTest;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+import android.view.Surface;
+import android.view.WindowManager;
+
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
@@ -28,27 +38,15 @@
 import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
 import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
 import static android.view.WindowManager.TRANSIT_UNSET;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.view.Surface;
-import android.view.WindowManager;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 /**
  * Tests for the {@link AppWindowToken} class.
  *
  * Build/Install/Run:
- *  atest WmTests:AppWindowTokenTests
+ *  atest FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
  */
 @SmallTest
 // TODO: b/68267650
diff --git a/services/tests/wmtests/src/com/android/server/wm/BoundsAnimationControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/BoundsAnimationControllerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java
index 7fbb4ee..ff631e7 100644
--- a/services/tests/wmtests/src/com/android/server/wm/BoundsAnimationControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java
@@ -21,12 +21,6 @@
 import static com.android.server.wm.BoundsAnimationController.SCHEDULE_PIP_MODE_CHANGED_ON_START;
 import static com.android.server.wm.BoundsAnimationController.SchedulePipModeChangedState;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
 import android.animation.ValueAnimator;
 import android.content.Context;
 import android.graphics.Rect;
@@ -38,12 +32,23 @@
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import com.android.server.wm.BoundsAnimationController.BoundsAnimator;
 import com.android.server.wm.WindowManagerInternal.AppTransitionListener;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import com.android.server.wm.BoundsAnimationController.BoundsAnimator;
+
 /**
  * Test class for {@link BoundsAnimationController} to ensure that it sends the right callbacks
  * depending on the various interactions.
@@ -55,7 +60,7 @@
  * appropriately.
  *
  * Build/Install/Run:
- *  bit WmTests:BoundsAnimationControllerTests
+ *  bit FrameworksServicesTests:com.android.server.wm.BoundsAnimationControllerTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/ConfigurationContainerTests.java b/services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/ConfigurationContainerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java
index 6a6f954..192e156 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ConfigurationContainerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java
@@ -17,6 +17,7 @@
 package com.android.server.wm;
 
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
@@ -27,7 +28,6 @@
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
 import static android.content.res.Configuration.EMPTY;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
@@ -35,7 +35,6 @@
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
-
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -46,7 +45,7 @@
  * Test class for {@link ConfigurationContainer}.
  *
  * Build/Install/Run:
- *  atest WmTests:ConfigurationContainerTests
+ *  bit FrameworksServicesTests:com.android.server.wm.ConfigurationContainerTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/DimmerTests.java b/services/tests/servicestests/src/com/android/server/wm/DimmerTests.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/wm/DimmerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/DimmerTests.java
index a12a802f..6769e40 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DimmerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/DimmerTests.java
@@ -38,10 +38,8 @@
 import org.junit.runner.RunWith;
 
 /**
- * Tests for {@link Dimmer}.
- *
  * Build/Install/Run:
- *  atest WmTests:DimmerTests;
+ * atest FrameworksServicesTests:com.android.server.wm.DimmerTests;
  */
 @Presubmit
 @RunWith(AndroidJUnit4.class)
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
rename to services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java
index a9744ea..ac196f9 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java
@@ -28,7 +28,6 @@
 import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
 import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
 import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION;
-
 import static com.android.server.wm.WindowContainer.POSITION_TOP;
 
 import static org.hamcrest.Matchers.is;
@@ -39,6 +38,9 @@
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
 import android.annotation.SuppressLint;
 import android.content.res.Configuration;
 import android.graphics.Rect;
@@ -55,9 +57,6 @@
 
 import com.android.server.wm.utils.WmDisplayCutout;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -68,7 +67,7 @@
  * Tests for the {@link DisplayContent} class.
  *
  * Build/Install/Run:
- *  atest WmTests:DisplayContentTests
+ *  atest com.android.server.wm.DisplayContentTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java
index 68b0998..a09656c 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java
@@ -19,7 +19,6 @@
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
 import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
-
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.any;
@@ -40,23 +39,19 @@
 import android.view.SurfaceControl;
 import android.view.SurfaceSession;
 import android.view.View;
-
 import com.android.internal.annotations.GuardedBy;
 import com.android.server.LocalServices;
-
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
 /**
  * Tests for the {@link DragDropController} class.
  *
- * Build/Install/Run:
- *  atest WmTests:DragDropControllerTests
+ * atest com.android.server.wm.DragDropControllerTests
  */
 @SmallTest
 @RunWith(AndroidJUnit4.class)
diff --git a/services/tests/wmtests/src/com/android/server/wm/PinnedStackControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/PinnedStackControllerTest.java
similarity index 94%
rename from services/tests/wmtests/src/com/android/server/wm/PinnedStackControllerTest.java
rename to services/tests/servicestests/src/com/android/server/wm/PinnedStackControllerTest.java
index f0faf28..96745fa 100644
--- a/services/tests/wmtests/src/com/android/server/wm/PinnedStackControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/PinnedStackControllerTest.java
@@ -2,15 +2,6 @@
 
 import static android.view.Display.DEFAULT_DISPLAY;
 
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 import android.os.RemoteException;
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
@@ -23,12 +14,15 @@
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 
-/**
- * Tests for {@link PinnedStackController}.
- *
- * Build/Install/Run:
- *  atest WmTests:PinnedStackControllerTest
- */
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 @SmallTest
 @Presubmit
 @RunWith(AndroidJUnit4.class)
diff --git a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/RecentsAnimationControllerTest.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java
rename to services/tests/servicestests/src/com/android/server/wm/RecentsAnimationControllerTest.java
index fdebaa6..a2af9b8 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/RecentsAnimationControllerTest.java
@@ -19,10 +19,8 @@
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
 import static android.view.Display.DEFAULT_DISPLAY;
-
 import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
 import static com.android.server.wm.RecentsAnimationController.REORDER_MOVE_TO_ORIGINAL_POSITION;
-
 import static org.junit.Assert.fail;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.atLeast;
@@ -37,9 +35,7 @@
 import android.support.test.runner.AndroidJUnit4;
 import android.view.IRecentsAnimationRunner;
 import android.view.SurfaceControl;
-
 import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -47,10 +43,7 @@
 import org.mockito.MockitoAnnotations;
 
 /**
- * Tests for {@link RecentsAnimationController}.
- *
- * Build/Install/Run:
- *  atest WmTests:RecentsAnimationControllerTest
+ * atest FrameworksServicesTests:com.android.server.wm.RecentsAnimationControllerTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java
rename to services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java
index 383e53f..95361f0 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/RemoteAnimationControllerTest.java
@@ -31,6 +31,7 @@
 import android.os.Binder;
 import android.os.IInterface;
 import android.platform.test.annotations.Presubmit;
+import android.support.test.filters.FlakyTest;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 import android.view.IRemoteAnimationFinishedCallback;
@@ -52,10 +53,7 @@
 import org.mockito.MockitoAnnotations;
 
 /**
- * Tests for {@link RemoteAnimationController}.
- *
- * Build/Install/Run:
- *  atest WmTests:RemoteAnimationControllerTest
+ * atest FrameworksServicesTests:com.android.server.wm.RemoteAnimationControllerTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java b/services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java
similarity index 95%
rename from services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java
index 317f36c..204e26c 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java
@@ -1,21 +1,22 @@
 package com.android.server.wm;
 
-import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import android.content.res.Configuration;
 import android.graphics.Rect;
+
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Tests for the {@link RootWindowContainer} class.
  *
  * Build/Install/Run:
- *  atest WmTests:RootWindowContainerTests
+ *  atest FrameworksServicesTests:com.android.server.wm.RootWindowContainerTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/ScreenDecorWindowTests.java b/services/tests/servicestests/src/com/android/server/wm/ScreenDecorWindowTests.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/wm/ScreenDecorWindowTests.java
rename to services/tests/servicestests/src/com/android/server/wm/ScreenDecorWindowTests.java
index 7e7cfed..a2ccee4 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ScreenDecorWindowTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/ScreenDecorWindowTests.java
@@ -32,7 +32,6 @@
 import static android.view.WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
 import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_IS_SCREEN_DECOR;
 import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
-
 import static org.junit.Assert.assertEquals;
 
 import android.app.Activity;
@@ -71,7 +70,7 @@
  * Tests for the {@link android.view.WindowManager.LayoutParams#PRIVATE_FLAG_IS_SCREEN_DECOR} flag.
  *
  * Build/Install/Run:
- *  atest WmTests:ScreenDecorWindowTests
+ *  atest FrameworksServicesTests:com.android.server.wm.ScreenDecorWindowTests
  */
 // TODO: Add test for FLAG_FULLSCREEN which hides the status bar and also other flags.
 // TODO: Test non-Activity windows.
diff --git a/services/tests/wmtests/src/com/android/server/wm/StackWindowControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/StackWindowControllerTests.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/wm/StackWindowControllerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/StackWindowControllerTests.java
index fb2986c..ab0a2bd 100644
--- a/services/tests/wmtests/src/com/android/server/wm/StackWindowControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/StackWindowControllerTests.java
@@ -16,24 +16,25 @@
 
 package com.android.server.wm;
 
+import android.graphics.Rect;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import android.platform.test.annotations.Presubmit;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import android.graphics.Rect;
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 /**
  * Test class for {@link StackWindowController}.
  *
  * Build/Install/Run:
- *  atest WmTests:StackWindowControllerTests
+ *  atest FrameworksServicesTests:StackWindowControllerTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/SurfaceAnimationRunnerTest.java b/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimationRunnerTest.java
similarity index 96%
rename from services/tests/wmtests/src/com/android/server/wm/SurfaceAnimationRunnerTest.java
rename to services/tests/servicestests/src/com/android/server/wm/SurfaceAnimationRunnerTest.java
index 9ea3702..edac8a5 100644
--- a/services/tests/wmtests/src/com/android/server/wm/SurfaceAnimationRunnerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimationRunnerTest.java
@@ -16,6 +16,7 @@
 
 package com.android.server.wm;
 
+import static java.util.concurrent.TimeUnit.SECONDS;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -23,11 +24,11 @@
 import static org.mockito.Mockito.atLeast;
 import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import static java.util.concurrent.TimeUnit.SECONDS;
-
+import android.animation.AnimationHandler;
 import android.animation.AnimationHandler.AnimationFrameCallbackProvider;
 import android.animation.ValueAnimator;
 import android.graphics.Matrix;
@@ -36,6 +37,7 @@
 import android.support.test.filters.FlakyTest;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
+import android.util.Log;
 import android.view.Choreographer;
 import android.view.Choreographer.FrameCallback;
 import android.view.SurfaceControl;
@@ -44,6 +46,7 @@
 import android.view.animation.TranslateAnimation;
 
 import com.android.server.wm.LocalAnimationAdapter.AnimationSpec;
+import com.android.server.wm.SurfaceAnimationRunner.AnimatorFactory;
 
 import org.junit.Before;
 import org.junit.Rule;
@@ -58,8 +61,7 @@
 /**
  * Test class for {@link SurfaceAnimationRunner}.
  *
- * Build/Install/Run:
- *  atest WmTests:SurfaceAnimationRunnerTest
+ * atest FrameworksServicesTests:com.android.server.wm.SurfaceAnimationRunnerTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/SurfaceAnimatorTest.java b/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimatorTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/SurfaceAnimatorTest.java
rename to services/tests/servicestests/src/com/android/server/wm/SurfaceAnimatorTest.java
index 66f4b194..16b8458 100644
--- a/services/tests/wmtests/src/com/android/server/wm/SurfaceAnimatorTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/SurfaceAnimatorTest.java
@@ -46,11 +46,12 @@
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 
+import java.util.ArrayList;
+
 /**
  * Test class for {@link SurfaceAnimatorTest}.
  *
- * Build/Install/Run:
- *  atest WmTests:SurfaceAnimatorTest
+ * atest FrameworksServicesTests:com.android.server.wm.SurfaceAnimatorTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskPositionerTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskPositionerTests.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/wm/TaskPositionerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/TaskPositionerTests.java
index ae73089..7bf7dd7 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskPositionerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskPositionerTests.java
@@ -16,14 +16,10 @@
 
 package com.android.server.wm;
 
-import static com.android.server.wm.TaskPositioner.MIN_ASPECT;
-import static com.android.server.wm.WindowManagerService.dipToPixel;
-import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_HEIGHT_IN_DP;
-import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_WIDTH_IN_DP;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import android.graphics.Rect;
 import android.support.test.filters.SmallTest;
@@ -32,16 +28,18 @@
 import android.util.Log;
 import android.view.Display;
 
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import static com.android.server.wm.TaskPositioner.MIN_ASPECT;
+import static com.android.server.wm.WindowManagerService.dipToPixel;
+import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_HEIGHT_IN_DP;
+import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_WIDTH_IN_DP;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Tests for the {@link TaskPositioner} class.
  *
- * Build/Install/Run:
- *  atest WmTests:TaskPositionerTests
+ * runtest frameworks-services -c com.android.server.wm.TaskPositionerTests
  */
 @SmallTest
 @RunWith(AndroidJUnit4.class)
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskPositioningControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskPositioningControllerTests.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/wm/TaskPositioningControllerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/TaskPositioningControllerTests.java
index 659ec41..6070516 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskPositioningControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskPositioningControllerTests.java
@@ -17,7 +17,6 @@
 package com.android.server.wm;
 
 import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
-
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -31,7 +30,6 @@
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 import android.view.InputChannel;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -39,8 +37,7 @@
 /**
  * Tests for the {@link TaskPositioningController} class.
  *
- * Build/Install/Run:
- *  atest WmTests:TaskPositioningControllerTests
+ * atest com.android.server.wm.TaskPositioningControllerTests
  */
 @SmallTest
 @RunWith(AndroidJUnit4.class)
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotCacheTest.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/TaskSnapshotCacheTest.java
rename to services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java
index 1aefa277..649de4a 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotCacheTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java
@@ -17,7 +17,6 @@
 package com.android.server.wm;
 
 import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
-
 import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.assertNull;
 
@@ -32,8 +31,7 @@
 /**
  * Test class for {@link TaskSnapshotCache}.
  *
- * Build/Install/Run:
- *  atest WmTests:TaskSnapshotCacheTest
+ * runtest frameworks-services -c com.android.server.wm.TaskSnapshotCacheTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotControllerTest.java
similarity index 95%
rename from services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java
rename to services/tests/servicestests/src/com/android/server/wm/TaskSnapshotControllerTest.java
index 77521a6..5650050 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotControllerTest.java
@@ -19,11 +19,10 @@
 import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
 import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
 import static android.view.WindowManager.TRANSIT_UNSET;
-
-import static com.android.server.wm.TaskSnapshotController.SNAPSHOT_MODE_APP_THEME;
-import static com.android.server.wm.TaskSnapshotController.SNAPSHOT_MODE_REAL;
-
+import static com.android.server.wm.TaskSnapshotController.*;
 import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
 
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
@@ -31,15 +30,13 @@
 import android.util.ArraySet;
 
 import com.google.android.collect.Sets;
-
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 /**
  * Test class for {@link TaskSnapshotController}.
  *
- * Build/Install/Run:
- *  atest WmTests:TaskSnapshotControllerTest
+ * runtest frameworks-services -c com.android.server.wm.TaskSnapshotControllerTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
rename to services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
index ed81daf..325d42a 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterLoaderTest.java
@@ -18,12 +18,12 @@
 
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
 import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import android.app.ActivityManager.TaskSnapshot;
 import android.content.res.Configuration;
@@ -33,8 +33,8 @@
 import android.support.test.filters.MediumTest;
 import android.support.test.runner.AndroidJUnit4;
 import android.util.ArraySet;
-import android.view.View;
 
+import android.view.View;
 import com.android.server.wm.TaskSnapshotPersister.RemoveObsoleteFilesQueueItem;
 
 import org.junit.Test;
@@ -45,8 +45,7 @@
 /**
  * Test class for {@link TaskSnapshotPersister} and {@link TaskSnapshotLoader}
  *
- * Build/Install/Run:
- *  atest WmTests:TaskSnapshotPersisterLoaderTest
+ * atest FrameworksServicesTests:TaskSnapshotPersisterLoaderTest
  */
 @MediumTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
rename to services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
rename to services/tests/servicestests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
index 287fff5..b19373e 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
@@ -19,7 +19,6 @@
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
 import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
 import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
-
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyInt;
@@ -48,8 +47,7 @@
 /**
  * Test class for {@link TaskSnapshotSurface}.
  *
- * Build/Install/Run:
- *  atest WmTests:TaskSnapshotSurfaceTest
+ * runtest frameworks-services -c com.android.server.wm.TaskSnapshotSurfaceTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskStackContainersTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
similarity index 96%
rename from services/tests/wmtests/src/com/android/server/wm/TaskStackContainersTests.java
rename to services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
index e66b0d9..ca1994f 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskStackContainersTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
@@ -18,25 +18,26 @@
 
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
 import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.Before;
+import org.junit.After;
+
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 /**
  * Tests for the {@link DisplayContent.TaskStackContainers} container in {@link DisplayContent}.
  *
  * Build/Install/Run:
- *  atest WmTests:TaskStackContainersTests
+ *  bit FrameworksServicesTests:com.android.server.wm.TaskStackContainersTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskStackTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskStackTests.java
similarity index 95%
rename from services/tests/wmtests/src/com/android/server/wm/TaskStackTests.java
rename to services/tests/servicestests/src/com/android/server/wm/TaskStackTests.java
index 0deb4af..eaf71f0 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskStackTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskStackTests.java
@@ -16,24 +16,27 @@
 
 package com.android.server.wm;
 
-import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
-import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Tests for the {@link TaskStack} class.
  *
  * Build/Install/Run:
- *  atest WmTests:TaskStackTests
+ *  bit FrameworksServicesTests:com.android.server.wm.TaskStackTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskWindowContainerControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskWindowContainerControllerTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/TaskWindowContainerControllerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/TaskWindowContainerControllerTests.java
index e734bc0..1dd9365 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskWindowContainerControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskWindowContainerControllerTests.java
@@ -16,23 +16,22 @@
 
 package com.android.server.wm;
 
+import android.platform.test.annotations.Presubmit;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 /**
  * Test class for {@link TaskWindowContainerController}.
  *
  * Build/Install/Run:
- *  atest WmTests:TaskWindowContainerControllerTests
+ *  bit FrameworksServicesTests:com.android.server.wm.TaskWindowContainerControllerTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/TestIWindow.java b/services/tests/servicestests/src/com/android/server/wm/TestIWindow.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/wm/TestIWindow.java
rename to services/tests/servicestests/src/com/android/server/wm/TestIWindow.java
index 032f416..353aa7d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TestIWindow.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TestIWindow.java
@@ -16,6 +16,8 @@
 
 package com.android.server.wm;
 
+import com.android.internal.os.IResultReceiver;
+
 import android.graphics.Rect;
 import android.os.Bundle;
 import android.os.ParcelFileDescriptor;
@@ -25,8 +27,6 @@
 import android.view.DragEvent;
 import android.view.IWindow;
 
-import com.android.internal.os.IResultReceiver;
-
 public class TestIWindow extends IWindow.Stub {
     @Override
     public void executeCommand(String command, String parameters,
diff --git a/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java b/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java
rename to services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java
diff --git a/services/tests/wmtests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java b/services/tests/servicestests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java
rename to services/tests/servicestests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java
index 903352b..a5c47de 100644
--- a/services/tests/wmtests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java
@@ -29,8 +29,7 @@
 /**
  * Test class for {@link AppTransition}.
  *
- * Build/Install/Run:
- *  atest WmTests:UnknownAppVisibilityControllerTest
+ * runtest frameworks-services -c com.android.server.wm.UnknownAppVisibilityControllerTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/WallpaperControllerTests.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/WallpaperControllerTests.java
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowAnimationSpecTest.java b/services/tests/servicestests/src/com/android/server/wm/WindowAnimationSpecTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/WindowAnimationSpecTest.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowAnimationSpecTest.java
index aac905e..ca520ed 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowAnimationSpecTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowAnimationSpecTest.java
@@ -40,8 +40,7 @@
 /**
  * Tests for the {@link WindowAnimationSpec} class.
  *
- * Build/Install/Run:
- *  atest WmTests:WindowAnimationSpecTest
+ *  atest FrameworksServicesTests:com.android.server.wm.WindowAnimationSpecTest
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowConfigurationTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/WindowConfigurationTests.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
index 9c59a17..513c1ec 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowConfigurationTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
@@ -16,16 +16,7 @@
 
 package com.android.server.wm;
 
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
-import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
-import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
-import static android.app.WindowConfiguration.WINDOW_CONFIG_APP_BOUNDS;
-import static android.app.WindowConfiguration.WINDOW_CONFIG_WINDOWING_MODE;
-import static android.content.pm.ActivityInfo.CONFIG_WINDOW_CONFIGURATION;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import org.junit.Test;
 
 import android.app.WindowConfiguration;
 import android.content.res.Configuration;
@@ -36,13 +27,22 @@
 import android.support.test.runner.AndroidJUnit4;
 import android.view.DisplayInfo;
 
-import org.junit.Test;
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
+import static android.app.WindowConfiguration.WINDOW_CONFIG_APP_BOUNDS;
+import static android.app.WindowConfiguration.WINDOW_CONFIG_WINDOWING_MODE;
+import static android.content.pm.ActivityInfo.CONFIG_WINDOW_CONFIGURATION;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test class to for {@link android.app.WindowConfiguration}.
  *
  * Build/Install/Run:
- *  atest WmTests:WindowConfigurationTests
+ *  bit FrameworksServicesTests:com.android.server.wm.WindowConfigurationTests
  */
 @SmallTest
 @FlakyTest(bugId = 74078662)
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowContainerControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowContainerControllerTests.java
similarity index 96%
rename from services/tests/wmtests/src/com/android/server/wm/WindowContainerControllerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowContainerControllerTests.java
index 05f7c34..502cb6e 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowContainerControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowContainerControllerTests.java
@@ -16,26 +16,26 @@
 
 package com.android.server.wm;
 
-import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
-import static android.content.res.Configuration.EMPTY;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
+import android.app.WindowConfiguration;
 import android.content.res.Configuration;
-import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.FlakyTest;
+import org.junit.Test;
+
+import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import org.junit.Test;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
+import static android.content.res.Configuration.EMPTY;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test class for {@link WindowContainerController}.
  *
  * Build/Install/Run:
- *  atest WmTests:WindowContainerControllerTests
+ *  bit FrameworksServicesTests:com.android.server.wm.WindowContainerControllerTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowContainerTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowContainerTests.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/wm/WindowContainerTests.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowContainerTests.java
index 5beeee1..6c7830e 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowContainerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowContainerTests.java
@@ -16,6 +16,20 @@
 
 package com.android.server.wm;
 
+import android.support.test.filters.FlakyTest;
+import android.view.SurfaceControl;
+import android.view.SurfaceSession;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import android.content.res.Configuration;
+import android.graphics.Rect;
+import android.platform.test.annotations.Presubmit;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+
+import java.util.Comparator;
+
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
@@ -30,6 +44,7 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+
 import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.anyFloat;
 import static org.mockito.Mockito.eq;
@@ -38,25 +53,11 @@
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
-import android.content.res.Configuration;
-import android.graphics.Rect;
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.view.SurfaceControl;
-import android.view.SurfaceSession;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.Comparator;
-
 /**
  * Test class for {@link WindowContainer}.
  *
  * Build/Install/Run:
- *  atest WmTests:WindowContainerTests
+ *  atest FrameworksServicesTests:com.android.server.wm.WindowContainerTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowContainerTraversalTests.java
similarity index 96%
rename from services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowContainerTraversalTests.java
index e1acd78..e076399 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowContainerTraversalTests.java
@@ -20,10 +20,9 @@
 import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
 import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
 import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
-
-import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Matchers.eq;
 
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
@@ -32,13 +31,12 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import org.mockito.Mock;
+
 import java.util.function.Consumer;
 
 /**
  * Tests for {@link WindowContainer#forAllWindows} and various implementations.
- *
- * Build/Install/Run:
- *  atest WmTests:WindowContainerTraversalTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowFrameTests.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowFrameTests.java
index 6a00de4..5a56332 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowFrameTests.java
@@ -16,12 +16,9 @@
 
 package com.android.server.wm;
 
-import static android.view.DisplayCutout.fromBoundingRect;
-import static android.view.WindowManager.LayoutParams.FILL_PARENT;
-import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import android.app.ActivityManager.TaskDescription;
 import android.content.res.Configuration;
@@ -34,17 +31,18 @@
 import android.view.IWindow;
 import android.view.WindowManager;
 
-import com.android.server.wm.utils.WmDisplayCutout;
+import static android.view.DisplayCutout.fromBoundingRect;
+import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
+import static android.view.WindowManager.LayoutParams.FILL_PARENT;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import com.android.server.wm.utils.WmDisplayCutout;
 
 /**
  * Tests for the {@link WindowState#computeFrameLw} method and other window frame machinery.
  *
- * Build/Install/Run:
- *  atest WmTests:WindowFrameTests
+ * Build/Install/Run: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
  */
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowManagerServiceRule.java b/services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRule.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/wm/WindowManagerServiceRule.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRule.java
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowManagerServiceRuleTest.java b/services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRuleTest.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/wm/WindowManagerServiceRuleTest.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowManagerServiceRuleTest.java
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java
index 0f07e7e..85e846d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java
@@ -16,6 +16,17 @@
 
 package com.android.server.wm;
 
+import android.view.WindowManager;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import android.platform.test.annotations.Presubmit;
+import android.support.test.filters.FlakyTest;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+
+import java.util.LinkedList;
+
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
 import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
@@ -44,22 +55,10 @@
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 
-import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.view.WindowManager;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.LinkedList;
-
 /**
  * Tests for the {@link WindowState} class.
  *
- * Build/Install/Run:
- *  atest WmTests:WindowStateTests
+ * atest FrameworksServicesTests:com.android.server.wm.WindowStateTests
  */
 @SmallTest
 @FlakyTest(bugId = 74078662)
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowSurfacePlacerTest.java b/services/tests/servicestests/src/com/android/server/wm/WindowSurfacePlacerTest.java
similarity index 96%
rename from services/tests/wmtests/src/com/android/server/wm/WindowSurfacePlacerTest.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowSurfacePlacerTest.java
index 13f7916..e173b7d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowSurfacePlacerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowSurfacePlacerTest.java
@@ -20,7 +20,6 @@
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
 import static android.view.WindowManager.TRANSIT_TASK_CLOSE;
 import static android.view.WindowManager.TRANSIT_TASK_OPEN;
-
 import static junit.framework.Assert.assertEquals;
 
 import android.platform.test.annotations.Presubmit;
@@ -32,12 +31,6 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-/**
- * Tests for {@link WindowSurfacePlacer}.
- *
- * Build/Install/Run:
- *  atest WmTests:WindowSurfacePlacerTest
- */
 @SmallTest
 @Presubmit
 @RunWith(AndroidJUnit4.class)
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestUtils.java b/services/tests/servicestests/src/com/android/server/wm/WindowTestUtils.java
similarity index 99%
rename from services/tests/wmtests/src/com/android/server/wm/WindowTestUtils.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowTestUtils.java
index 6ab9c30..2e4740b 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowTestUtils.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowTestUtils.java
@@ -16,21 +16,8 @@
 
 package com.android.server.wm;
 
-import static android.app.AppOpsManager.OP_NONE;
-import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
-import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
-
-import static com.android.server.wm.WindowContainer.POSITION_TOP;
-
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.anyBoolean;
-import static org.mockito.Mockito.anyFloat;
-import static org.mockito.Mockito.anyInt;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
 import android.app.ActivityManager;
+import android.content.Context;
 import android.content.res.Configuration;
 import android.graphics.Rect;
 import android.os.Binder;
@@ -39,6 +26,19 @@
 import android.view.IWindow;
 import android.view.WindowManager;
 
+import static android.app.AppOpsManager.OP_NONE;
+import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
+
+import static com.android.server.wm.WindowContainer.POSITION_TOP;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyBoolean;
+import static org.mockito.Mockito.anyFloat;
+import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
 import org.mockito.invocation.InvocationOnMock;
 
 /**
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java
similarity index 100%
rename from services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTokenTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowTokenTests.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/wm/WindowTokenTests.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowTokenTests.java
index 5ea87b1..e3b7174 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowTokenTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowTokenTests.java
@@ -16,29 +16,29 @@
 
 package com.android.server.wm;
 
-import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
-import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
-import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.FlakyTest;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
+import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
+import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
 
 /**
  * Tests for the {@link WindowToken} class.
  *
  * Build/Install/Run:
- *  atest WmTests:WindowTokenTests
+ *  bit FrameworksServicesTests:com.android.server.wm.WindowTokenTests
  */
 @SmallTest
 @FlakyTest(bugId = 74078662)
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTracingTest.java b/services/tests/servicestests/src/com/android/server/wm/WindowTracingTest.java
similarity index 97%
rename from services/tests/wmtests/src/com/android/server/wm/WindowTracingTest.java
rename to services/tests/servicestests/src/com/android/server/wm/WindowTracingTest.java
index f60ae75..5085254 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowTracingTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowTracingTest.java
@@ -30,12 +30,13 @@
 import android.content.Context;
 import android.platform.test.annotations.Presubmit;
 import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.FlakyTest;
 import android.support.test.filters.SmallTest;
+import android.support.test.filters.FlakyTest;
 import android.support.test.runner.AndroidJUnit4;
 import android.util.proto.ProtoOutputStream;
 
 import com.android.internal.util.Preconditions;
+import com.android.server.wm.WindowManagerTraceProto;
 
 import org.junit.After;
 import org.junit.Before;
@@ -53,7 +54,7 @@
  * Test class for {@link WindowTracing}.
  *
  * Build/Install/Run:
- *  atest WmTests:WindowTracingTest
+ *  bit FrameworksServicesTests:com.android.server.wm.WindowTracingTest
  */
 @SmallTest
 @FlakyTest(bugId = 74078662)
diff --git a/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java b/services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java
rename to services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java
index a730b5c..547be55 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java
@@ -27,14 +27,15 @@
 import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;
 import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY;
 import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
+import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
 import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
 import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL;
 import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL;
 import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY;
 
 import android.platform.test.annotations.Presubmit;
-import android.support.test.filters.FlakyTest;
 import android.support.test.filters.SmallTest;
+import android.support.test.filters.FlakyTest;
 import android.support.test.runner.AndroidJUnit4;
 import android.view.SurfaceControl;
 import android.view.SurfaceSession;
@@ -50,7 +51,7 @@
  * Tests for the {@link WindowLayersController} class.
  *
  * Build/Install/Run:
- *  atest WmTests:ZOrderingTests
+ *  bit FrameworksServicesTests:com.android.server.wm.ZOrderingTests
  */
 @SmallTest
 @FlakyTest(bugId = 74078662)
diff --git a/services/tests/wmtests/src/com/android/server/wm/utils/CoordinateTransformsTest.java b/services/tests/servicestests/src/com/android/server/wm/utils/CoordinateTransformsTest.java
similarity index 91%
rename from services/tests/wmtests/src/com/android/server/wm/utils/CoordinateTransformsTest.java
rename to services/tests/servicestests/src/com/android/server/wm/utils/CoordinateTransformsTest.java
index f0f3023..40a10e0 100644
--- a/services/tests/wmtests/src/com/android/server/wm/utils/CoordinateTransformsTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/utils/CoordinateTransformsTest.java
@@ -21,11 +21,10 @@
 import static android.view.Surface.ROTATION_270;
 import static android.view.Surface.ROTATION_90;
 
-import static com.android.server.wm.utils.CoordinateTransforms
-        .transformPhysicalToLogicalCoordinates;
+import static com.android.server.wm.utils.CoordinateTransforms.transformPhysicalToLogicalCoordinates;
 
 import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
+import static org.junit.Assert.*;
 
 import android.graphics.Matrix;
 import android.graphics.Point;
@@ -36,12 +35,6 @@
 import org.junit.Test;
 import org.junit.rules.ErrorCollector;
 
-/**
- * Tests for {@link CoordinateTransforms}.
- *
- * Build/Install/Run:
- *  atest WmTests:CoordinateTransformsTest
- */
 public class CoordinateTransformsTest {
 
     private static final int W = 200;
@@ -102,4 +95,4 @@
     public interface DevicePointAssertable {
         void mapsToLogicalPoint(int x, int y);
     }
-}
+}
\ No newline at end of file
diff --git a/services/tests/wmtests/src/com/android/server/wm/utils/InsetUtilsTest.java b/services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java
similarity index 92%
rename from services/tests/wmtests/src/com/android/server/wm/utils/InsetUtilsTest.java
rename to services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java
index ff3d883..d0f0fe3 100644
--- a/services/tests/wmtests/src/com/android/server/wm/utils/InsetUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java
@@ -22,16 +22,11 @@
 import android.platform.test.annotations.Presubmit;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
+import android.util.Pair;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-/**
- * Tests for {@link InsetUtils}.
- *
- * Build/Install/Run:
- *  atest WmTests:InsetUtilsTest
- */
 @RunWith(AndroidJUnit4.class)
 @SmallTest
 @Presubmit
diff --git a/services/tests/wmtests/src/com/android/server/wm/utils/RotationCacheTest.java b/services/tests/servicestests/src/com/android/server/wm/utils/RotationCacheTest.java
similarity index 96%
rename from services/tests/wmtests/src/com/android/server/wm/utils/RotationCacheTest.java
rename to services/tests/servicestests/src/com/android/server/wm/utils/RotationCacheTest.java
index c800fa2..6bbc7eb 100644
--- a/services/tests/wmtests/src/com/android/server/wm/utils/RotationCacheTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/utils/RotationCacheTest.java
@@ -29,16 +29,13 @@
 import android.support.test.runner.AndroidJUnit4;
 import android.util.Pair;
 
+import com.android.server.wm.utils.RotationCache.RotationDependentComputation;
+
+import org.hamcrest.Matchers;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-/**
- * Tests for {@link RotationCache}.
- *
- * Build/Install/Run:
- *  atest WmTests:RotationCacheTest
- */
 @RunWith(AndroidJUnit4.class)
 @SmallTest
 @FlakyTest(bugId = 74078662)
diff --git a/services/tests/wmtests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java b/services/tests/servicestests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
similarity index 98%
rename from services/tests/wmtests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
rename to services/tests/servicestests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
index f4c208b..f7addf6 100644
--- a/services/tests/wmtests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
@@ -16,6 +16,7 @@
 
 package com.android.server.wm.utils;
 
+
 import static android.view.DisplayCutout.NO_CUTOUT;
 import static android.view.DisplayCutout.fromBoundingRect;
 
@@ -37,8 +38,7 @@
 /**
  * Tests for {@link WmDisplayCutout}
  *
- * Build/Install/Run:
- *  atest WmTests:WmDisplayCutoutTest
+ * Run with: atest WmDisplayCutoutTest
  */
 @RunWith(AndroidJUnit4.class)
 @SmallTest
diff --git a/services/tests/wmtests/Android.mk b/services/tests/wmtests/Android.mk
index cd28974..0f8b18a 100644
--- a/services/tests/wmtests/Android.mk
+++ b/services/tests/wmtests/Android.mk
@@ -14,14 +14,9 @@
     $(call all-java-files-under, ../servicestests/utils)
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
-    frameworks-base-testutils \
-    services.core \
-    android-support-test \
+    androidx-test \
     mockito-target-minus-junit4 \
     platform-test-annotations \
-    truth-prebuilt \
-    testables \
-    ub-uiautomator \
 
 LOCAL_JAVA_LIBRARIES := \
     android.test.mock \
diff --git a/services/tests/wmtests/AndroidManifest.xml b/services/tests/wmtests/AndroidManifest.xml
index 7e4bd42..1fb9473 100644
--- a/services/tests/wmtests/AndroidManifest.xml
+++ b/services/tests/wmtests/AndroidManifest.xml
@@ -22,30 +22,10 @@
         android:minSdkVersion="1"
         android:targetSdkVersion="28" />
 
-    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
-    <uses-permission android:name="android.permission.WAKE_LOCK" />
-    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
-    <uses-permission android:name="android.permission.MANAGE_ACTIVITY_STACKS" />
-    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
-    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
-    <uses-permission android:name="android.permission.STATUS_BAR_SERVICE" />
-    <uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
-    <uses-permission android:name="android.permission.READ_FRAME_BUFFER" />
-    <uses-permission android:name="android.permission.GET_TOP_ACTIVITY_INFO" />
-    <uses-permission android:name="android.permission.REORDER_TASKS" />
-    <uses-permission android:name="android.permission.MANAGE_USERS" />
-
-    <application android:testOnly="true">
-        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityA" />
-        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityB" />
-        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityRequestedOrientationChange" />
-        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityTaskChangeCallbacks" />
-        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityTaskDescriptionChange" />
-        <activity android:name="com.android.server.wm.ScreenDecorWindowTests$TestActivity" />
-    </application>
+    <application android:testOnly="true" />
 
     <instrumentation
-        android:name="android.support.test.runner.AndroidJUnitRunner"
+        android:name="androidx.test.runner.AndroidJUnitRunner"
         android:label="Window Manager Tests"
         android:targetPackage="com.android.frameworks.wmtests" />
 </manifest>
diff --git a/services/tests/wmtests/AndroidTest.xml b/services/tests/wmtests/AndroidTest.xml
index 38a62ae..2717ef90 100644
--- a/services/tests/wmtests/AndroidTest.xml
+++ b/services/tests/wmtests/AndroidTest.xml
@@ -24,9 +24,9 @@
     </target_preparer>
 
     <option name="test-tag" value="WmTests" />
-    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
+    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
         <option name="package" value="com.android.frameworks.wmtests" />
-        <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
-        <option name="hidden-api-checks" value="false"/>
+        <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
+        <option name="hidden-api-checks" value="false" />
     </test>
 </configuration>
diff --git a/services/tests/wmtests/src/com/android/server/am/DummyAmTests.java b/services/tests/wmtests/src/com/android/server/am/DummyAmTests.java
new file mode 100644
index 0000000..023e4ab
--- /dev/null
+++ b/services/tests/wmtests/src/com/android/server/am/DummyAmTests.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.am;
+
+import android.platform.test.annotations.Presubmit;
+
+import org.junit.Test;
+
+import androidx.test.filters.FlakyTest;
+
+/**
+ * Dummy test for com.android.server.am.
+ * TODO(b/113800711): Remove this class once the actual tests are moved from servicestests.
+ */
+public class DummyAmTests {
+
+    @Presubmit
+    @Test
+    public void preSubmitTest() {}
+
+    @FlakyTest
+    @Presubmit
+    @Test
+    public void flakyPreSubmitTest() {}
+
+    @Test
+    public void postSubmitTest() {}
+
+    @FlakyTest
+    @Test
+    public void flakyPostSubmitTest() {}
+}
diff --git a/services/tests/wmtests/src/com/android/server/wm/DummyWmTests.java b/services/tests/wmtests/src/com/android/server/wm/DummyWmTests.java
new file mode 100644
index 0000000..aecb278
--- /dev/null
+++ b/services/tests/wmtests/src/com/android/server/wm/DummyWmTests.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.wm;
+
+import android.platform.test.annotations.Presubmit;
+
+import org.junit.Test;
+
+import androidx.test.filters.FlakyTest;
+
+/**
+ * Dummy test for com.android.server.wm
+ * TODO(b/113800711): Remove this class once the actual tests are moved from servicestests.
+ */
+public class DummyWmTests {
+
+    @Presubmit
+    @Test
+    public void preSubmitTest() {}
+
+    @FlakyTest
+    @Presubmit
+    @Test
+    public void flakyPreSubmitTest() {}
+
+    @Test
+    public void postSubmitTest() {}
+
+    @FlakyTest
+    @Test
+    public void flakyPostSubmitTest() {}
+}