|
@@ -89,9 +89,17 @@ class RNConnectionService extends ReactContextBaseJavaModule {
|
89
|
89
|
ReactApplicationContext ctx = getReactApplicationContext();
|
90
|
90
|
|
91
|
91
|
Uri address = Uri.fromParts(PhoneAccount.SCHEME_SIP, handle, null);
|
92
|
|
- PhoneAccountHandle accountHandle
|
93
|
|
- = ConnectionService.registerPhoneAccount(
|
94
|
|
- getReactApplicationContext(), address, callUUID);
|
|
92
|
+ PhoneAccountHandle accountHandle;
|
|
93
|
+
|
|
94
|
+ try {
|
|
95
|
+ accountHandle
|
|
96
|
+ = ConnectionService.registerPhoneAccount(getReactApplicationContext(), address, callUUID);
|
|
97
|
+ } catch (Throwable tr) {
|
|
98
|
+ JitsiMeetLogger.e(tr, TAG + " error in startCall");
|
|
99
|
+
|
|
100
|
+ promise.reject(tr);
|
|
101
|
+ return;
|
|
102
|
+ }
|
95
|
103
|
|
96
|
104
|
Bundle extras = new Bundle();
|
97
|
105
|
extras.putParcelable(
|
|
@@ -110,22 +118,18 @@ class RNConnectionService extends ReactContextBaseJavaModule {
|
110
|
118
|
try {
|
111
|
119
|
tm = (TelecomManager) ctx.getSystemService(Context.TELECOM_SERVICE);
|
112
|
120
|
tm.placeCall(address, extras);
|
113
|
|
- } catch (Exception e) {
|
114
|
|
- JitsiMeetLogger.e(e, TAG + " error in startCall");
|
|
121
|
+ } catch (Throwable tr) {
|
|
122
|
+ JitsiMeetLogger.e(tr, TAG + " error in startCall");
|
115
|
123
|
if (tm != null) {
|
116
|
124
|
try {
|
117
|
125
|
tm.unregisterPhoneAccount(accountHandle);
|
118
|
|
- } catch (Throwable tr) {
|
|
126
|
+ } catch (Throwable tr1) {
|
119
|
127
|
// UnsupportedOperationException: System does not support feature android.software.connectionservice
|
120
|
128
|
// was observed here. Ignore.
|
121
|
129
|
}
|
122
|
130
|
}
|
123
|
131
|
ConnectionService.unregisterStartCallPromise(callUUID);
|
124
|
|
- if (e instanceof SecurityException) {
|
125
|
|
- promise.reject("SECURITY_ERROR", "Required permissions not granted.");
|
126
|
|
- } else {
|
127
|
|
- promise.reject(e);
|
128
|
|
- }
|
|
132
|
+ promise.reject(tr);
|
129
|
133
|
}
|
130
|
134
|
}
|
131
|
135
|
|