Rename work profile associated users fix flag.
Rename the flag for the associated user fix that was addressed in U.
The original flagged change had to be reverted due to a build breakage
and was later relanded with the same flag name. Once the flag was
removed from Gerrit, the flag was deleted and is preventing the workflow
from progressing in Gantry. The fix is to create a separate flag in
order to begin a new workflow.
Bug: 315035693
Test: atest TelecomUnitTests
Change-Id: I573a9e6c7cf77e884c4c5c59f78af965e3c260da
diff --git a/flags/telecom_work_profile_flags.aconfig b/flags/telecom_work_profile_flags.aconfig
index cc78b30..180af59 100644
--- a/flags/telecom_work_profile_flags.aconfig
+++ b/flags/telecom_work_profile_flags.aconfig
@@ -1,8 +1,8 @@
package: "com.android.server.telecom.flags"
flag {
- name: "work_profile_associated_user"
+ name: "associated_user_refactor_for_work_profile"
namespace: "telecom"
description: "Redefines the associated user for calls in the context of work profile support (U+)"
- bug: "294699269"
+ bug: "315035693"
}
\ No newline at end of file
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index c9557f2..1ec113c 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -1789,7 +1789,7 @@
mContext.getPackageManager());
// Set the associated user for the call for MT calls based on the target phone account.
UserHandle associatedUser = UserUtil.getAssociatedUserForCall(
- mFlags.workProfileAssociatedUser(),
+ mFlags.associatedUserRefactorForWorkProfile(),
mCallsManager.getPhoneAccountRegistrar(), mCallsManager.getCurrentUserHandle(),
accountHandle);
if (isIncoming() && !associatedUser.equals(mAssociatedUser)) {
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index e4ea6d5..b04e9fa 100755
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -1511,7 +1511,7 @@
}
// Incoming address was set via EXTRA_INCOMING_CALL_ADDRESS above.
UserHandle associatedUser = UserUtil.getAssociatedUserForCall(
- mFeatureFlags.workProfileAssociatedUser(),
+ mFeatureFlags.associatedUserRefactorForWorkProfile(),
getPhoneAccountRegistrar(), getCurrentUserHandle(), phoneAccountHandle);
call.setAssociatedUser(associatedUser);
}
@@ -1724,7 +1724,7 @@
// For unknown calls, base the associated user off of the target phone account handle.
UserHandle associatedUser = UserUtil.getAssociatedUserForCall(
- mFeatureFlags.workProfileAssociatedUser(),
+ mFeatureFlags.associatedUserRefactorForWorkProfile(),
getPhoneAccountRegistrar(), getCurrentUserHandle(), phoneAccountHandle);
call.setAssociatedUser(associatedUser);
setIntentExtrasAndStartTime(call, extras);
@@ -4269,7 +4269,7 @@
call.putConnectionServiceExtras(parcelableConference.getExtras());
// For conference calls, set the associated user from the target phone account user handle.
UserHandle associatedUser = UserUtil.getAssociatedUserForCall(
- mFeatureFlags.workProfileAssociatedUser(), getPhoneAccountRegistrar(),
+ mFeatureFlags.associatedUserRefactorForWorkProfile(), getPhoneAccountRegistrar(),
getCurrentUserHandle(), phoneAccount);
call.setAssociatedUser(associatedUser);
// In case this Conference was added via a ConnectionManager, keep track of the original
@@ -5326,7 +5326,7 @@
// For existing connections, use the phone account user handle to determine the user
// association with the call.
UserHandle associatedUser = UserUtil.getAssociatedUserForCall(
- mFeatureFlags.workProfileAssociatedUser(), getPhoneAccountRegistrar(),
+ mFeatureFlags.associatedUserRefactorForWorkProfile(), getPhoneAccountRegistrar(),
getCurrentUserHandle(), connection.getPhoneAccount());
call.setAssociatedUser(associatedUser);
call.addListener(this);
diff --git a/src/com/android/server/telecom/InCallController.java b/src/com/android/server/telecom/InCallController.java
index 1aee25c..ad3d26a 100644
--- a/src/com/android/server/telecom/InCallController.java
+++ b/src/com/android/server/telecom/InCallController.java
@@ -1414,7 +1414,7 @@
UserHandle userFromCall = getUserFromCall(call);
Stream<Call> callsAssociatedWithUserFromCall = mCallsManager.getCalls().stream()
.filter((c) -> getUserFromCall(c).equals(userFromCall));
- boolean isCallCountZero = mFeatureFlags.workProfileAssociatedUser()
+ boolean isCallCountZero = mFeatureFlags.associatedUserRefactorForWorkProfile()
? callsAssociatedWithUserFromCall.count() == 0
: mCallsManager.getCalls().isEmpty();
if (isCallCountZero) {
@@ -1427,7 +1427,7 @@
// Check again to make sure there are no active calls for the associated user.
Stream<Call> callsAssociatedWithUserFromCall = mCallsManager.getCalls().stream()
.filter((c) -> getUserFromCall(c).equals(userFromCall));
- boolean isCallCountZero = mFeatureFlags.workProfileAssociatedUser()
+ boolean isCallCountZero = mFeatureFlags.associatedUserRefactorForWorkProfile()
? callsAssociatedWithUserFromCall.count() == 0
: mCallsManager.getCalls().isEmpty();
if (isCallCountZero) {
diff --git a/tests/src/com/android/server/telecom/tests/BasicCallTests.java b/tests/src/com/android/server/telecom/tests/BasicCallTests.java
index d2937e2..0b9ee65 100644
--- a/tests/src/com/android/server/telecom/tests/BasicCallTests.java
+++ b/tests/src/com/android/server/telecom/tests/BasicCallTests.java
@@ -627,7 +627,7 @@
@LargeTest
@Test
public void testIncomingThenOutgoingCalls_AssociatedUsersNotEqual() throws Exception {
- when(mFeatureFlags.workProfileAssociatedUser()).thenReturn(true);
+ when(mFeatureFlags.associatedUserRefactorForWorkProfile()).thenReturn(true);
InCallServiceFixture.setIgnoreOverrideAdapterFlag(true);
// Receive incoming call via mPhoneAccountMultiUser
diff --git a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
index cd8431a..faae148 100644
--- a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
+++ b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
@@ -1844,7 +1844,7 @@
@Test
public void testRemoveAllServiceConnections_MultiUser() throws Exception {
- when(mFeatureFlags.workProfileAssociatedUser()).thenReturn(true);
+ when(mFeatureFlags.associatedUserRefactorForWorkProfile()).thenReturn(true);
setupMocks(false /* isExternalCall */);
setupMockPackageManager(true /* default */, true /* system */, false /* external calls */);
UserHandle workUser = new UserHandle(12);