|
|
|
@ -1,11 +1,10 @@
|
|
|
|
|
diff --git a/app/src/main/java/androidx/lifecycle/ComputableLiveData.java b/app/src/main/java/androidx/lifecycle/ComputableLiveData.java
|
|
|
|
|
index 837a35dbf..338af5c89 100644
|
|
|
|
|
--- a/app/src/main/java/androidx/lifecycle/ComputableLiveData.java
|
|
|
|
|
+++ b/app/src/main/java/androidx/lifecycle/ComputableLiveData.java
|
|
|
|
|
@@ -89,14 +89,22 @@ public abstract class ComputableLiveData<T> {
|
|
|
|
|
--- /home/marcel/support/lifecycle/lifecycle-livedata/src/main/java/androidx/lifecycle/ComputableLiveData.java 2019-07-27 12:47:44.348985792 +0200
|
|
|
|
|
+++ app/src/main/java/androidx/lifecycle/ComputableLiveData.java 2019-08-14 10:25:21.881453609 +0200
|
|
|
|
|
@@ -89,14 +89,25 @@ public abstract class ComputableLiveData
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
boolean computed;
|
|
|
|
|
+ boolean once;
|
|
|
|
|
+ long last;
|
|
|
|
|
do {
|
|
|
|
|
computed = false;
|
|
|
|
@ -13,12 +12,14 @@ index 837a35dbf..338af5c89 100644
|
|
|
|
|
if (mComputing.compareAndSet(false, true)) {
|
|
|
|
|
// as long as it is invalid, keep computing.
|
|
|
|
|
try {
|
|
|
|
|
+ once = true;
|
|
|
|
|
+ last = android.os.SystemClock.elapsedRealtime();
|
|
|
|
|
T value = null;
|
|
|
|
|
while (mInvalid.compareAndSet(true, false)) {
|
|
|
|
|
+ long now = android.os.SystemClock.elapsedRealtime();
|
|
|
|
|
+ if (last + 1500 < now && value != null) {
|
|
|
|
|
+ eu.faircode.email.Log.i(mLiveData + " post age=" + (now - last));
|
|
|
|
|
+ if (value != null && (once || last + 2500 < now)) {
|
|
|
|
|
+ eu.faircode.email.Log.i(mLiveData + " post once=" + once + " age=" + (now - last) + " ms");
|
|
|
|
|
+ once = false;
|
|
|
|
|
+ last = now;
|
|
|
|
|
+ mLiveData.postValue(value);
|
|
|
|
|
+ }
|
|
|
|
|