onCancel

fun onCancel(action: Runnable)

Runs action when this request is cancelled, or right away, on the calling thread, if it already is.

Use it to abort blocking calls that ignore thread interrupts, such as cancelling the android.os.CancellationSignal passed to SQLiteDatabase.rawQuery or an OkHttp Call. The runtime runs action on its own thread, and a cancellation that races the handler's return can run it after DebugTab.handle has returned, so keep it short, non-blocking, and harmless to run late.