Handle outsets when resized is called due to rotation.

Rotation might change while the wallpaper is displayed. If outsets are
present, this must trigger a resized callback and the wallpaper must
take these accounts immediately into account before requesting relayout.

Bug: 22209764

Change-Id: I97f2670f384ccac792e7c2727eb0ef017ec66188
This commit is contained in:
Filip Gruszczynski
2015-07-01 08:35:28 -07:00
parent 96496e2d17
commit 0385059195
2 changed files with 6 additions and 2 deletions

View File

@@ -273,8 +273,8 @@ public abstract class WallpaperService extends Service {
public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
Configuration newConfig) {
Message msg = mCaller.obtainMessageI(MSG_WINDOW_RESIZED,
reportDraw ? 1 : 0);
Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED,
reportDraw ? 1 : 0, outsets);
mCaller.sendMessage(msg);
}
@@ -1194,6 +1194,7 @@ public abstract class WallpaperService extends Service {
} break;
case MSG_WINDOW_RESIZED: {
final boolean reportDraw = message.arg1 != 0;
mEngine.mOutsets.set((Rect) message.obj);
mEngine.updateSurface(true, false, reportDraw);
mEngine.doOffsetsChanged(true);
} break;

View File

@@ -9442,6 +9442,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (w.mContentInsetsChanged
|| w.mVisibleInsetsChanged
|| winAnimator.mSurfaceResized
|| w.mOutsetsChanged
|| configChanged) {
if (DEBUG_RESIZE || DEBUG_ORIENTATION) {
Slog.v(TAG, "Resize reasons for w=" + w + ": "
@@ -9451,6 +9452,8 @@ public class WindowManagerService extends IWindowManager.Stub
+ " " + w.mVisibleInsets.toShortString()
+ " stableInsetsChanged=" + w.mStableInsetsChanged
+ " " + w.mStableInsets.toShortString()
+ " outsetsChanged=" + w.mOutsetsChanged
+ " " + w.mOutsets.toShortString()
+ " surfaceResized=" + winAnimator.mSurfaceResized
+ " configChanged=" + configChanged);
}