OSDN Git Service

Bind wallpaper at later boot phase.
authorJeff Sharkey <jsharkey@android.com>
Wed, 13 Apr 2016 22:08:15 +0000 (16:08 -0600)
committerJeff Sharkey <jsharkey@android.com>
Wed, 13 Apr 2016 22:08:17 +0000 (16:08 -0600)
We need to wait until third-party apps can start before we try
binding to the wallpaper.

Bug: 28166684
Change-Id: I6ef559a667104e830e97da68b437ff592816f6f3

services/core/java/com/android/server/wallpaper/WallpaperManagerService.java

index ca1a7ac..10e30ed 100644 (file)
@@ -128,6 +128,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
         public void onBootPhase(int phase) {
             if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) {
                 mService.systemReady();
+            } else if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
+                mService.switchUser(UserHandle.USER_SYSTEM, null);
             }
         }
 
@@ -850,9 +852,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
                 Slog.i(TAG, "Nondefault wallpaper component; gracefully ignoring");
             }
         }
-        switchWallpaper(wallpaper, null);
-        wallpaper.wallpaperObserver = new WallpaperObserver(wallpaper);
-        wallpaper.wallpaperObserver.startWatching();
 
         IntentFilter userFilter = new IntentFilter();
         userFilter.addAction(Intent.ACTION_USER_REMOVED);