Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 450039ae authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

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
parent 95cb9d2c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
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
+1 −1
Original line number Diff line number Diff line
@@ -1789,7 +1789,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
                    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)) {
+4 −4
Original line number Diff line number Diff line
@@ -1511,7 +1511,7 @@ public class CallsManager extends Call.ListenerBase
            }
            // 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 @@ public class CallsManager extends Call.ListenerBase

        // 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 @@ public class CallsManager extends Call.ListenerBase
        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 @@ public class CallsManager extends Call.ListenerBase
        // 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);
+2 −2
Original line number Diff line number Diff line
@@ -1414,7 +1414,7 @@ public class InCallController extends CallsManagerListenerBase implements
        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 @@ public class InCallController extends CallsManagerListenerBase implements
                    // 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) {
+1 −1
Original line number Diff line number Diff line
@@ -627,7 +627,7 @@ public class BasicCallTests extends TelecomSystemTest {
    @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
Loading