summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-09-07 21:47:51 -0700
committerDianne Hackborn <hackbod@google.com>2009-09-07 22:57:13 -0700
commit8355ae39ad77b8e2e9ff3b4cbff8077a002ce151 (patch)
treead769fea97f369fa1fbd55478d0d42f57d0c8452
parent0f3f48ee9668f232bf54bf75b11d99de7964c143 (diff)
downloadandroid_packages_apps_Trebuchet-8355ae39ad77b8e2e9ff3b4cbff8077a002ce151.tar.gz
android_packages_apps_Trebuchet-8355ae39ad77b8e2e9ff3b4cbff8077a002ce151.tar.bz2
android_packages_apps_Trebuchet-8355ae39ad77b8e2e9ff3b4cbff8077a002ce151.zip
Add "Configure..." to wallpaper menu for configurable live wallpapers.
Change-Id: I41a2e68192acfed60cce344ac1e0cd886a54f348
-rw-r--r--res/values/strings.xml2
-rw-r--r--src/com/android/launcher2/Launcher.java15
2 files changed, 16 insertions, 1 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 75d30e75a..a14dfb350 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -37,6 +37,8 @@
<!-- Title for the screen that lets the user choose a live wallpaper to use
for the system. -->
<string name="live_wallpaper_picker_title">Live wallpaper</string>
+ <!-- List item for configuring the current wallpaper -->
+ <string name="configure_wallpaper">Configure...</string>
<!-- Folders -->
<skip />
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 9bcb53788..b53fee26c 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -22,6 +22,7 @@ import android.app.Dialog;
import android.app.ISearchManager;
import android.app.SearchManager;
import android.app.StatusBarManager;
+import android.app.WallpaperInfo;
import android.app.WallpaperManager;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
@@ -30,6 +31,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.Intent.ShortcutIconResource;
import android.content.pm.ActivityInfo;
+import android.content.pm.LabeledIntent;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
@@ -1232,7 +1234,18 @@ public final class Launcher extends Activity
private void startWallpaper() {
final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER);
- startActivity(Intent.createChooser(pickWallpaper, getString(R.string.chooser_wallpaper)));
+ Intent chooser = Intent.createChooser(pickWallpaper,
+ getText(R.string.chooser_wallpaper));
+ WallpaperManager wm = (WallpaperManager)
+ getSystemService(Context.WALLPAPER_SERVICE);
+ WallpaperInfo wi = wm.getWallpaperInfo();
+ if (wi != null && wi.getSettingsActivity() != null) {
+ LabeledIntent li = new LabeledIntent(getPackageName(),
+ R.string.configure_wallpaper, 0);
+ li.setClassName(wi.getPackageName(), wi.getSettingsActivity());
+ chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { li });
+ }
+ startActivity(chooser);
}
@Override