Compare commits
3 commits
5e8d51db9f
...
bb281ab7e0
Author | SHA1 | Date | |
---|---|---|---|
bb281ab7e0 | |||
729b86a2fc | |||
0cd0678921 |
2 changed files with 10 additions and 12 deletions
|
@ -117,9 +117,9 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
|
|
||||||
PermissionManager permissionManager = PermissionManager.getInstance(this);
|
PermissionManager permissionManager = PermissionManager.getInstance(this);
|
||||||
permissionManager.setNotificationSettings(
|
permissionManager.setNotificationSettings(
|
||||||
new NotificationSettings.Builder()
|
new NotificationSettings.Builder()
|
||||||
.withMessage(R.string.microphone_permission_for_call)
|
.withMessage(R.string.microphone_permission_for_call)
|
||||||
.withSmallIcon(R.drawable.ic_notification).build()
|
.withSmallIcon(R.drawable.ic_notification).build()
|
||||||
);
|
);
|
||||||
|
|
||||||
Set<String> permissions = new HashSet<>();
|
Set<String> permissions = new HashSet<>();
|
||||||
|
@ -166,8 +166,8 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
CheogramConnection connection = new CheogramConnection(account, with, null);
|
CheogramConnection connection = new CheogramConnection(account, with, null);
|
||||||
connection.setSessionId(sessionId);
|
connection.setSessionId(sessionId);
|
||||||
connection.setAddress(
|
connection.setAddress(
|
||||||
Uri.fromParts("tel", with.getLocal(), null),
|
Uri.fromParts("tel", with.getLocal(), null),
|
||||||
TelecomManager.PRESENTATION_ALLOWED
|
TelecomManager.PRESENTATION_ALLOWED
|
||||||
);
|
);
|
||||||
connection.setRinging();
|
connection.setRinging();
|
||||||
|
|
||||||
|
@ -269,7 +269,9 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
public void onAnswer() {
|
public void onAnswer() {
|
||||||
// For incoming calls, a connection update may not have been triggered before answering
|
// For incoming calls, a connection update may not have been triggered before answering
|
||||||
// so we have to acquire the rtp connection object here
|
// so we have to acquire the rtp connection object here
|
||||||
this.rtpConnection = xmppConnectionService.getJingleConnectionManager().findJingleRtpConnection(account, with, sessionId);
|
this.rtpConnection =
|
||||||
|
xmppConnectionService.getJingleConnectionManager()
|
||||||
|
.findJingleRtpConnection(account, with, sessionId);
|
||||||
|
|
||||||
rtpConnection.get().acceptCall();
|
rtpConnection.get().acceptCall();
|
||||||
}
|
}
|
||||||
|
|
|
@ -444,14 +444,10 @@ public class NotificationService {
|
||||||
|
|
||||||
PhoneAccountHandle handle = null;
|
PhoneAccountHandle handle = null;
|
||||||
for (Contact contact : id.account.getRoster().getContacts()) {
|
for (Contact contact : id.account.getRoster().getContacts()) {
|
||||||
if (!contact.getJid().getDomain().equals(id.with.getDomain())) {
|
if (!contact.getJid().getDomain().equals(id.with.getDomain()))
|
||||||
continue;
|
continue;
|
||||||
}
|
if (!contact.getPresences().anyIdentity("gateway", "pstn"))
|
||||||
|
|
||||||
if (!contact.getPresences().anyIdentity("gateway", "pstn")) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
handle = contact.phoneAccountHandle();
|
handle = contact.phoneAccountHandle();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue