歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Android4.0移植默認動態壁紙修改

Android4.0移植默認動態壁紙修改

日期:2017/3/1 10:06:05   编辑:Linux編程

在網上找了很多都有這方面的說明大致是這樣的:

修改默認動態壁紙在:frameworks/base/core/res/res/values/config.xml裡面有這樣一條信息:

<!-- Component name of the default wallpaper. This will be ImageWallpaper if not

specified -->

<string name="default_wallpaper_component" translatable="false">@null</string>

其中默認的是沒有的,一般都說改這樣,其實不一定,因為有些產家把這個配制文件放在別的地方,例如我的默認的存放在:device/samsung/smdkv210/overlay/frameworks/base/core/res/res/values/config.xml文件其中默認設置是這樣:

<string name="default_wallpaper_component">com.Android.wallpaper/.nexus.NexusWallpaper</string>

這個是默認的動態壁紙。

下面我說下到底怎麼改這動態壁紙,其實我也不知道他這後面的

com.android.wallpaper/.nexus.NexusWallpaper哪來的。於是我看了下

frameworks/base/services/java/com/android/server/WallpaperManagerService.java

裡面有這麼一句:

private static JournaledFile makeJournaledFile() {

final String base = "/data/system/wallpaper_info.xml";

return new JournaledFile(new File(base), new File(base + ".tmp"));

}

就是說系統的wallpaper的配制信息是放在

/data/system/wallpaper_info.xml

這個文件當中的,當你修改了系統的動態壁紙後,這個文件也會隨著被更改,於是我把動態壁紙改成了落葉的

wallpaper_info.xml內容如下:

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>

<wp width="960" height="800" name="" component="com.android.wallpaper/.fall.FallWallpaper" />

得到後面這個東西:

com.android.wallpaper/.fall.FallWallpaper

現在將config.xml裡面改成如下:

<string name="default_wallpaper_component">com.android.wallpaper/.fall.FallWallpaper</string>

然後在編譯這一部分,重新燒錄系統後,默認動態壁紙就變成了你設置的這個。

Copyright © Linux教程網 All Rights Reserved