|
@@ -81,6 +81,13 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
81
|
81
|
return new ArrayList<>(connections.values());
|
82
|
82
|
}
|
83
|
83
|
|
|
84
|
+ /**
|
|
85
|
+ * @return {@code true} if running a Samsung device.
|
|
86
|
+ */
|
|
87
|
+ static boolean isSamsungDevice() {
|
|
88
|
+ return android.os.Build.MANUFACTURER.toLowerCase().contains("samsung");
|
|
89
|
+ }
|
|
90
|
+
|
84
|
91
|
/**
|
85
|
92
|
* Registers a start call promise.
|
86
|
93
|
*
|
|
@@ -129,6 +136,14 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
129
|
136
|
ConnectionImpl connection = connections.get(callUUID);
|
130
|
137
|
|
131
|
138
|
if (connection != null) {
|
|
139
|
+ if (isSamsungDevice()) {
|
|
140
|
+ // Required to release the audio focus correctly.
|
|
141
|
+ connection.setOnHold();
|
|
142
|
+ // Prevents from including in the native phone calls history
|
|
143
|
+ connection.setConnectionProperties(
|
|
144
|
+ Connection.PROPERTY_SELF_MANAGED
|
|
145
|
+ | Connection.PROPERTY_IS_EXTERNAL_CALL);
|
|
146
|
+ }
|
132
|
147
|
// Note that the connection is not removed from the list here, but
|
133
|
148
|
// in ConnectionImpl's state changed callback. It's a safer
|
134
|
149
|
// approach, because in case the app would crash on the JavaScript
|