mirror of https://github.com/M66B/FairEmail.git
Sync stop operations (2)
This commit is contained in:
parent
c459d3cf36
commit
9558290e56
|
@ -2321,27 +2321,25 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||||
|
|
||||||
// Stop watching operations
|
// Stop watching operations
|
||||||
Log.i(account.name + " stop watching operations");
|
Log.i(account.name + " stop watching operations");
|
||||||
final TwoStateOwner _owner = cowner.value;
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
if (_owner != null) {
|
|
||||||
final CountDownLatch latch = new CountDownLatch(1);
|
|
||||||
getMainHandler().post(new RunnableEx("observe#stop") {
|
|
||||||
@Override
|
|
||||||
public void delegate() {
|
|
||||||
try {
|
|
||||||
_owner.destroy();
|
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.e(ex);
|
|
||||||
} finally {
|
|
||||||
latch.countDown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
getMainHandler().post(new RunnableEx("observe#stop") {
|
||||||
latch.await(5000L, TimeUnit.MILLISECONDS);
|
@Override
|
||||||
} catch (InterruptedException ex) {
|
public void delegate() {
|
||||||
Log.w(ex);
|
try {
|
||||||
|
cowner.value.destroy();
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.e(ex);
|
||||||
|
} finally {
|
||||||
|
latch.countDown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
latch.await(5000L, TimeUnit.MILLISECONDS);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
Log.w(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop executing operations
|
// Stop executing operations
|
||||||
|
|
Loading…
Reference in New Issue