mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 23:25:20 +03:00
hangup call notification screen after 1 minute
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
ec40ca9b66
commit
5bb8de673e
1 changed files with 6 additions and 4 deletions
|
@ -69,6 +69,7 @@ import org.parceler.Parcels;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -76,6 +77,7 @@ import androidx.annotation.Nullable;
|
|||
import androidx.annotation.RequiresApi;
|
||||
import autodagger.AutoInjector;
|
||||
import butterknife.OnClick;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
@ -217,7 +219,9 @@ public class CallNotificationActivity extends CallBaseActivity {
|
|||
ncApi.getPeersForCall(credentials, ApiUtils.getUrlForCall(apiVersion, userBeingCalled.getBaseUrl(),
|
||||
currentConversation.getToken()))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.takeWhile(observable -> !leavingScreen)
|
||||
.repeatWhen(completed -> completed.zipWith(Observable.range(1, 12), (n, i) -> i)
|
||||
.flatMap(retryCount -> Observable.timer(5, TimeUnit.SECONDS))
|
||||
.takeWhile(observable -> !leavingScreen))
|
||||
.subscribe(new Observer<ParticipantsOverall>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
@ -253,9 +257,7 @@ public class CallNotificationActivity extends CallBaseActivity {
|
|||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
if (!leavingScreen) {
|
||||
handler.postDelayed(() -> checkIfAnyParticipantsRemainInRoom(), 5000);
|
||||
}
|
||||
runOnUiThread(() -> hangup());
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue