summaryrefslogtreecommitdiffstats
path: root/core/java/com/android
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2013-03-06 13:41:23 -0800
committerWink Saville <wink@google.com>2013-03-11 09:32:48 -0700
commit4753cd2014b3db7ab47a9d408601e9e17f790a21 (patch)
treebeaef9722aefcad837a63e6d3c8100d6190a3525 /core/java/com/android
parent7341786b138cb52eac053108b524ea3296d40f6d (diff)
downloadframeworks_base-4753cd2014b3db7ab47a9d408601e9e17f790a21.zip
frameworks_base-4753cd2014b3db7ab47a9d408601e9e17f790a21.tar.gz
frameworks_base-4753cd2014b3db7ab47a9d408601e9e17f790a21.tar.bz2
Add additional message methods.
Change-Id: Iac96815f7b72bcb3b9c658a24c24e0733e0ea1b0
Diffstat (limited to 'core/java/com/android')
-rw-r--r--core/java/com/android/internal/util/StateMachine.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/core/java/com/android/internal/util/StateMachine.java b/core/java/com/android/internal/util/StateMachine.java
index 58d4aa7..e547f23 100644
--- a/core/java/com/android/internal/util/StateMachine.java
+++ b/core/java/com/android/internal/util/StateMachine.java
@@ -1606,6 +1606,19 @@ public class StateMachine {
*
* Message is ignored if state machine has quit.
*/
+ public final void sendMessage(int what, int arg1, int arg2, Object obj) {
+ // mSmHandler can be null if the state machine has quit.
+ SmHandler smh = mSmHandler;
+ if (smh == null) return;
+
+ smh.sendMessage(obtainMessage(what, arg1, arg2, obj));
+ }
+
+ /**
+ * Enqueue a message to this state machine.
+ *
+ * Message is ignored if state machine has quit.
+ */
public final void sendMessage(Message msg) {
// mSmHandler can be null if the state machine has quit.
SmHandler smh = mSmHandler;
@@ -1645,6 +1658,20 @@ public class StateMachine {
*
* Message is ignored if state machine has quit.
*/
+ public final void sendMessageDelayed(int what, int arg1, int arg2, Object obj,
+ long delayMillis) {
+ // mSmHandler can be null if the state machine has quit.
+ SmHandler smh = mSmHandler;
+ if (smh == null) return;
+
+ smh.sendMessageDelayed(obtainMessage(what, arg1, arg2, obj), delayMillis);
+ }
+
+ /**
+ * Enqueue a message to this state machine after a delay.
+ *
+ * Message is ignored if state machine has quit.
+ */
public final void sendMessageDelayed(Message msg, long delayMillis) {
// mSmHandler can be null if the state machine has quit.
SmHandler smh = mSmHandler;
@@ -1687,6 +1714,20 @@ public class StateMachine {
*
* Message is ignored if state machine has quit.
*/
+ protected final void sendMessageAtFrontOfQueue(int what, int arg1, int arg2, Object obj) {
+ // mSmHandler can be null if the state machine has quit.
+ SmHandler smh = mSmHandler;
+ if (smh == null) return;
+
+ smh.sendMessageAtFrontOfQueue(obtainMessage(what, arg1, arg2, obj));
+ }
+
+ /**
+ * Enqueue a message to the front of the queue for this state machine.
+ * Protected, may only be called by instances of StateMachine.
+ *
+ * Message is ignored if state machine has quit.
+ */
protected final void sendMessageAtFrontOfQueue(Message msg) {
// mSmHandler can be null if the state machine has quit.
SmHandler smh = mSmHandler;