Skip to content

Commit bdb7aee

Browse files
bradfitzAndroid Code Review
authored andcommitted
Merge "Fix for crash when setting live wallpaper."
2 parents cb84275 + d9463f5 commit bdb7aee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/java/android/service/wallpaper/WallpaperService.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,11 @@ void updateSurface(boolean forceRelayout, boolean forceReport, boolean redrawNee
514514
mLayout.windowAnimations =
515515
com.android.internal.R.style.Animation_Wallpaper;
516516
mInputChannel = new InputChannel();
517-
mSession.add(mWindow, mLayout, View.VISIBLE, mContentInsets,
518-
mInputChannel);
517+
if (mSession.add(mWindow, mLayout, View.VISIBLE, mContentInsets,
518+
mInputChannel) < 0) {
519+
Log.w(TAG, "Failed to add window while updating wallpaper surface.");
520+
return;
521+
}
519522
mCreated = true;
520523

521524
InputQueue.registerInputChannel(mInputChannel, mInputHandler,

0 commit comments

Comments
 (0)