summaryrefslogtreecommitdiffstats
path: root/WallpaperPicker/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-02-20 01:50:47 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-02-20 01:50:47 +0000
commit9026271410ee93ab5516d6c59f28c21f157eee7d (patch)
tree6f15dce364a95d2c00f6391d456143b8fc501688 /WallpaperPicker/src
parentae52d72ccc32d68bb0b41011c9c00cd707fdc60f (diff)
parentfddef4634cb3b06c85662c24ffa33026d1348d54 (diff)
downloadandroid_packages_apps_Trebuchet-9026271410ee93ab5516d6c59f28c21f157eee7d.tar.gz
android_packages_apps_Trebuchet-9026271410ee93ab5516d6c59f28c21f157eee7d.tar.bz2
android_packages_apps_Trebuchet-9026271410ee93ab5516d6c59f28c21f157eee7d.zip
Merge "Fixing logic to determine if wallpaper change." into ub-launcher3-master
Diffstat (limited to 'WallpaperPicker/src')
-rw-r--r--WallpaperPicker/src/com/android/launcher3/LiveWallpaperListAdapter.java4
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java28
2 files changed, 4 insertions, 28 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/LiveWallpaperListAdapter.java b/WallpaperPicker/src/com/android/launcher3/LiveWallpaperListAdapter.java
index 88f4461bf..0a9050cff 100644
--- a/WallpaperPicker/src/com/android/launcher3/LiveWallpaperListAdapter.java
+++ b/WallpaperPicker/src/com/android/launcher3/LiveWallpaperListAdapter.java
@@ -122,8 +122,8 @@ public class LiveWallpaperListAdapter extends BaseAdapter implements ListAdapter
Intent preview = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
preview.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
mInfo.getComponent());
- a.onLiveWallpaperPickerLaunch(mInfo);
- a.startActivityForResultSafely(preview, WallpaperPickerActivity.PICK_LIVE_WALLPAPER);
+ a.startActivityForResultSafely(preview,
+ WallpaperPickerActivity.PICK_WALLPAPER_THIRD_PARTY_ACTIVITY);
}
}
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
index 043f6306b..05af94d2b 100644
--- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
+++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
@@ -20,7 +20,6 @@ import android.animation.LayoutTransition;
import android.annotation.TargetApi;
import android.app.ActionBar;
import android.app.Activity;
-import android.app.WallpaperInfo;
import android.app.WallpaperManager;
import android.content.Context;
import android.content.Intent;
@@ -83,7 +82,6 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
public static final int IMAGE_PICK = 5;
public static final int PICK_WALLPAPER_THIRD_PARTY_ACTIVITY = 6;
- public static final int PICK_LIVE_WALLPAPER = 7;
private static final String TEMP_WALLPAPER_TILES = "TEMP_WALLPAPER_TILES";
private static final String SELECTED_INDEX = "SELECTED_INDEX";
private static final int FLAG_POST_DELAY_MILLIS = 200;
@@ -102,9 +100,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
ArrayList<Uri> mTempWallpaperTiles = new ArrayList<Uri>();
private SavedWallpaperImages mSavedImages;
- private WallpaperInfo mLiveWallpaperInfoOnPickerLaunch;
private int mSelectedIndex = -1;
- private WallpaperInfo mLastClickedLiveWallpaperInfo;
public static abstract class WallpaperTileInfo {
protected View mView;
@@ -884,25 +880,10 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
Uri uri = data.getData();
addTemporaryWallpaperTile(uri, false);
}
- } else if (requestCode == PICK_WALLPAPER_THIRD_PARTY_ACTIVITY) {
+ } else if (requestCode == PICK_WALLPAPER_THIRD_PARTY_ACTIVITY && resultCode == RESULT_OK) {
+ // Something was set on the third-party activity.
setResult(RESULT_OK);
finish();
- } else if (requestCode == PICK_LIVE_WALLPAPER) {
- WallpaperManager wm = WallpaperManager.getInstance(this);
- final WallpaperInfo oldLiveWallpaper = mLiveWallpaperInfoOnPickerLaunch;
- final WallpaperInfo clickedWallpaper = mLastClickedLiveWallpaperInfo;
- WallpaperInfo newLiveWallpaper = wm.getWallpaperInfo();
- // Try to figure out if a live wallpaper was set;
- if (newLiveWallpaper != null &&
- (oldLiveWallpaper == null
- || !oldLiveWallpaper.getComponent()
- .equals(newLiveWallpaper.getComponent())
- || clickedWallpaper.getComponent()
- .equals(oldLiveWallpaper.getComponent()))) {
- // Return if a live wallpaper was set
- setResult(RESULT_OK);
- finish();
- }
}
}
@@ -1109,11 +1090,6 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
return mSavedImages;
}
- public void onLiveWallpaperPickerLaunch(WallpaperInfo info) {
- mLastClickedLiveWallpaperInfo = info;
- mLiveWallpaperInfoOnPickerLaunch = WallpaperManager.getInstance(this).getWallpaperInfo();
- }
-
static class ZeroPaddingDrawable extends LevelListDrawable {
public ZeroPaddingDrawable(Drawable d) {
super();