Eliminate power manager latency for boot completed.

The power manager disables the power button until boot completed
occurs.  If there are many pending broadcasts in the queue, it
may be possible for BOOT_COMPLETED to be delayed for several
seconds after boot.

To avoid the delay, introduced a new boot phase which is
sent to system services immediately when boot completed happens.

Bug: 13398280
Change-Id: I1833d2ffb20305009dd76363b43e534034f1d0a2
diff --git a/core/java/com/android/server/SystemService.java b/core/java/com/android/server/SystemService.java
index 43a05d0..6e67970 100644
--- a/core/java/com/android/server/SystemService.java
+++ b/core/java/com/android/server/SystemService.java
@@ -73,9 +73,12 @@
     public static final int PHASE_THIRD_PARTY_APPS_CAN_START = 600;
 
     /**
-     * After receiving this boot phase, services must have finished all boot-related work.
+     * After receiving this boot phase, services can allow user interaction with the device.
+     * This phase occurs when boot has completed and the home application has started.
+     * System services may prefer to listen to this phase rather than registering a
+     * broadcast receiver for ACTION_BOOT_COMPLETED to reduce overall latency.
      */
-    public static final int PHASE_BOOT_COMPLETE = 1000;
+    public static final int PHASE_BOOT_COMPLETED = 1000;
 
     private final Context mContext;