Compare commits
3 commits
bb281ab7e0
...
80ac659d7c
Author | SHA1 | Date | |
---|---|---|---|
80ac659d7c | |||
3ba7f3e207 | |||
d8d9571476 |
2 changed files with 12 additions and 10 deletions
|
@ -68,8 +68,17 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private PermissionManager mPermissionManager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
|
mPermissionManager = PermissionManager.getInstance(this);
|
||||||
|
mPermissionManager.setNotificationSettings(
|
||||||
|
new NotificationSettings.Builder()
|
||||||
|
.withMessage(R.string.microphone_permission_for_call)
|
||||||
|
.withSmallIcon(R.drawable.ic_notification).build()
|
||||||
|
);
|
||||||
|
|
||||||
// From XmppActivity.connectToBackend
|
// From XmppActivity.connectToBackend
|
||||||
Intent intent = new Intent(this, XmppConnectionService.class);
|
Intent intent = new Intent(this, XmppConnectionService.class);
|
||||||
intent.setAction("ui");
|
intent.setAction("ui");
|
||||||
|
@ -115,16 +124,9 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
Jid with = Jid.ofLocalAndDomain(tel, gateway[1]);
|
Jid with = Jid.ofLocalAndDomain(tel, gateway[1]);
|
||||||
CheogramConnection connection = new CheogramConnection(account, with, postDial);
|
CheogramConnection connection = new CheogramConnection(account, with, postDial);
|
||||||
|
|
||||||
PermissionManager permissionManager = PermissionManager.getInstance(this);
|
|
||||||
permissionManager.setNotificationSettings(
|
|
||||||
new NotificationSettings.Builder()
|
|
||||||
.withMessage(R.string.microphone_permission_for_call)
|
|
||||||
.withSmallIcon(R.drawable.ic_notification).build()
|
|
||||||
);
|
|
||||||
|
|
||||||
Set<String> permissions = new HashSet<>();
|
Set<String> permissions = new HashSet<>();
|
||||||
permissions.add(Manifest.permission.RECORD_AUDIO);
|
permissions.add(Manifest.permission.RECORD_AUDIO);
|
||||||
permissionManager.checkPermissions(permissions, new PermissionManager.PermissionRequestListener() {
|
mPermissionManager.checkPermissions(permissions, new PermissionManager.PermissionRequestListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPermissionGranted() {
|
public void onPermissionGranted() {
|
||||||
connection.setSessionId(xmppConnectionService.getJingleConnectionManager().proposeJingleRtpSession(
|
connection.setSessionId(xmppConnectionService.getJingleConnectionManager().proposeJingleRtpSession(
|
||||||
|
|
|
@ -467,8 +467,8 @@ public class NotificationService {
|
||||||
try {
|
try {
|
||||||
telecomManager.addNewIncomingCall(handle, callInfo);
|
telecomManager.addNewIncomingCall(handle, callInfo);
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
// If the account is not registered or enabled, it could result in a security exception
|
// There *could* be race conditions where the account is not registered yet
|
||||||
// Just fall back to the built-in UI in this case.
|
// when an incoming call is already received
|
||||||
Log.w(Config.LOGTAG, e);
|
Log.w(Config.LOGTAG, e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue