64
64
import static io .wazo .callkeep .RNCallKeepModule .ACTION_UNMUTE_CALL ;
65
65
import static io .wazo .callkeep .RNCallKeepModule .ACTION_CHECK_REACHABILITY ;
66
66
import static io .wazo .callkeep .RNCallKeepModule .EXTRA_CALLER_NAME ;
67
- import static io .wazo .callkeep .RNCallKeepModule .EXTRA_CALL_NUMBER ;
67
+ import static io .wazo .callkeep .RNCallKeepModule .EXTRA_CALL_IDENTIFIER ;
68
68
import static io .wazo .callkeep .RNCallKeepModule .EXTRA_CALL_UUID ;
69
69
import static io .wazo .callkeep .RNCallKeepModule .handle ;
70
70
@@ -125,7 +125,7 @@ public static void deinitConnection(String connectionId) {
125
125
@ Override
126
126
public Connection onCreateIncomingConnection (PhoneAccountHandle connectionManagerPhoneAccount , ConnectionRequest request ) {
127
127
Bundle extra = request .getExtras ();
128
- Uri number = request .getAddress ();
128
+ Uri identifier = request .getAddress ();
129
129
String name = extra .getString (EXTRA_CALLER_NAME );
130
130
Connection incomingCallConnection = createConnection (request );
131
131
incomingCallConnection .setRinging ();
@@ -151,27 +151,27 @@ public Connection onCreateOutgoingConnection(PhoneAccountHandle connectionManage
151
151
private Connection makeOutgoingCall (ConnectionRequest request , String uuid , Boolean forceWakeUp ) {
152
152
Bundle extras = request .getExtras ();
153
153
Connection outgoingCallConnection = null ;
154
- String number = request .getAddress ().getSchemeSpecificPart ();
155
- String extrasNumber = extras .getString (EXTRA_CALL_NUMBER );
154
+ String identifier = request .getAddress ().getSchemeSpecificPart ();
155
+ String extrasIdentifier = extras .getString (EXTRA_CALL_IDENTIFIER );
156
156
String displayName = extras .getString (EXTRA_CALLER_NAME );
157
157
Boolean isForeground = VoiceConnectionService .isRunning (this .getApplicationContext ());
158
158
159
- Log .d (TAG , "makeOutgoingCall:" + uuid + ", number : " + number + ", displayName:" + displayName );
159
+ Log .d (TAG , "makeOutgoingCall:" + uuid + ", identifier : " + identifier + ", displayName:" + displayName );
160
160
161
161
// Wakeup application if needed
162
162
if (!isForeground || forceWakeUp ) {
163
163
Log .d (TAG , "onCreateOutgoingConnection: Waking up application" );
164
- this .wakeUpApplication (uuid , number , displayName );
164
+ this .wakeUpApplication (uuid , identifier , displayName );
165
165
} else if (!this .canMakeOutgoingCall () && isReachable ) {
166
166
Log .d (TAG , "onCreateOutgoingConnection: not available" );
167
167
return Connection .createFailedConnection (new DisconnectCause (DisconnectCause .LOCAL ));
168
168
}
169
169
170
170
// TODO: Hold all other calls
171
- if (extrasNumber == null || !extrasNumber .equals (number )) {
171
+ if (extrasIdentifier == null || !extrasIdentifier .equals (number )) {
172
172
extras .putString (EXTRA_CALL_UUID , uuid );
173
173
extras .putString (EXTRA_CALLER_NAME , displayName );
174
- extras .putString (EXTRA_CALL_NUMBER , number );
174
+ extras .putString (EXTRA_CALL_IDENTIFIER , identifier );
175
175
}
176
176
177
177
outgoingCallConnection = createConnection (request );
@@ -195,15 +195,15 @@ private Connection makeOutgoingCall(ConnectionRequest request, String uuid, Bool
195
195
return outgoingCallConnection ;
196
196
}
197
197
198
- private void wakeUpApplication (String uuid , String number , String displayName ) {
198
+ private void wakeUpApplication (String uuid , String identifier , String displayName ) {
199
199
Intent headlessIntent = new Intent (
200
200
this .getApplicationContext (),
201
201
RNCallKeepBackgroundMessagingService .class
202
202
);
203
203
headlessIntent .putExtra ("callUUID" , uuid );
204
204
headlessIntent .putExtra ("name" , displayName );
205
- headlessIntent .putExtra ("handle" , number );
206
- Log .d (TAG , "wakeUpApplication: " + uuid + ", number : " + number + ", displayName:" + displayName );
205
+ headlessIntent .putExtra ("handle" , identifier );
206
+ Log .d (TAG , "wakeUpApplication: " + uuid + ", identifier : " + identifier + ", displayName:" + displayName );
207
207
208
208
ComponentName name = this .getApplicationContext ().startService (headlessIntent );
209
209
if (name != null ) {
@@ -217,9 +217,9 @@ private void wakeUpAfterReachabilityTimeout(ConnectionRequest request) {
217
217
}
218
218
Log .d (TAG , "checkReachability timeout, force wakeup" );
219
219
Bundle extras = request .getExtras ();
220
- String number = request .getAddress ().getSchemeSpecificPart ();
220
+ String identifier = request .getAddress ().getSchemeSpecificPart ();
221
221
String displayName = extras .getString (EXTRA_CALLER_NAME );
222
- wakeUpApplication (this .notReachableCallUuid , number , displayName );
222
+ wakeUpApplication (this .notReachableCallUuid , identifier , displayName );
223
223
224
224
VoiceConnectionService .currentConnectionRequest = null ;
225
225
}
@@ -245,9 +245,9 @@ private Boolean canMakeOutgoingCall() {
245
245
private Connection createConnection (ConnectionRequest request ) {
246
246
Bundle extras = request .getExtras ();
247
247
HashMap <String , String > extrasMap = this .bundleToMap (extras );
248
- extrasMap .put (EXTRA_CALL_NUMBER , request .getAddress ().toString ());
248
+ extrasMap .put (EXTRA_CALL_IDENTIFIER , request .getAddress ().toString ());
249
249
VoiceConnection connection = new VoiceConnection (this , extrasMap );
250
- connection .setConnectionCapabilities (Connection .CAPABILITY_MUTE | Connection . CAPABILITY_SUPPORT_HOLD );
250
+ connection .setConnectionCapabilities (Connection .CAPABILITY_MUTE );
251
251
connection .setInitializing ();
252
252
connection .setExtras (extras );
253
253
currentConnections .put (extras .getString (EXTRA_CALL_UUID ), connection );
0 commit comments