summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-06-29 22:26:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-06-29 22:26:34 +0000
commit2de66f7be1ff30605ba86570a693fc9a3651e64d (patch)
tree486d757373412ebcb64bda7d9dbd92194befd8d2 /core/java/android
parent67143a8cfcb6755faa704914efa1b3e3e408bd8b (diff)
parentdbf4a9c27492d7b3a388fc8cafca13e56072948e (diff)
Merge "Don't synchronize inside getWallpaperColors()" into oc-dr1-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/WallpaperManager.java22
1 files changed, 10 insertions, 12 deletions
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index dfcbfc4f8e09..0b8b689ce4e6 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -22,9 +22,9 @@ import android.annotation.Nullable;
import android.annotation.RawRes;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
+import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.annotation.SystemService;
-import android.annotation.SdkConstant.SdkConstantType;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
@@ -74,7 +74,6 @@ import java.io.InputStream;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -369,18 +368,17 @@ public class WallpaperManager {
}
WallpaperColors getWallpaperColors(int which) {
- synchronized (this) {
- if (which != FLAG_LOCK && which != FLAG_SYSTEM)
- throw new IllegalArgumentException(
- "which should be either FLAG_LOCK or FLAG_SYSTEM");
+ if (which != FLAG_LOCK && which != FLAG_SYSTEM) {
+ throw new IllegalArgumentException(
+ "Must request colors for exactly one kind of wallpaper");
+ }
- try {
- return mService.getWallpaperColors(which);
- } catch (RemoteException e) {
- // Can't get colors, connection lost.
- }
- return null;
+ try {
+ return mService.getWallpaperColors(which);
+ } catch (RemoteException e) {
+ // Can't get colors, connection lost.
}
+ return null;
}
public Bitmap peekWallpaperBitmap(Context context, boolean returnDefault,