From 804503c75a12e1578f2f71ff3cb32ae912fc9451 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Sun, 16 Sep 2012 00:00:27 -0700 Subject: [PATCH] Add user initialing receiver to select a unique wallpaper. Change-Id: I14652d8108c2e19db821ab5526b6e630db8fe998 --- Android.mk | 2 +- AndroidManifest.xml | 9 +++ .../launcher2/UserInitializeReceiver.java | 70 +++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 src/com/android/launcher2/UserInitializeReceiver.java diff --git a/Android.mk b/Android.mk index 8a3d27653f..351954130e 100644 --- a/Android.mk +++ b/Android.mk @@ -22,7 +22,7 @@ LOCAL_MODULE_TAGS := optional LOCAL_STATIC_JAVA_LIBRARIES := android-common android-support-v13 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src) -LOCAL_SDK_VERSION := 16 +LOCAL_SDK_VERSION := current LOCAL_PACKAGE_NAME := Launcher2 LOCAL_CERTIFICATE := shared diff --git a/AndroidManifest.xml b/AndroidManifest.xml index c13bd3b6a1..d0ca53edb0 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -135,6 +135,15 @@ + + + + + + + list = new ArrayList(); + addWallpapers(resources, packageName, R.array.wallpapers, list); + addWallpapers(resources, packageName, R.array.extra_wallpapers, list); + WallpaperManager wpm = (WallpaperManager) context.getSystemService( + Context.WALLPAPER_SERVICE); + for (int i=1; i outList) { + final String[] extras = resources.getStringArray(resid); + for (String extra : extras) { + int res = resources.getIdentifier(extra, "drawable", packageName); + if (res != 0) { + outList.add(res); + } + } + } +}