|
40 | 40 | import android.app.ActivityManager;
|
41 | 41 | import android.app.ActivityManager.RunningTaskInfo;
|
42 | 42 |
|
| 43 | +import com.facebook.react.HeadlessJsTaskService; |
| 44 | + |
43 | 45 | import java.util.ArrayList;
|
44 | 46 | import java.util.HashMap;
|
45 | 47 | import java.util.Iterator;
|
@@ -190,11 +192,19 @@ private Connection makeOutgoingCall(ConnectionRequest request, String uuid, Bool
|
190 | 192 | }
|
191 | 193 |
|
192 | 194 | private void wakeUpApplication(String uuid, String number, String displayName) {
|
193 |
| - HashMap<String, String> extrasMap = new HashMap(); |
194 |
| - extrasMap.put(EXTRA_CALL_UUID, uuid); |
195 |
| - extrasMap.put(EXTRA_CALLER_NAME, displayName); |
196 |
| - extrasMap.put(EXTRA_CALL_NUMBER, number); |
197 |
| - sendCallRequestToActivity(ACTION_WAKE_APP, extrasMap); |
| 195 | + Intent headlessIntent = new Intent( |
| 196 | + this.getApplicationContext(), |
| 197 | + RNCallKeepBackgroundMessagingService.class |
| 198 | + ); |
| 199 | + headlessIntent.putExtra("callUUID", uuid); |
| 200 | + headlessIntent.putExtra("name", displayName); |
| 201 | + headlessIntent.putExtra("handle", number); |
| 202 | + Log.d(TAG, "wakeUpApplication: " + uuid + ", number : " + number + ", displayName:" + displayName); |
| 203 | + |
| 204 | + ComponentName name = this.getApplicationContext().startService(headlessIntent); |
| 205 | + if (name != null) { |
| 206 | + HeadlessJsTaskService.acquireWakeLockNow(this.getApplicationContext()); |
| 207 | + } |
198 | 208 | }
|
199 | 209 |
|
200 | 210 | private void wakeUpAfterReachabilityTimeout(ConnectionRequest request) {
|
|
0 commit comments