@@ -98,6 +98,13 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
9898 static final String WALLPAPER = "wallpaper" ;
9999 static final String WALLPAPER_INFO = "wallpaper_info.xml" ;
100100
101+ /**
102+ * Name of the component used to display bitmap wallpapers from either the gallery or
103+ * built-in wallpapers.
104+ */
105+ static final ComponentName IMAGE_WALLPAPER = new ComponentName ("com.android.systemui" ,
106+ "com.android.systemui.ImageWallpaper" );
107+
101108 /**
102109 * Observes the wallpaper for changes and notifies all IWallpaperServiceCallbacks
103110 * that the wallpaper has changed. The CREATE is triggered when there is no
@@ -138,7 +145,7 @@ public void onEvent(int event, String path) {
138145 if (event == CLOSE_WRITE ) {
139146 mWallpaper .imageWallpaperPending = false ;
140147 }
141- bindWallpaperComponentLocked (mWallpaper . imageWallpaperComponent , true ,
148+ bindWallpaperComponentLocked (IMAGE_WALLPAPER , true ,
142149 false , mWallpaper , null );
143150 saveSettingsLocked (mWallpaper );
144151 }
@@ -183,13 +190,6 @@ static class WallpaperData {
183190 */
184191 ComponentName nextWallpaperComponent ;
185192
186- /**
187- * Name of the component used to display bitmap wallpapers from either the gallery or
188- * built-in wallpapers.
189- */
190- ComponentName imageWallpaperComponent = new ComponentName ("com.android.systemui" ,
191- "com.android.systemui.ImageWallpaper" );
192-
193193 WallpaperConnection connection ;
194194 long lastDiedTime ;
195195 boolean wallpaperUpdating ;
@@ -559,7 +559,7 @@ void clearWallpaperLocked(boolean defaultFailed, int userId, IRemoteCallback rep
559559 wallpaper .imageWallpaperPending = false ;
560560 if (userId != mCurrentUserId ) return ;
561561 if (bindWallpaperComponentLocked (defaultFailed
562- ? wallpaper . imageWallpaperComponent
562+ ? IMAGE_WALLPAPER
563563 : null , true , false , wallpaper , reply )) {
564564 return ;
565565 }
@@ -792,7 +792,7 @@ boolean bindWallpaperComponentLocked(ComponentName componentName, boolean force,
792792 }
793793 if (componentName == null ) {
794794 // Fall back to static image wallpaper
795- componentName = wallpaper . imageWallpaperComponent ;
795+ componentName = IMAGE_WALLPAPER ;
796796 //clearWallpaperComponentLocked();
797797 //return;
798798 if (DEBUG ) Slog .v (TAG , "Using image wallpaper" );
@@ -815,7 +815,7 @@ boolean bindWallpaperComponentLocked(ComponentName componentName, boolean force,
815815 WallpaperInfo wi = null ;
816816
817817 Intent intent = new Intent (WallpaperService .SERVICE_INTERFACE );
818- if (componentName != null && !componentName .equals (wallpaper . imageWallpaperComponent )) {
818+ if (componentName != null && !componentName .equals (IMAGE_WALLPAPER )) {
819819 // Make sure the selected service is actually a wallpaper service.
820820 List <ResolveInfo > ris =
821821 mIPackageManager .queryIntentServices (intent ,
@@ -990,7 +990,7 @@ private void saveSettingsLocked(WallpaperData wallpaper) {
990990 out .attribute (null , "height" , Integer .toString (wallpaper .height ));
991991 out .attribute (null , "name" , wallpaper .name );
992992 if (wallpaper .wallpaperComponent != null
993- && !wallpaper .wallpaperComponent .equals (wallpaper . imageWallpaperComponent )) {
993+ && !wallpaper .wallpaperComponent .equals (IMAGE_WALLPAPER )) {
994994 out .attribute (null , "component" ,
995995 wallpaper .wallpaperComponent .flattenToShortString ());
996996 }
@@ -1062,7 +1062,7 @@ private void loadSettingsLocked(int userId) {
10621062 if (wallpaper .nextWallpaperComponent == null
10631063 || "android" .equals (wallpaper .nextWallpaperComponent
10641064 .getPackageName ())) {
1065- wallpaper .nextWallpaperComponent = wallpaper . imageWallpaperComponent ;
1065+ wallpaper .nextWallpaperComponent = IMAGE_WALLPAPER ;
10661066 }
10671067
10681068 if (DEBUG ) {
@@ -1124,7 +1124,7 @@ void settingsRestored() {
11241124 loadSettingsLocked (0 );
11251125 wallpaper = mWallpaperMap .get (0 );
11261126 if (wallpaper .nextWallpaperComponent != null
1127- && !wallpaper .nextWallpaperComponent .equals (wallpaper . imageWallpaperComponent )) {
1127+ && !wallpaper .nextWallpaperComponent .equals (IMAGE_WALLPAPER )) {
11281128 if (!bindWallpaperComponentLocked (wallpaper .nextWallpaperComponent , false , false ,
11291129 wallpaper , null )) {
11301130 // No such live wallpaper or other failure; fall back to the default
0 commit comments