在 Android 4.0 中,預設壁紙由一個組件名稱決定。若想改成系統內建的動態壁紙,最直接的方法是找到 config.xml 中的 default_wallpaper_component。
常見位置是:
frameworks/base/core/res/res/values/config.xml
內容可能如下:
<string name="default_wallpaper_component" translatable="false">@null</string>
但部分廠商會把覆寫版本放在 device 目錄下,例如:
device/samsung/smdkv210/overlay/frameworks/base/core/res/res/values/config.xml
系統的壁紙配置資訊通常存在:
/data/system/wallpaper_info.xml
若你手動設定過某個動態壁紙,這個檔案會記錄對應的 component。例如:
<wp width="960" height="800" name="" component="com.android.wallpaper/.fall.FallWallpaper" />
其中的 com.android.wallpaper/.fall.FallWallpaper 就是要填入 config 的值。
把 config 改成:
<string name="default_wallpaper_component">com.android.wallpaper/.fall.FallWallpaper</string>
重新編譯並燒錄後,開機預設動態壁紙就會變成指定項目。