Always have a wallpaper service running.
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index d55f188..608c1ff 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1164,9 +1164,6 @@
 
         <service android:name="com.android.internal.service.wallpaper.ImageWallpaper"
                 android:permission="android.permission.BIND_WALLPAPER">
-            <intent-filter>
-                <action android:name="android.service.wallpaper.WallpaperService" />
-            </intent-filter>
         </service>
 
         <receiver android:name="com.android.server.BootReceiver" >
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 1e3a4a8..bfdce1e 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -112,6 +112,7 @@
         <item name="windowFullscreen">false</item>
         <item name="windowIsFloating">false</item>
         <item name="windowContentOverlay">@android:drawable/title_bar_shadow</item>
+        <item name="windowShowWallpaper">false</item>
         <item name="windowTitleStyle">@android:style/WindowTitle</item>
         <item name="windowTitleSize">25dip</item>
         <item name="windowTitleBackgroundStyle">@android:style/WindowTitleBackground</item>
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 8919ccc..ad8e8921 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -196,6 +196,7 @@
         InputMethodManagerService imm = null;
         AppWidgetService appWidget = null;
         NotificationManagerService notification = null;
+        WallpaperManagerService wallpaper = null;
 
         if (factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL) {
             try {
@@ -302,7 +303,8 @@
 
             try {
                 Log.i(TAG, "Starting Wallpaper Service");
-                ServiceManager.addService(Context.WALLPAPER_SERVICE, new WallpaperManagerService(context));
+                wallpaper = new WallpaperManagerService(context);
+                ServiceManager.addService(Context.WALLPAPER_SERVICE, wallpaper);
             } catch (Throwable e) {
                 Log.e(TAG, "Failure starting Wallpaper Service", e);
             }
@@ -381,6 +383,7 @@
         } catch (RemoteException e) {
         }
 
+        if (wallpaper != null) wallpaper.systemReady();
         battery.systemReady();
         Watchdog.getInstance().start();
 
diff --git a/services/java/com/android/server/WallpaperManagerService.java b/services/java/com/android/server/WallpaperManagerService.java
index 06565c7..9fe4eee 100644
--- a/services/java/com/android/server/WallpaperManagerService.java
+++ b/services/java/com/android/server/WallpaperManagerService.java
@@ -59,6 +59,7 @@
 import org.xmlpull.v1.XmlPullParserException;
 import org.xmlpull.v1.XmlSerializer;
 
+import com.android.internal.service.wallpaper.ImageWallpaper;
 import com.android.internal.util.FastXmlSerializer;
 
 class WallpaperManagerService extends IWallpaperManager.Stub {
@@ -172,12 +173,29 @@
         mWallpaperObserver.stopWatching();
     }
     
+    public void systemReady() {
+        synchronized (mLock) {
+            try {
+                bindWallpaperComponentLocked(mWallpaperComponent);
+            } catch (RuntimeException e) {
+                Log.w(TAG, "Failure starting previous wallpaper", e);
+                try {
+                    bindWallpaperComponentLocked(null);
+                } catch (RuntimeException e2) {
+                    Log.w(TAG, "Failure starting default wallpaper", e2);
+                    clearWallpaperComponentLocked();
+                }
+            }
+        }
+    }
+    
     public void clearWallpaper() {
         synchronized (mLock) {
             File f = WALLPAPER_FILE;
             if (f.exists()) {
                 f.delete();
             }
+            bindWallpaperComponentLocked(null);
         }
     }
 
@@ -231,7 +249,7 @@
         synchronized (mLock) {
             ParcelFileDescriptor pfd = updateWallpaperBitmapLocked(name);
             if (pfd != null) {
-                clearWallpaperComponentLocked();
+                bindWallpaperComponentLocked(null);
                 saveSettingsLocked();
             }
             return pfd;
@@ -256,16 +274,45 @@
         synchronized (mLock) {
             final long ident = Binder.clearCallingIdentity();
             try {
-                ServiceInfo si = mContext.getPackageManager().getServiceInfo(name,
-                        PackageManager.GET_META_DATA | PackageManager.GET_PERMISSIONS);
-                if (!android.Manifest.permission.BIND_WALLPAPER.equals(si.permission)) {
-                    throw new SecurityException("Selected service does not require "
-                            + android.Manifest.permission.BIND_WALLPAPER
-                            + ": " + name);
+                bindWallpaperComponentLocked(name);
+            } finally {
+                Binder.restoreCallingIdentity(ident);
+            }
+        }
+    }
+    
+    void bindWallpaperComponentLocked(ComponentName name) {
+        // Has the component changed?
+        if (mWallpaperConnection != null) {
+            if (mWallpaperComponent == null) {
+                if (name == null) {
+                    // Still using default wallpaper.
+                    return;
                 }
-                
+            } else if (mWallpaperComponent.equals(name)) {
+                // Changing to same wallpaper.
+                return;
+            }
+        }
+        
+        try {
+            ComponentName realName = name;
+            if (realName == null) {
+                // The default component is our static image wallpaper.
+                realName = new ComponentName("android",
+                        ImageWallpaper.class.getName());
+            }
+            ServiceInfo si = mContext.getPackageManager().getServiceInfo(realName,
+                    PackageManager.GET_META_DATA | PackageManager.GET_PERMISSIONS);
+            if (!android.Manifest.permission.BIND_WALLPAPER.equals(si.permission)) {
+                throw new SecurityException("Selected service does not require "
+                        + android.Manifest.permission.BIND_WALLPAPER
+                        + ": " + realName);
+            }
+            
+            Intent intent = new Intent(WallpaperService.SERVICE_INTERFACE);
+            if (name != null) {
                 // Make sure the selected service is actually a wallpaper service.
-                Intent intent = new Intent(WallpaperService.SERVICE_INTERFACE);
                 List<ResolveInfo> ris = mContext.getPackageManager()
                         .queryIntentServices(intent, 0);
                 for (int i=0; i<ris.size(); i++) {
@@ -278,33 +325,31 @@
                 }
                 if (ris != null) {
                     throw new SecurityException("Selected service is not a wallpaper: "
-                            + name);
+                            + realName);
                 }
-                
-                // Bind the service!
-                WallpaperConnection newConn = new WallpaperConnection();
-                intent.setComponent(name);
-                if (!mContext.bindService(intent, newConn,
-                        Context.BIND_AUTO_CREATE)) {
-                    throw new IllegalArgumentException("Unable to bind service: "
-                            + name);
-                }
-                
-                clearWallpaperComponentLocked();
-                mWallpaperComponent = null;
-                mWallpaperConnection = newConn;
-                try {
-                    if (DEBUG) Log.v(TAG, "Adding window token: " + newConn.mToken);
-                    mIWindowManager.addWindowToken(newConn.mToken,
-                            WindowManager.LayoutParams.TYPE_WALLPAPER);
-                } catch (RemoteException e) {
-                }
-                
-            } catch (PackageManager.NameNotFoundException e) {
-                throw new IllegalArgumentException("Unknown component " + name);
-            } finally {
-                Binder.restoreCallingIdentity(ident);
             }
+            
+            // Bind the service!
+            WallpaperConnection newConn = new WallpaperConnection();
+            intent.setComponent(realName);
+            if (!mContext.bindService(intent, newConn,
+                    Context.BIND_AUTO_CREATE)) {
+                throw new IllegalArgumentException("Unable to bind service: "
+                        + name);
+            }
+            
+            clearWallpaperComponentLocked();
+            mWallpaperComponent = name;
+            mWallpaperConnection = newConn;
+            try {
+                if (DEBUG) Log.v(TAG, "Adding window token: " + newConn.mToken);
+                mIWindowManager.addWindowToken(newConn.mToken,
+                        WindowManager.LayoutParams.TYPE_WALLPAPER);
+            } catch (RemoteException e) {
+            }
+            
+        } catch (PackageManager.NameNotFoundException e) {
+            throw new IllegalArgumentException("Unknown component " + name);
         }
     }
     
@@ -327,7 +372,7 @@
             conn.mService.attach(conn, conn.mToken, mWidth, mHeight);
         } catch (RemoteException e) {
             Log.w(TAG, "Failed attaching wallpaper; clearing", e);
-            clearWallpaperComponentLocked();
+            bindWallpaperComponentLocked(null);
         }
     }
     
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index b0f049e..89b8ced 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -9489,6 +9489,7 @@
             pw.print("  mFocusedApp="); pw.println(mFocusedApp);
             pw.print("  mInputMethodTarget="); pw.println(mInputMethodTarget);
             pw.print("  mInputMethodWindow="); pw.println(mInputMethodWindow);
+            pw.print("  mWallpaperTarget="); pw.println(mWallpaperTarget);
             pw.print("  mInTouchMode="); pw.println(mInTouchMode);
             pw.print("  mSystemBooted="); pw.print(mSystemBooted);
                     pw.print(" mDisplayEnabled="); pw.println(mDisplayEnabled);