2020import android .content .Context ;
2121import android .graphics .BitmapFactory ;
2222import android .graphics .Point ;
23+ import android .os .Environment ;
2324import android .os .ParcelFileDescriptor ;
25+ import android .os .UserHandle ;
2426import android .util .Slog ;
2527import android .view .Display ;
2628import android .view .WindowManager ;
@@ -39,8 +41,12 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu
3941
4042 // This path must match what the WallpaperManagerService uses
4143 // TODO: Will need to change if backing up non-primary user's wallpaper
42- public static final String WALLPAPER_IMAGE = "/data/system/users/0/wallpaper" ;
43- public static final String WALLPAPER_INFO = "/data/system/users/0/wallpaper_info.xml" ;
44+ public static final String WALLPAPER_IMAGE =
45+ new File (Environment .getUserSystemDirectory (UserHandle .USER_OWNER ),
46+ "wallpaper" ).getAbsolutePath ();
47+ public static final String WALLPAPER_INFO =
48+ new File (Environment .getUserSystemDirectory (UserHandle .USER_OWNER ),
49+ "wallpaper_info.xml" ).getAbsolutePath ();
4450 // Use old keys to keep legacy data compatibility and avoid writing two wallpapers
4551 public static final String WALLPAPER_IMAGE_KEY =
4652 "/data/data/com.android.settings/files/wallpaper" ;
@@ -50,7 +56,9 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu
5056 // will be saved to this file from the restore stream, then renamed to the proper
5157 // location if it's deemed suitable.
5258 // TODO: Will need to change if backing up non-primary user's wallpaper
53- private static final String STAGE_FILE = "/data/system/users/0/wallpaper-tmp" ;
59+ private static final String STAGE_FILE =
60+ new File (Environment .getUserSystemDirectory (UserHandle .USER_OWNER ),
61+ "wallpaper-tmp" ).getAbsolutePath ();
5462
5563 Context mContext ;
5664 String [] mFiles ;
0 commit comments