diff options
-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}. * */ |