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

Commit 85a4490c authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

Clean up associated user refactor for work profile flag

Clean up the flag as it has rolled out already.

Bug: 409611938
Flag: EXEMPT flag cleanup
Test: atest BasicCallTests
Test: atest InCallControllerTests
Change-Id: Ic6fc7696581b2e2198052a20bfafff827f3397f0
parent cec70ca3
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
package: "com.android.server.telecom.flags"
container: "system"

# OWNER=pmadapurmath TARGET=24Q3
flag {
  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: "315035693"
}
 No newline at end of file
# This file intentionally left blank to avoid compilation errors due to removed flag.
+0 −1
Original line number Diff line number Diff line
@@ -1938,7 +1938,6 @@ 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.associatedUserRefactorForWorkProfile(),
                    mCallsManager.getPhoneAccountRegistrar(), mCallsManager.getCurrentUserHandle(),
                    accountHandle);
            if (isIncoming() && !associatedUser.equals(mAssociatedUser)) {
+2 −6
Original line number Diff line number Diff line
@@ -1662,7 +1662,6 @@ public class CallsManager extends Call.ListenerBase
            }
            // Incoming address was set via EXTRA_INCOMING_CALL_ADDRESS above.
            UserHandle associatedUser = UserUtil.getAssociatedUserForCall(
                    mFeatureFlags.associatedUserRefactorForWorkProfile(),
                    getPhoneAccountRegistrar(), getCurrentUserHandle(), phoneAccountHandle);
            call.setAssociatedUser(associatedUser);
        }
@@ -1905,7 +1904,6 @@ 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.associatedUserRefactorForWorkProfile(),
                getPhoneAccountRegistrar(), getCurrentUserHandle(), phoneAccountHandle);
        call.setAssociatedUser(associatedUser);
        setIntentExtrasAndStartTime(call, extras);
@@ -4786,8 +4784,7 @@ public class CallsManager extends Call.ListenerBase
        call.setStatusHints(parcelableConference.getStatusHints());
        call.putConnectionServiceExtras(parcelableConference.getExtras());
        // For conference calls, set the associated user from the target phone account user handle.
        UserHandle associatedUser = UserUtil.getAssociatedUserForCall(
                mFeatureFlags.associatedUserRefactorForWorkProfile(), getPhoneAccountRegistrar(),
        UserHandle associatedUser = UserUtil.getAssociatedUserForCall(getPhoneAccountRegistrar(),
                getCurrentUserHandle(), phoneAccount);
        call.setAssociatedUser(associatedUser);
        // In case this Conference was added via a ConnectionManager, keep track of the original
@@ -5853,8 +5850,7 @@ public class CallsManager extends Call.ListenerBase
                connection.getCallerDisplayNamePresentation());
        // For existing connections, use the phone account user handle to determine the user
        // association with the call.
        UserHandle associatedUser = UserUtil.getAssociatedUserForCall(
                mFeatureFlags.associatedUserRefactorForWorkProfile(), getPhoneAccountRegistrar(),
        UserHandle associatedUser = UserUtil.getAssociatedUserForCall(getPhoneAccountRegistrar(),
                getCurrentUserHandle(), connection.getPhoneAccount());
        call.setAssociatedUser(associatedUser);
        call.addListener(this);
+2 −6
Original line number Diff line number Diff line
@@ -1515,9 +1515,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.associatedUserRefactorForWorkProfile()
                ? callsAssociatedWithUserFromCall.count() == 0
                : mCallsManager.getCalls().isEmpty();
        boolean isCallCountZero = callsAssociatedWithUserFromCall.count() == 0;
        if (isCallCountZero) {
            /** Let's add a 2 second delay before we send unbind to the services to hopefully
             *  give them enough time to process all the pending messages.
@@ -1532,9 +1530,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.associatedUserRefactorForWorkProfile()
                            ? callsAssociatedWithUserFromCall.count() == 0
                            : mCallsManager.getCalls().isEmpty();
                    boolean isCallCountZero = callsAssociatedWithUserFromCall.count() == 0;
                    if (isCallCountZero) {
                        unbindFromServices(userFromCall);
                        mEmergencyCallHelper.maybeRevokeTemporaryLocationPermission();
+2 −3
Original line number Diff line number Diff line
@@ -1339,9 +1339,8 @@ public class PhoneAccountRegistrar {
            // Ensure name is correct.
            CharSequence newLabel = mAppLabelProxy.getAppLabel(
                    account.getAccountHandle().getComponentName().getPackageName(),
                    UserUtil.getAssociatedUserForCall(
                            mTelecomFeatureFlags.associatedUserRefactorForWorkProfile(),
                            this, UserHandle.CURRENT, account.getAccountHandle()));
                    UserUtil.getAssociatedUserForCall(this, UserHandle.CURRENT,
                            account.getAccountHandle()));

            account = account.toBuilder()
                    .setLabel(newLabel)
Loading