make some Handler callback magic synchronous to avoid having to implement it properly

This commit is contained in:
Mis012
2022-12-27 17:19:08 +01:00
parent 9ec3bf58c2
commit 696fa5a192
3 changed files with 20 additions and 4 deletions

View File

@@ -595,7 +595,21 @@ public class Handler {
return false;
}
return enqueueMessage(queue, msg, uptimeMillis);*/
return true;
if(mCallback != null) {
// System.out.println("Handler.sendMessageAtTime: directly calling mCallback.handleMessage)");
if(msg.callback != null) {
msg.callback.run();
}
return mCallback.handleMessage(msg);
} else {
// System.out.println("Handler.sendMessageAtTime: not directly calling mCallback.handleMessage - mCallback is null)");
/* do this in this case as well?
if(msg.callback != null) {
msg.callback.run();
}
*/
return true; // false?
}
}
/**