summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Coucheron <arco68@gmail.com>2017-06-29 19:23:01 (GMT)
committerArne Coucheron <arco68@gmail.com>2017-07-15 04:51:06 (GMT)
commite6d41b33bb114840666135137da05237f908c7bc (patch)
tree263054dac4f1bdbd6f8837908aceec2ef41f858b
parent2bf589bec9487b253e2788670433119b4cc18fb8 (diff)
downloadandroid_packages_apps_Trebuchet-e6d41b33bb114840666135137da05237f908c7bc.zip
android_packages_apps_Trebuchet-e6d41b33bb114840666135137da05237f908c7bc.tar.gz
android_packages_apps_Trebuchet-e6d41b33bb114840666135137da05237f908c7bc.tar.bz2
Enable custom wallpaper picker
Change-Id: Iad5638c43f38d240d87c5f5957ec7112cf1c14d7
-rw-r--r--res/values/config.xml3
-rw-r--r--src/com/android/launcher3/Launcher.java6
-rw-r--r--src/com/android/launcher3/util/PackageManagerHelper.java23
3 files changed, 0 insertions, 32 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index 94c4ab7..82bd3fa 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -79,9 +79,6 @@
<!-- Name of an icon provider class. -->
<string name="icon_provider_class" translatable="false"></string>
- <!-- Package name of the default wallpaper picker. -->
- <string name="wallpaper_picker_package" translatable="false"></string>
-
<!-- View ID to use for QSB widget -->
<item type="id" name="qsb_widget" />
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 4672e08..15ba43d 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2641,17 +2641,11 @@ public class Launcher extends Activity
return;
}
- String pickerPackage = getString(R.string.wallpaper_picker_package);
- if (TextUtils.isEmpty(pickerPackage)) {
- pickerPackage = PackageManagerHelper.getWallpaperPickerPackage(getPackageManager());
- }
-
int pageScroll = mWorkspace.getScrollForPage(mWorkspace.getPageNearestToCenterOfScreen());
float offset = mWorkspace.mWallpaperOffset.wallpaperOffsetForScroll(pageScroll);
setWaitingForResult(new PendingRequestArgs(new ItemInfo()));
Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER)
- .setPackage(pickerPackage)
.putExtra(Utilities.EXTRA_WALLPAPER_OFFSET, offset);
intent.setSourceBounds(getViewBounds(v));
startActivityForResult(intent, REQUEST_PICK_WALLPAPER, getActivityLaunchOptions(v));
diff --git a/src/com/android/launcher3/util/PackageManagerHelper.java b/src/com/android/launcher3/util/PackageManagerHelper.java
index 3e15d05..4973d4d 100644
--- a/src/com/android/launcher3/util/PackageManagerHelper.java
+++ b/src/com/android/launcher3/util/PackageManagerHelper.java
@@ -80,29 +80,6 @@ public class PackageManagerHelper {
}
/**
- * Returns the package for a wallpaper picker system app giving preference to a app which
- * is not as image picker.
- */
- public static String getWallpaperPickerPackage(PackageManager pm) {
- ArrayList<String> excludePackages = new ArrayList<>();
- // Exclude packages which contain an image picker
- for (ResolveInfo info : pm.queryIntentActivities(
- new Intent(Intent.ACTION_GET_CONTENT).setType("image/*"), 0)) {
- excludePackages.add(info.activityInfo.packageName);
- }
- excludePackages.add(LIVE_WALLPAPER_PICKER_PKG);
-
- for (ResolveInfo info : pm.queryIntentActivities(
- new Intent(Intent.ACTION_SET_WALLPAPER), 0)) {
- if (!excludePackages.contains(info.activityInfo.packageName) &&
- (info.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
- return info.activityInfo.packageName;
- }
- }
- return excludePackages.get(0);
- }
-
- /**
* Returns true if {@param srcPackage} has the permission required to start the activity from
* {@param intent}. If {@param srcPackage} is null, then the activity should not need
* any permissions