Skip to content

Commit dc89357

Browse files
Adam CohenAndroid (Google) Code Review
authored andcommitted
Merge "Getting rid of hack where the wallpaper offset was being deferred"
2 parents c8ac86b + 791a633 commit dc89357

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

core/java/android/app/WallpaperManager.java

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,6 @@ public void onWallpaperChanged() {
213213
mHandler.sendEmptyMessage(MSG_CLEAR_WALLPAPER);
214214
}
215215

216-
public Handler getHandler() {
217-
return mHandler;
218-
}
219-
220216
public Bitmap peekWallpaperBitmap(Context context, boolean returnDefault) {
221217
synchronized (this) {
222218
if (mWallpaper != null) {
@@ -623,24 +619,14 @@ public void suggestDesiredDimensions(int minimumWidth, int minimumHeight) {
623619
* @param yOffset The offset along the Y dimension, from 0 to 1.
624620
*/
625621
public void setWallpaperOffsets(IBinder windowToken, float xOffset, float yOffset) {
626-
final IBinder fWindowToken = windowToken;
627-
final float fXOffset = xOffset;
628-
final float fYOffset = yOffset;
629-
sGlobals.getHandler().post(new Runnable() {
630-
public void run() {
631-
try {
632-
//Log.v(TAG, "Sending new wallpaper offsets from app...");
633-
ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
634-
fWindowToken, fXOffset, fYOffset, mWallpaperXStep, mWallpaperYStep);
635-
//Log.v(TAG, "...app returning after sending offsets!");
636-
} catch (RemoteException e) {
637-
// Ignore.
638-
} catch (IllegalArgumentException e) {
639-
// Since this is being posted, it's possible that this windowToken is no longer
640-
// valid, for example, if setWallpaperOffsets is called just before rotation.
641-
}
642-
}
643-
});
622+
try {
623+
//Log.v(TAG, "Sending new wallpaper offsets from app...");
624+
ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
625+
windowToken, xOffset, yOffset, mWallpaperXStep, mWallpaperYStep);
626+
//Log.v(TAG, "...app returning after sending offsets!");
627+
} catch (RemoteException e) {
628+
// Ignore.
629+
}
644630
}
645631

646632
/**

0 commit comments

Comments
 (0)