No refreshUi thundering herd

But may delay by more than the interval this way

(cherry picked from commit ff2bdc8474e9938ceba529fac7858ed88c4ed98e)
This commit is contained in:
Stephen Paul Weber 2024-10-08 22:39:44 -05:00 committed by Arne
parent 855c0b3bbe
commit 1e52dfbc9e

View file

@ -236,7 +236,7 @@ public abstract class XmppActivity extends ActionBarActivity {
final long diff = SystemClock.elapsedRealtime() - mLastUiRefresh;
if (diff > Config.REFRESH_UI_INTERVAL) {
mRefreshUiHandler.removeCallbacks(mRefreshUiRunnable);
runOnUiThread(mRefreshUiRunnable);
mRefreshUiHandler.postDelayed(mRefreshUiRunnable, 1);
} else {
final long next = Config.REFRESH_UI_INTERVAL - diff;
mRefreshUiHandler.removeCallbacks(mRefreshUiRunnable);