Fix issue #7255954: API Review: rename Dream to DreamService

Change-Id: I89ecf2c3ec4fef09c0495aa68de11576f9cfd872
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 738e19b..b684c90 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -38,7 +38,7 @@
 import android.os.SystemClock;
 import android.os.SystemProperties;
 import android.server.search.SearchManagerService;
-import android.service.dreams.Dream;
+import android.service.dreams.DreamService;
 import android.util.DisplayMetrics;
 import android.util.EventLog;
 import android.util.Log;
@@ -741,7 +741,7 @@
                     Slog.i(TAG, "Dreams Service");
                     // Dreams (interactive idle-time views, a/k/a screen savers)
                     dreamy = new DreamManagerService(context, wmHandler);
-                    ServiceManager.addService(Dream.DREAM_SERVICE, dreamy);
+                    ServiceManager.addService(DreamService.DREAM_SERVICE, dreamy);
                 } catch (Throwable e) {
                     reportWtf("starting DreamManagerService", e);
                 }
diff --git a/services/java/com/android/server/UiModeManagerService.java b/services/java/com/android/server/UiModeManagerService.java
index 3b8caba..d1af2b0 100644
--- a/services/java/com/android/server/UiModeManagerService.java
+++ b/services/java/com/android/server/UiModeManagerService.java
@@ -39,7 +39,7 @@
 import android.os.ServiceManager;
 import android.os.UserHandle;
 import android.provider.Settings;
-import android.service.dreams.Dream;
+import android.service.dreams.DreamService;
 import android.service.dreams.IDreamManager;
 import android.util.Slog;
 
@@ -501,7 +501,7 @@
             Slog.i(TAG, "Activating dream while docked.");
             try {
                 IDreamManager dreamManagerService = IDreamManager.Stub.asInterface(
-                        ServiceManager.getService(Dream.DREAM_SERVICE));
+                        ServiceManager.getService(DreamService.DREAM_SERVICE));
                 dreamManagerService.dream();
             } catch (RemoteException ex) {
                 Slog.e(TAG, "Could not start dream when docked.", ex);
diff --git a/services/java/com/android/server/dreams/DreamController.java b/services/java/com/android/server/dreams/DreamController.java
index c01a45d..6db495a 100644
--- a/services/java/com/android/server/dreams/DreamController.java
+++ b/services/java/com/android/server/dreams/DreamController.java
@@ -25,7 +25,7 @@
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.os.IBinder.DeathRecipient;
-import android.service.dreams.Dream;
+import android.service.dreams.DreamService;
 import android.service.dreams.IDreamService;
 import android.util.Slog;
 import android.view.IWindowManager;
@@ -48,9 +48,9 @@
     private final Listener mListener;
     private final IWindowManager mIWindowManager;
 
-    private final Intent mDreamingStartedIntent = new Intent(Dream.ACTION_DREAMING_STARTED)
+    private final Intent mDreamingStartedIntent = new Intent(Intent.ACTION_DREAMING_STARTED)
             .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
-    private final Intent mDreamingStoppedIntent = new Intent(Dream.ACTION_DREAMING_STOPPED)
+    private final Intent mDreamingStoppedIntent = new Intent(Intent.ACTION_DREAMING_STOPPED)
             .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
 
     private final Intent mCloseNotificationShadeIntent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
@@ -98,8 +98,7 @@
             return;
         }
 
-        Intent intent = new Intent(Intent.ACTION_MAIN);
-        intent.addCategory(Dream.CATEGORY_DREAM);
+        Intent intent = new Intent(DreamService.SERVICE_INTERFACE);
         intent.setComponent(name);
         intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
         try {
diff --git a/services/java/com/android/server/power/PowerManagerService.java b/services/java/com/android/server/power/PowerManagerService.java
index ad138e8..9052e0e 100644
--- a/services/java/com/android/server/power/PowerManagerService.java
+++ b/services/java/com/android/server/power/PowerManagerService.java
@@ -51,7 +51,6 @@
 import android.os.UserHandle;
 import android.os.WorkSource;
 import android.provider.Settings;
-import android.service.dreams.Dream;
 import android.util.EventLog;
 import android.util.Log;
 import android.util.Slog;
@@ -363,8 +362,8 @@
             mContext.registerReceiver(new BootCompletedReceiver(), filter, null, mHandler);
 
             filter = new IntentFilter();
-            filter.addAction(Dream.ACTION_DREAMING_STARTED);
-            filter.addAction(Dream.ACTION_DREAMING_STOPPED);
+            filter.addAction(Intent.ACTION_DREAMING_STARTED);
+            filter.addAction(Intent.ACTION_DREAMING_STOPPED);
             mContext.registerReceiver(new DreamReceiver(), filter, null, mHandler);
 
             filter = new IntentFilter();