diff options
author | Jesse Hall <jessehall@google.com> | 2012-10-04 16:29:19 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2012-10-04 16:40:35 -0700 |
commit | 9a14392256354538f1f43a5e80fe46c2c2b965cb (patch) | |
tree | c0dc91ffe37eb9f3e468d51c8ceb465d663c6a61 /services | |
parent | 81cd5d3b94d21253a0be925f4ae58cc7f4afeef7 (diff) | |
download | frameworks_native-9a14392256354538f1f43a5e80fe46c2c2b965cb.zip frameworks_native-9a14392256354538f1f43a5e80fe46c2c2b965cb.tar.gz frameworks_native-9a14392256354538f1f43a5e80fe46c2c2b965cb.tar.bz2 |
Ignore display state changes for disconnected displays
When a display is disconnected, removing it from SurfaceFlinger's
display list is non-atomic with removing it from the Display Manager
and any in-flight transactions. So SurfaceFlinger might get a display
state change transaction for a display it has already forgotten about.
Just ignore these.
Bug: 7288082
Change-Id: Ic27e55377f3db40fb34e3b1cd67e43297df117a2
Diffstat (limited to 'services')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 8160a7a..1103175 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1707,8 +1707,12 @@ void SurfaceFlinger::setTransactionState( uint32_t SurfaceFlinger::setDisplayStateLocked(const DisplayState& s) { + ssize_t dpyIdx = mCurrentState.displays.indexOfKey(s.token); + if (dpyIdx < 0) + return 0; + uint32_t flags = 0; - DisplayDeviceState& disp(mCurrentState.displays.editValueFor(s.token)); + DisplayDeviceState& disp(mCurrentState.displays.editValueAt(dpyIdx)); if (disp.isValid()) { const uint32_t what = s.what; if (what & DisplayState::eSurfaceChanged) { |