Have WakeupMessage call Handler#dispatchMessage()

Handler has no fewer than three ways by which a message might be
handled:

    [1] the msg itself contains a callback (msg.callback.run())

    [2] the Handler was instantiated with a Handler.Callback
        (mCallback.handleMessage(msg))

    [3] the Handler instance was a subclass and could have
        overridden handleMessage()

Handler#dispatchMessage() tries to find the correct way to dispatch
a message, check the above in the above order.

Bug: 21859053
Change-Id: I284cf7ace93af167d95d13b297ec42d4bed15992
This commit is contained in:
Erik Kline
2016-08-31 15:59:08 +09:00
parent bdb81a0a7f
commit a457ebbda6

View File

@@ -108,7 +108,7 @@ public class WakeupMessage implements AlarmManager.OnAlarmListener {
}
if (stillScheduled) {
Message msg = mHandler.obtainMessage(mCmd, mArg1, mArg2, mObj);
mHandler.handleMessage(msg);
mHandler.dispatchMessage(msg);
msg.recycle();
}
}