OSDN Git Service

Hide Set Wallpaper in Settings suggestion if it is not allowed
authorTony Mak <tonymak@google.com>
Wed, 13 Jul 2016 09:57:33 +0000 (17:57 +0800)
committerTony Mak <tonymak@google.com>
Wed, 13 Jul 2016 09:57:33 +0000 (17:57 +0800)
Change-Id: I8030389f3fe945c3df241f347d58b8da04622d9e
Fix: 30089761

src/com/android/settings/dashboard/SuggestionsChecks.java

index 5b8638a..b816a79 100644 (file)
@@ -103,8 +103,9 @@ public class SuggestionsChecks {
         IBinder b = ServiceManager.getService(Context.WALLPAPER_SERVICE);
         IWallpaperManager service = Stub.asInterface(b);
         try {
-            return service.getWallpaper(mCallback, WallpaperManager.FLAG_SYSTEM,
-                    new Bundle(), mContext.getUserId()) != null;
+            return !service.isSetWallpaperAllowed(mContext.getOpPackageName()) ||
+                    service.getWallpaper(mCallback, WallpaperManager.FLAG_SYSTEM,
+                            new Bundle(), mContext.getUserId()) != null;
         } catch (RemoteException e) {
         }
         return false;