Skip to content
Snippets Groups Projects
Commit 24213321 authored by Nick Chameyev's avatar Nick Chameyev Committed by Gerrit Code Review
Browse files

Merge "Fix stuck screen from display change timeout"

parents ac189d4a 1e022839
No related branches found
No related tags found
No related merge requests found
......@@ -114,9 +114,15 @@ public class RemoteDisplayChangeController {
// timed-out, so run all continue callbacks and clear the list
synchronized (mService.mGlobalLock) {
for (int i = 0; i < mCallbacks.size(); ++i) {
mCallbacks.get(i).onContinueRemoteDisplayChange(null /* transaction */);
final ContinueRemoteDisplayChangeCallback callback = mCallbacks.get(i);
if (i == mCallbacks.size() - 1) {
// Clear all callbacks before calling the last one, so that if the callback
// itself calls {@link #isWaitingForRemoteDisplayChange()}, it will get
// {@code false}. After all, there is nothing pending after this one.
mCallbacks.clear();
}
callback.onContinueRemoteDisplayChange(null /* transaction */);
}
mCallbacks.clear();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment