OSDN Git Service

WallpaperManager: support custom default cropper.
authorOren Blasberg <orenb@google.com>
Fri, 26 Feb 2016 19:01:23 +0000 (11:01 -0800)
committerOren Blasberg <orenb@google.com>
Fri, 26 Feb 2016 21:19:30 +0000 (13:19 -0800)
If the component name is specified by the OEM, that component is used
as the default (fallback) cropper rather than
com.android.wallpapercropper.

Bug: 26084319
Change-Id: I5c79beb8e84721944e752bda637cdf0377b8d826

core/java/android/app/WallpaperManager.java
core/res/res/values/config.xml
core/res/res/values/symbols.xml

index c3512ec..b7e31ab 100644 (file)
@@ -767,7 +767,9 @@ public class WallpaperManager {
         }
 
         // fallback crop activity
-        cropAndSetWallpaperIntent.setPackage("com.android.wallpapercropper");
+        final String cropperPackage = mContext.getString(
+                com.android.internal.R.string.config_wallpaperCropperPackage);
+        cropAndSetWallpaperIntent.setPackage(cropperPackage);
         List<ResolveInfo> cropAppList = packageManager.queryIntentActivities(
                 cropAndSetWallpaperIntent, 0);
         if (cropAppList.size() > 0) {
index 9552820..b65f19b 100644 (file)
          much in the way of user data.
     -->
     <bool name="config_strongAuthRequiredOnBoot">true</bool>
+
+    <!-- Wallpaper cropper package. Used as the default cropper if the active launcher doesn't
+         handle wallpaper cropping.
+    -->
+    <string name="config_wallpaperCropperPackage" translatable="false">com.android.wallpapercropper</string>
 </resources>
index ff247b5..44a7a8d 100644 (file)
   <java-symbol type="string" name="carrier_app_notification_title" />
   <java-symbol type="string" name="carrier_app_notification_text" />
   <java-symbol type="string" name="negative_duration" />
+
+  <!-- WallpaperManager config -->
+  <java-symbol type="string" name="config_wallpaperCropperPackage" />
 </resources>