diff --git a/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java b/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java index 025480ac97460cc45775ea11aa43af36522d5df6..106fbf0081b21ea02029add0aca86f55e8a55c07 100644 --- a/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java +++ b/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java @@ -189,7 +189,7 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule implements Life public void reportNewIncomingCall(String uuid, String number, String callerName, boolean hasVideo, String payload) { Log.d(TAG, "[RNCallKeepModule] reportNewIncomingCall, uuid: " + uuid + ", number: " + number + ", callerName: " + callerName); - this.displayIncomingCall(uuid, number, callerName, hasVideo); + this.displayIncomingCall(uuid, number, callerName, hasVideo, null); // Send event to JS WritableMap args = Arguments.createMap(); @@ -434,17 +434,26 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule implements Life this.hasListeners = false; } - @ReactMethod - public void displayIncomingCall(String uuid, String number, String callerName) { + // REBREAK_PATCH: @ReactMethod entfernt — RN New Architecture TurboModule + // erlaubt keine overloaded methods mit gleichem JS-Namen. JS ruft immer den + // 5-arg-Overload (siehe RNCallKeep.js displayIncomingCall implementation). + public void displayIncomingCall3args(String uuid, String number, String callerName) { this.displayIncomingCall(uuid, number, callerName, false, null); } + // REBREAK_PATCH: TurboModule-Interop unterstützt android.os.Bundle nicht als + // @ReactMethod-Parameter. Daher: 4-arg-Variante (ohne Bundle) ist die einzige + // exposed @ReactMethod. JS-Wrapper ruft nie mit payload-Bundle. @ReactMethod public void displayIncomingCall(String uuid, String number, String callerName, boolean hasVideo) { - this.displayIncomingCall(uuid, number, callerName, hasVideo, null); + this.displayIncomingCallInternal(uuid, number, callerName, hasVideo, null); } public void displayIncomingCall(String uuid, String number, String callerName, boolean hasVideo, @Nullable Bundle payload) { + this.displayIncomingCallInternal(uuid, number, callerName, hasVideo, payload); + } + + private void displayIncomingCallInternal(String uuid, String number, String callerName, boolean hasVideo, @Nullable Bundle payload) { if (!isConnectionServiceAvailable() || !hasPhoneAccount()) { Log.w(TAG, "[RNCallKeepModule] displayIncomingCall ignored due to no ConnectionService or no phone account"); return; @@ -483,17 +492,25 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule implements Life conn.onAnswer(); } - @ReactMethod - public void startCall(String uuid, String number, String callerName) { + // REBREAK_PATCH: @ReactMethod entfernt (siehe displayIncomingCall above). + public void startCall3args(String uuid, String number, String callerName) { this.startCall(uuid, number, callerName, false, null); } + public void startCall4args(String uuid, String number, String callerName, boolean hasVideo) { + this.startCall(uuid, number, callerName, hasVideo, null); + } + @ReactMethod public void startCall(String uuid, String number, String callerName, boolean hasVideo) { - this.startCall(uuid, number, callerName, hasVideo, null); + this.startCallInternal(uuid, number, callerName, hasVideo, null); } public void startCall(String uuid, String number, String callerName, boolean hasVideo, @Nullable Bundle payload) { + this.startCallInternal(uuid, number, callerName, hasVideo, payload); + } + + private void startCallInternal(String uuid, String number, String callerName, boolean hasVideo, @Nullable Bundle payload) { Log.d(TAG, "[RNCallKeepModule] startCall called, uuid: " + uuid + ", number: " + number + ", callerName: " + callerName + ", payload: " + payload); if (!isConnectionServiceAvailable() || !hasPhoneAccount() || !hasPermissions() || number == null) {