summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Pranav Madapurmath <pmadapurmath@google.com> 2023-11-16 08:37:20 +0000
committer Pranav Madapurmath <pmadapurmath@google.com> 2023-11-17 07:12:59 +0000
commit74319651ebd8c73287edf29cf960e93677f5ebaf (patch)
tree2f92220c977f8e051c3611119a6ad76babc3ef3f
parent02fcb4356a72980f9aff46cb5652bcd74205711d (diff)
Avoid resetting InCallAdapter when set.
This causes issues, for instance, when we have a MO and MT call ongoing. The associated users for both calls would be different based on the logic that was added for work profiles (MT calls associated with target phone account handle user while MO calls are associated with the profile user). As a result, resetting the adapter puts Telecom in a state where it is unable to update the existing calls. The framework changes ensure that the phone instance (which provides the in-call information to the user) is not being reset when it's already instantiated. Bug: 308856446 Bug: 294699269 Test: Manual Test: New unit test to verify that call updates are persevered when MO/MT call are placed from the secondary/guest user. Test: v2/android-platinum/telephony-platinum-tests-ATT Change-Id: I4976c0ec67d515e96f6d4df53c79ac500eb6a06e
-rw-r--r--telecomm/java/android/telecom/InCallService.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java
index 13a045858ab1..bbd01d6bcd67 100644
--- a/telecomm/java/android/telecom/InCallService.java
+++ b/telecomm/java/android/telecom/InCallService.java
@@ -289,6 +289,11 @@ public abstract class InCallService extends Service {
switch (msg.what) {
case MSG_SET_IN_CALL_ADAPTER:
+ if (mPhone != null) {
+ Log.i(this, "mPhone is already instantiated, ignoring "
+ + "request to reset adapter.");
+ break;
+ }
String callingPackage = getApplicationContext().getOpPackageName();
mPhone = new Phone(new InCallAdapter((IInCallAdapter) msg.obj), callingPackage,
getApplicationContext().getApplicationInfo().targetSdkVersion);