Merge \"Hide Set Wallpaper in Settings suggestion if it is not allowed\" into nyc-mr1-dev

am: 1a8be1e372

Change-Id: Ic8a85dbb4b654f6df0bad993a1cce986f60ab193
This commit is contained in:
Tony Mak
2016-07-14 01:38:16 +00:00
committed by android-build-merger

View 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;