diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java index b030d5060c8b4d8bd59740285186fd31fbdea913..2f552165ca37f2a3dfb44665ed01d85c8c40a93a 100755 --- a/services/core/java/com/android/server/am/TaskRecord.java +++ b/services/core/java/com/android/server/am/TaskRecord.java @@ -1574,36 +1574,34 @@ final class TaskRecord { Rect updateOverrideConfigurationFromLaunchBounds(boolean defaultBounds) { Rect oriBounds; - int reserved = 20; - int width = 1920 - reserved; - int height = 1080 - 40 - reserved; // 40 means the height of mission Board + int reserved = 10; + int height = 1080 - 40 - 2 * reserved; // 40 means the height of mission Board + int width = 1920 - 40 - 2 * reserved; // maybe mission Board is set to left or right if (defaultBounds) { oriBounds = validateBounds(getLaunchBounds()); - - if (oriBounds == null) { - } else if (oriBounds.height() >= height || oriBounds.width() >= width) { - oriBounds.offsetTo(0, 0); - } else { - int level =10; - int cnt = (int)(System.currentTimeMillis() % level); - - int offsetY = (height - oriBounds.height()) / level * cnt; - int offsetX = (width - oriBounds.width()) / level * cnt; - oriBounds.offsetTo(offsetX, offsetY); - } } else { int left = 300; int top = 300; int right = left + 960; int bottom = top + 540 + 42; oriBounds = new Rect(left, top, right, bottom); + } + + if (oriBounds != null) { + int level = 10; + int offsetY = 0; + int offsetX = 0; - int level =10; - int cnt = (int)(System.currentTimeMillis() % level); + if (oriBounds.height() < height) { + int cntY = (int)(System.currentTimeMillis() % level); + offsetY = reserved + (height - oriBounds.height()) / level * cntY; + } - int offsetY = (height - oriBounds.height()) / level * cnt; - int offsetX = (width - oriBounds.width()) / level * cnt; + if (oriBounds.width() < width) { + int cntX = (int)(System.currentTimeMillis() % level); + offsetX = reserved + (width - oriBounds.width()) / level * cntX; + } oriBounds.offsetTo(offsetX, offsetY); }