Catch exceptions when setting wallpaper offsets

Bug: 10514504
This commit is contained in:
Michael Jurka committed 2013-09-05 23:10:14 +02:00
1 parent c58497ee61
commit 1bd90b0ed3
1 file changed
+8 -4
+8 -4
View File
@@ -1013,10 +1013,14 @@ public class Workspace extends SmoothPagedView
private void updateOffset(boolean force) {
if (mWaitingForUpdate || force) {
mWaitingForUpdate = false;
if (computeScrollOffset()) {
mWallpaperManager.setWallpaperOffsets(mWindowToken,
mWallpaperOffset.getCurrX(), 0.5f);
setWallpaperOffsetSteps();
if (computeScrollOffset() && mWindowToken != null) {
try {
mWallpaperManager.setWallpaperOffsets(mWindowToken,
mWallpaperOffset.getCurrX(), 0.5f);
setWallpaperOffsetSteps();
} catch (IllegalArgumentException e) {
Log.e(TAG, "Error updating wallpaper offset: " + e);
}
}
}
}