mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-23 13:40:43 +01:00
Preparing call activity for notifications
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
13ee8c1977
commit
de02ad278c
@ -70,6 +70,7 @@ import com.nextcloud.talk.events.MediaStreamEvent;
|
|||||||
import com.nextcloud.talk.events.PeerConnectionEvent;
|
import com.nextcloud.talk.events.PeerConnectionEvent;
|
||||||
import com.nextcloud.talk.events.SessionDescriptionSendEvent;
|
import com.nextcloud.talk.events.SessionDescriptionSendEvent;
|
||||||
import com.nextcloud.talk.persistence.entities.UserEntity;
|
import com.nextcloud.talk.persistence.entities.UserEntity;
|
||||||
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
import com.nextcloud.talk.webrtc.MagicAudioManager;
|
import com.nextcloud.talk.webrtc.MagicAudioManager;
|
||||||
import com.nextcloud.talk.webrtc.MagicPeerConnectionWrapper;
|
import com.nextcloud.talk.webrtc.MagicPeerConnectionWrapper;
|
||||||
import com.nextcloud.talk.webrtc.MagicWebRTCUtils;
|
import com.nextcloud.talk.webrtc.MagicWebRTCUtils;
|
||||||
@ -101,6 +102,7 @@ import org.webrtc.VideoSource;
|
|||||||
import org.webrtc.VideoTrack;
|
import org.webrtc.VideoTrack;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.CookieManager;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -153,6 +155,11 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
NcApi ncApi;
|
NcApi ncApi;
|
||||||
@Inject
|
@Inject
|
||||||
EventBus eventBus;
|
EventBus eventBus;
|
||||||
|
@Inject
|
||||||
|
UserUtils userUtils;
|
||||||
|
@Inject
|
||||||
|
CookieManager cookieManager;
|
||||||
|
|
||||||
PeerConnectionFactory peerConnectionFactory;
|
PeerConnectionFactory peerConnectionFactory;
|
||||||
MediaConstraints audioConstraints;
|
MediaConstraints audioConstraints;
|
||||||
MediaConstraints videoConstraints;
|
MediaConstraints videoConstraints;
|
||||||
@ -205,11 +212,41 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
roomToken = getIntent().getExtras().getString("roomToken", "");
|
roomToken = getIntent().getExtras().getString("roomToken", "");
|
||||||
userEntity = Parcels.unwrap((Parcelable) getIntent().getExtras().get("userEntity"));
|
userEntity = Parcels.unwrap((Parcelable) getIntent().getExtras().get("userEntity"));
|
||||||
callSession = "0";
|
callSession = "0";
|
||||||
|
|
||||||
credentials = ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken());
|
credentials = ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken());
|
||||||
initViews();
|
|
||||||
|
|
||||||
|
if (userUtils.getCurrentUser() != null && userUtils.getCurrentUser() != userEntity) {
|
||||||
|
userUtils.createOrUpdateUser(userEntity.getUsername(),
|
||||||
|
userEntity.getToken(), userEntity.getBaseUrl(), null,
|
||||||
|
null, true)
|
||||||
|
.subscribe(new Observer<UserEntity>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(UserEntity userEntity) {
|
||||||
|
cookieManager.getCookieStore().removeAll();
|
||||||
|
userUtils.disableAllUsersWithoutId(userEntity.getId());
|
||||||
|
initViews();
|
||||||
checkPermissions();
|
checkPermissions();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
initViews();
|
||||||
|
checkPermissions();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user