diff options
author | kaiyiz <kaiyiz@codeaurora.org> | 2014-02-27 12:22:22 +0800 |
---|---|---|
committer | emancebo <emancebo@cyngn.com> | 2014-09-04 10:40:19 -0700 |
commit | 25373c95103dbd7b63b990bf3b45425b1b838977 (patch) | |
tree | af3e2a91baa10f7dbea8135c4ed22f5bf39e9e46 /src | |
parent | e09343aaf29847aec279ec16d1bed85eb46a5c7e (diff) | |
download | android_packages_apps_Gallery2-25373c95103dbd7b63b990bf3b45425b1b838977.tar.gz android_packages_apps_Gallery2-25373c95103dbd7b63b990bf3b45425b1b838977.tar.bz2 android_packages_apps_Gallery2-25373c95103dbd7b63b990bf3b45425b1b838977.zip |
Gallery2: Can set picture as screen color background.
The upgrade of android4.4 make the set wallPaper activity
be executed when set picture as background color.
Add a condition to judge fromScreenColor and when judge the
fromScreenColor is set as true, then execute the activity
of set picture as color background activity instead of set
wallpaper activity.
CRs-Fixed: 623268
Change-Id: Id4dfa745f9d8379af084b8e2752f775ad85c9c52
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/app/Wallpaper.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/com/android/gallery3d/app/Wallpaper.java b/src/com/android/gallery3d/app/Wallpaper.java index 8aa31ee7e..5c19d9016 100644 --- a/src/com/android/gallery3d/app/Wallpaper.java +++ b/src/com/android/gallery3d/app/Wallpaper.java @@ -105,7 +105,14 @@ public class Wallpaper extends Activity { } case STATE_PHOTO_PICKED: { Intent cropAndSetWallpaperIntent; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + boolean fromScreenColor = false; + + // Do this for screencolor select and crop image to preview. + Bundle extras = intent.getExtras(); + if (extras != null) { + fromScreenColor = extras.getBoolean(KEY_FROM_SCREENCOLOR, false); + } + if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) && (!fromScreenColor)) { WallpaperManager wpm = WallpaperManager.getInstance(getApplicationContext()); try { cropAndSetWallpaperIntent = wpm.getCropAndSetWallpaperIntent(mPickedItem); @@ -121,13 +128,7 @@ public class Wallpaper extends Activity { int width,height; float spotlightX,spotlightY; - boolean fromScreenColor = false; - // Do this for screencolor select and crop image to preview. - Bundle extras = intent.getExtras(); - if (extras != null) { - fromScreenColor = extras.getBoolean(KEY_FROM_SCREENCOLOR, false); - } if (fromScreenColor) { width = extras.getInt(KEY_ASPECT_X, 0); height = extras.getInt(KEY_ASPECT_Y, 0); |