react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

Android app is not redirecting to phone account settings

Open thiruppathi-svmx opened this issue 2 years ago • 1 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

I was working on integrating the connection service call feature into an Android app. However, I encountered an issue where the Android app was not properly redirecting to the phone account handle, and instead, it remained in the calling accounts Here is the diff that solved my problem:

diff --git a/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java b/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
index 82b173d..7ba5f6e 100644
--- a/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
+++ b/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
@@ -841,23 +841,23 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule {
             return;
         }
 
-        if (Build.MANUFACTURER.equalsIgnoreCase("Samsung") || Build.MANUFACTURER.equalsIgnoreCase("OnePlus")) {
-            Intent intent = new Intent();
-            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
-            intent.setComponent(new ComponentName("com.android.server.telecom",
-                    "com.android.server.telecom.settings.EnableAccountPreferenceActivity"));
 
-            Context context = this.getAppContext();
-            if (context == null) {
-                Log.w(TAG, "[RNCallKeepModule][openPhoneAccounts] no react context found.");
-                return;
-            }
+        //if (Build.MANUFACTURER.equalsIgnoreCase("Samsung") || Build.MANUFACTURER.equalsIgnoreCase("OnePlus") || Build.MANUFACTURER.equalsIgnoreCase("Google")) {
+        Intent intent = new Intent();
+        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
+        intent.setComponent(new ComponentName("com.android.server.telecom",
+                "com.android.server.telecom.settings.EnableAccountPreferenceActivity"));
 
-            context.startActivity(intent);
+        Context context = this.getAppContext();
+        if (context == null) {
+            Log.w(TAG, "[RNCallKeepModule][openPhoneAccounts] no react context found.");
             return;
         }
 
-        openPhoneAccountSettings();
+        context.startActivity(intent);
+        return;
+
+        //openPhoneAccountSettings();
     }
 
     @ReactMethod

This issue body was partially generated by patch-package.

thiruppathi-svmx avatar Jun 27 '23 00:06 thiruppathi-svmx

Hi,

in addition to Google phones there are other manufacturer that have the same problem and Android did not redirect correctly to the phone's account handle. Oppo, Motorola, Realme and Honor.

Jonnyboy85 avatar Feb 23 '24 09:02 Jonnyboy85