Unset Dream overlay component in CTS test.

This changelist ensures the dream overlay component is unset from
the system after the overlay test completes. Leaving this value
set causes the application process to crash in subsequent tests,
which can least to unintended failures.

Test: atest DreamOverlayTest
Bug: 214401991
Change-Id: I7d8873ba35687dddbd4bb470e68087287492a3ac
diff --git a/tests/tests/dreams/src/android/service/dreams/cts/DreamOverlayTest.java b/tests/tests/dreams/src/android/service/dreams/cts/DreamOverlayTest.java
index ced77f5..fed0c91 100644
--- a/tests/tests/dreams/src/android/service/dreams/cts/DreamOverlayTest.java
+++ b/tests/tests/dreams/src/android/service/dreams/cts/DreamOverlayTest.java
@@ -16,7 +16,6 @@
 
 package android.service.dreams.cts;
 
-import android.app.DreamManager;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.Context;
@@ -51,11 +50,6 @@
 
     private static final int TIMEOUT_SECONDS = 5;
 
-    private static final ComponentName DREAM_COMPONENT_NAME = ComponentName.unflattenFromString(
-            DREAM_SERVICE_COMPONENT);
-
-    private DreamManager mDreamManager;
-
     private DreamCoordinator mDreamCoordinator = new DreamCoordinator(mContext);
 
     /**
@@ -78,10 +72,13 @@
     @Before
     public void setup() {
         mDreamCoordinator.setup();
+        mDreamCoordinator.setDreamOverlay(ComponentName.unflattenFromString(
+                DREAM_OVERLAY_SERVICE_COMPONENT));
     }
 
     @After
     public void reset()  {
+        mDreamCoordinator.setDreamOverlay(null);
         mDreamCoordinator.restoreDefaults();
     }
 
@@ -96,8 +93,6 @@
         final ComponentName dreamService =
                 ComponentName.unflattenFromString(DREAM_SERVICE_COMPONENT);
         final ComponentName dreamActivity = mDreamCoordinator.setActiveDream(dreamService);
-        mDreamCoordinator.setDreamOverlay(ComponentName.unflattenFromString(
-                DREAM_OVERLAY_SERVICE_COMPONENT));
 
         mDreamCoordinator.startDream(dreamService);
         waitAndAssertTopResumedActivity(dreamActivity, Display.DEFAULT_DISPLAY,