OSDN Git Service

Initialize DisplayContent base info when object is constructed
authorWale Ogunwale <ogunwale@google.com>
Wed, 30 Sep 2015 17:09:39 +0000 (10:09 -0700)
committerFilip Gruszczynski <gruszczy@google.com>
Fri, 13 Nov 2015 04:46:07 +0000 (20:46 -0800)
commit4ff84631af5edc2a30be59c4a3d14afabbaec0cb
treefbf8df97733f831ccb614b1a29da9c0241ab812d
parentffffcf14c58f9795bda802d75308332d0bb49dfe
Initialize DisplayContent base info when object is constructed

It is possible for an external process (e.g. sys-ui) to call into
WM to get the bounds of a stack in between the construction of the
DisplayContent object and SystemServer telling WM that the display
is ready. Incorrect bounds would be returned to the caller in this
case since the baseDisplayWidth/Height is only set when the displayReady
call is made.
We now initialize the base display information when the DisplayContent
object is created so any call to get the logical display rect of the
display will always return the right bounds. This should be okay as the
display manager is initialized way before window manager.

Bug: 22961090
Change-Id: Iebd688ad8f4c08556846fcebb543e58bd2c01414
services/core/java/com/android/server/wm/DisplayContent.java
services/core/java/com/android/server/wm/WindowManagerService.java