Skip to content

Commit

Permalink
Central post function
Browse files Browse the repository at this point in the history
  • Loading branch information
uholeschak committed Dec 20, 2024
1 parent 6748332 commit 9082764
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions BmwDeepObd/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3592,17 +3592,11 @@ private void PostUpdateDisplay(bool force = false)

if (force)
{
if (!_updateHandler.HasCallbacks(_updateDisplayForceRunnable))
{
_updateHandler.Post(_updateDisplayForceRunnable);
}
ActivityCommon.PostRunnable(_updateHandler, _updateDisplayForceRunnable);
return;
}

if (!_updateHandler.HasCallbacks(_updateDisplayRunnable))
{
_updateHandler.Post(_updateDisplayRunnable);
}
ActivityCommon.PostRunnable(_updateHandler, _updateDisplayRunnable);
}

private void UpdateDisplay(bool forceUpdate = false)
Expand Down Expand Up @@ -4909,17 +4903,16 @@ private void PostCompileCode()
return;
}

if (!_updateHandler.HasCallbacks(_compileCodeRunnable))
if (ActivityCommon.PostRunnable(_updateHandler, _compileCodeRunnable))
{
#if DEBUG
Log.Info(Tag, string.Format("PostCompileCode accepted: {0}", this));
Log.Info(Tag, string.Format("PostCompileCode rejected: {0}", this));
#endif
_updateHandler.Post(_compileCodeRunnable);
}
else
{
#if DEBUG
Log.Info(Tag, string.Format("PostCompileCode rejected: {0}", this));
Log.Info(Tag, string.Format("PostCompileCode accepted: {0}", this));
#endif
}
}
Expand Down

0 comments on commit 9082764

Please sign in to comment.