Android5.1 Wallpaper Source option has two "wallpapers" option
Problem
System language is Chinese, open settings---show wallpaper--View display
You can see that the Settings menu has two wallpaper options displayed
The system language is in English and the menu has two "wallpapers" options
"Log"
01-12 12:26:47.194:d/subsettings (7598): Launching Fragment com.android.settings.WallpaperTypeSettings
"Debug"
Find Wallpapertypesettings This file
Click "Show", "wallpaper" option, pop up "Select Wallpaper Source" (Choose wallpaper from) page
Enter the following file
Wallpapertypesettings.java (packages\apps\settings\src\com\android\settings)
Wallpapertypesettings extends Settingspreferencefragment implements Indexable
This class inherits from Settingspreferencefragment
/**
* Base class for Settings fragments, with some helper functions and dialog Management.
*/
public class Settingspreferencefragment extends Preferencefragment implements Dialogcreatable
The settings options for the source of the wallpaper are dynamically loaded.
Populatewallpapertypes () method in Wallpapertypesettings.java
Private voidpopulatewallpapertypes () {//Search for activities that satisfy the Action_set_wallpaper ACTIONFinalIntent Intent =NewIntent (intent.action_set_wallpaper);FinalPackagemanager pm =Getpackagemanager ();FinalList<resolveinfo> rList =pm.queryintentactivities (intent,packagemanager.match_default_only);FinalPreferencescreen parent =Getpreferencescreen ();p arent.setorderingasadded (false);//Add Preference Items for each of the matching activities for(ResolveInfo info:rlist) {Preference pref=NewPreference (Getactivity ()); Intent prefintent=NewIntent (Intent);p refintent.setcomponent (Newcomponentname (Info.activityInfo.packageName, info.activityInfo.name));p ref.setintent (prefintent); Charsequence label=Info.loadlabel (PM);if(Label = =NULL) Label =info.activityinfo.packagename;pref.settitle (label);p arent.addpreference (pref);}}
Altogether found 4 packages to set wallpaper
com.android.launcher--Wallpaper Options
com.cyanogenmod.trebuchet--wallpapers, including photos and live wallpaper, etc.
com.android.gallery3d--Gallery
com.android.wallpaper.livepicker--Live Wallpaper
Here, I selectively do not load com.android.launcher
The Modified code:
if (!info.activityinfo.packagename.equals ("Com.android.launcher" )) { Parent.addpreference (pref);} // Fix Bug End
Last effect, select the wallpaper source interface with only 3 options
/**-------------------------------Appendix-------------------------------*/
Wallpaper_chooser.xml (Packages\apps\launcher2\res\layout)
Sets the page when the wallpaper is set. Above is the wallpaper, below is a set button.
Android5.1 Wallpaper Source option has two "wallpapers" option