Modify the default_wallpaper_component attribute in the config. xml file so that other wallpaper applications are used by default when the system is started for the first time. After the device is started, choose Settings> Applications> All> Find the apk of the default wallpaper when the device is started for the first time. Click Go to stop and choose disable. This will cause the device to crash. How to modify the code so that in this scenario, the mobile phone does not crash and the wallpaper is restored to ImageWallpaper. Add the red code in the bindWallpaperComponentLocked method in WallpaperManagerService. java. Modify it to the following: ServiceInfo si = mIPackageManager. getServiceInfo (componentName,
PackageManager. GET_META_DATA | PackageManager. GET_PERMISSIONS, serviceUserId); // add for change default wallpaper if (si = null)
{
ComponentName = IMAGE_WALLPAPER;
Si = mIPackageManager. getServiceInfo (componentName,
PackageManager. GET_META_DATA | PackageManager. GET_PERMISSIONS, serviceUserId );
} // Add for change default wallpaper
If (! Android. Manifest. permission. BIND_WALLPAPER.equals (si. permission )){
String msg = Selected service does not require
+ Android. Manifest. permission. BIND_WALLPAPER
+: + ComponentName;
If (fromUser ){
Throw new SecurityException (msg );
}
Slog. w (TAG, msg );
Return false;
}
After the modification, the phone will not restart and the default static wallpaper will be restored.