@@ -96,6 +96,13 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
9696 static final String WALLPAPER = "wallpaper" ;
9797 static final String WALLPAPER_INFO = "wallpaper_info.xml" ;
9898
99+ /**
100+ * Name of the component used to display bitmap wallpapers from either the gallery or
101+ * built-in wallpapers.
102+ */
103+ static final ComponentName IMAGE_WALLPAPER = new ComponentName ("com.android.systemui" ,
104+ "com.android.systemui.ImageWallpaper" );
105+
99106 /**
100107 * Observes the wallpaper for changes and notifies all IWallpaperServiceCallbacks
101108 * that the wallpaper has changed. The CREATE is triggered when there is no
@@ -136,7 +143,7 @@ public void onEvent(int event, String path) {
136143 if (event == CLOSE_WRITE ) {
137144 mWallpaper .imageWallpaperPending = false ;
138145 }
139- bindWallpaperComponentLocked (mWallpaper . imageWallpaperComponent , true ,
146+ bindWallpaperComponentLocked (IMAGE_WALLPAPER , true ,
140147 false , mWallpaper , null );
141148 saveSettingsLocked (mWallpaper );
142149 }
@@ -181,13 +188,6 @@ static class WallpaperData {
181188 */
182189 ComponentName nextWallpaperComponent ;
183190
184- /**
185- * Name of the component used to display bitmap wallpapers from either the gallery or
186- * built-in wallpapers.
187- */
188- ComponentName imageWallpaperComponent = new ComponentName ("com.android.systemui" ,
189- "com.android.systemui.ImageWallpaper" );
190-
191191 WallpaperConnection connection ;
192192 long lastDiedTime ;
193193 boolean wallpaperUpdating ;
@@ -554,7 +554,7 @@ void clearWallpaperLocked(boolean defaultFailed, int userId, IRemoteCallback rep
554554 wallpaper .imageWallpaperPending = false ;
555555 if (userId != mCurrentUserId ) return ;
556556 if (bindWallpaperComponentLocked (defaultFailed
557- ? wallpaper . imageWallpaperComponent
557+ ? IMAGE_WALLPAPER
558558 : null , true , false , wallpaper , reply )) {
559559 return ;
560560 }
@@ -775,7 +775,7 @@ boolean bindWallpaperComponentLocked(ComponentName componentName, boolean force,
775775 }
776776 if (componentName == null ) {
777777 // Fall back to static image wallpaper
778- componentName = wallpaper . imageWallpaperComponent ;
778+ componentName = IMAGE_WALLPAPER ;
779779 //clearWallpaperComponentLocked();
780780 //return;
781781 if (DEBUG ) Slog .v (TAG , "Using image wallpaper" );
@@ -798,7 +798,7 @@ boolean bindWallpaperComponentLocked(ComponentName componentName, boolean force,
798798 WallpaperInfo wi = null ;
799799
800800 Intent intent = new Intent (WallpaperService .SERVICE_INTERFACE );
801- if (componentName != null && !componentName .equals (wallpaper . imageWallpaperComponent )) {
801+ if (componentName != null && !componentName .equals (IMAGE_WALLPAPER )) {
802802 // Make sure the selected service is actually a wallpaper service.
803803 List <ResolveInfo > ris =
804804 mIPackageManager .queryIntentServices (intent ,
@@ -973,7 +973,7 @@ private void saveSettingsLocked(WallpaperData wallpaper) {
973973 out .attribute (null , "height" , Integer .toString (wallpaper .height ));
974974 out .attribute (null , "name" , wallpaper .name );
975975 if (wallpaper .wallpaperComponent != null
976- && !wallpaper .wallpaperComponent .equals (wallpaper . imageWallpaperComponent )) {
976+ && !wallpaper .wallpaperComponent .equals (IMAGE_WALLPAPER )) {
977977 out .attribute (null , "component" ,
978978 wallpaper .wallpaperComponent .flattenToShortString ());
979979 }
@@ -1045,7 +1045,7 @@ private void loadSettingsLocked(int userId) {
10451045 if (wallpaper .nextWallpaperComponent == null
10461046 || "android" .equals (wallpaper .nextWallpaperComponent
10471047 .getPackageName ())) {
1048- wallpaper .nextWallpaperComponent = wallpaper . imageWallpaperComponent ;
1048+ wallpaper .nextWallpaperComponent = IMAGE_WALLPAPER ;
10491049 }
10501050
10511051 if (DEBUG ) {
@@ -1107,7 +1107,7 @@ void settingsRestored() {
11071107 loadSettingsLocked (0 );
11081108 wallpaper = mWallpaperMap .get (0 );
11091109 if (wallpaper .nextWallpaperComponent != null
1110- && !wallpaper .nextWallpaperComponent .equals (wallpaper . imageWallpaperComponent )) {
1110+ && !wallpaper .nextWallpaperComponent .equals (IMAGE_WALLPAPER )) {
11111111 if (!bindWallpaperComponentLocked (wallpaper .nextWallpaperComponent , false , false ,
11121112 wallpaper , null )) {
11131113 // No such live wallpaper or other failure; fall back to the default
0 commit comments