diff options
author | Ajay Panicker <apanicke@google.com> | 2015-08-27 19:21:39 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-08-27 19:21:39 +0000 |
commit | 3e5b01185c08c46b80c395ca1f9c93e45cd98ba5 (patch) | |
tree | 2050335f7ad78903bad5a02837be34bdc39c5c8a | |
parent | 4a8034caea13a90c01800ff554539772c6ff5523 (diff) | |
parent | c211978650580904a4b11b7c5b899e9d2f7ed294 (diff) | |
download | frameworks_base-3e5b01185c08c46b80c395ca1f9c93e45cd98ba5.zip frameworks_base-3e5b01185c08c46b80c395ca1f9c93e45cd98ba5.tar.gz frameworks_base-3e5b01185c08c46b80c395ca1f9c93e45cd98ba5.tar.bz2 |
Merge "Add StateMachine.removeDeferredMessages()" into mnc-dev
-rw-r--r-- | core/java/com/android/internal/util/StateMachine.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/com/android/internal/util/StateMachine.java b/core/java/com/android/internal/util/StateMachine.java index 916f19d..447292c 100644 --- a/core/java/com/android/internal/util/StateMachine.java +++ b/core/java/com/android/internal/util/StateMachine.java @@ -29,6 +29,7 @@ import java.io.StringWriter; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; +import java.util.Iterator; import java.util.HashMap; import java.util.Vector; @@ -1864,6 +1865,20 @@ public class StateMachine { } /** + * Removes a message from the deferred messages queue. + */ + protected final void removeDeferredMessages(int what) { + SmHandler smh = mSmHandler; + if (smh == null) return; + + Iterator<Message> iterator = smh.mDeferredMessages.iterator(); + while (iterator.hasNext()) { + Message msg = iterator.next(); + if (msg.what == what) iterator.remove(); + } + } + + /** * Validate that the message was sent by * {@link StateMachine#quit} or {@link StateMachine#quitNow}. * */ |