Android app is not redirecting to phone account settings
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.
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.