ShortcutManager: add remaining APIs.

- Icons are now persisted. (under /data/system_ce, as PNGs)
- the "load icon" APIs in LauncherApps are supported.
- Implement updateShortcuts()

- Addressed all the comments on the previous CL
- @hide the newly added constructor for PersistableBundle

- Enhance incoming shortcut validation
- A lot of internal clean-up.

Bug 27548047

Change-Id: I8e3c1ccd3e0a997a6d271c84d81170f0c022b60e
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 59f8284a..e7daaa1 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -726,9 +726,6 @@
                 // Always start the Device Policy Manager, so that the API is compatible with
                 // API8.
                 mSystemServiceManager.startService(DevicePolicyManagerService.Lifecycle.class);
-
-// TODO is this a good place?
-                mSystemServiceManager.startService(ShortcutService.Lifecycle.class);
             }
 
             if (!disableSystemUI) {
@@ -1139,6 +1136,8 @@
                 }
                 Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
             }
+            // LauncherAppsService uses ShortcutService.
+            mSystemServiceManager.startService(ShortcutService.Lifecycle.class);
 
             mSystemServiceManager.startService(LauncherAppsService.class);
         }