mRunningJob = null;
mParams = null;
mExecutionStartTimeElapsed = 0L;
+ removeOpTimeOut();
return false;
}
try {
public void handleMessage(Message message) {
switch (message.what) {
case MSG_SERVICE_BOUND:
- removeMessages(MSG_TIMEOUT);
+ removeOpTimeOut();
handleServiceBoundH();
break;
case MSG_CALLBACK:
Slog.d(TAG, "MSG_CALLBACK of : " + mRunningJob + " v:" +
(mVerb >= 0 ? VERB_STRINGS[mVerb] : "[invalid]"));
}
- removeMessages(MSG_TIMEOUT);
+ removeOpTimeOut();
if (mVerb == VERB_STARTING) {
final boolean workOngoing = message.arg2 == 1;
* VERB_STOPPING.
*/
private void sendStopMessageH() {
- mCallbackHandler.removeMessages(MSG_TIMEOUT);
+ removeOpTimeOut();
if (mVerb != VERB_EXECUTING) {
Slog.e(TAG, "Sending onStopJob for a job that isn't started. " + mRunningJob);
closeAndCleanupJobH(false /* reschedule */);
service = null;
mAvailable = true;
}
- removeMessages(MSG_TIMEOUT);
+ removeOpTimeOut();
removeMessages(MSG_CALLBACK);
removeMessages(MSG_SERVICE_BOUND);
removeMessages(MSG_CANCEL);
* on with life.
*/
private void scheduleOpTimeOut() {
- mCallbackHandler.removeMessages(MSG_TIMEOUT);
+ removeOpTimeOut();
final long timeoutMillis = (mVerb == VERB_EXECUTING) ?
EXECUTING_TIMESLICE_MILLIS : OP_TIMEOUT_MILLIS;
mCallbackHandler.sendMessageDelayed(m, timeoutMillis);
mTimeoutElapsed = SystemClock.elapsedRealtime() + timeoutMillis;
}
+
+
+ private void removeOpTimeOut() {
+ mCallbackHandler.removeMessages(MSG_TIMEOUT);
+ }
}