Loading flags/telecom_work_profile_flags.aconfig +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. src/com/android/server/telecom/Call.java +0 −1 Original line number Diff line number Diff line Loading @@ -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)) { Loading src/com/android/server/telecom/CallsManager.java +2 −6 Original line number Diff line number Diff line Loading @@ -1684,7 +1684,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); } Loading Loading @@ -1927,7 +1926,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); Loading Loading @@ -4840,8 +4838,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 Loading Loading @@ -5907,8 +5904,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); Loading src/com/android/server/telecom/InCallController.java +2 −6 Original line number Diff line number Diff line Loading @@ -1516,9 +1516,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. Loading @@ -1533,9 +1531,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(); Loading src/com/android/server/telecom/PhoneAccountRegistrar.java +2 −3 Original line number Diff line number Diff line Loading @@ -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 Loading
flags/telecom_work_profile_flags.aconfig +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.
src/com/android/server/telecom/Call.java +0 −1 Original line number Diff line number Diff line Loading @@ -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)) { Loading
src/com/android/server/telecom/CallsManager.java +2 −6 Original line number Diff line number Diff line Loading @@ -1684,7 +1684,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); } Loading Loading @@ -1927,7 +1926,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); Loading Loading @@ -4840,8 +4838,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 Loading Loading @@ -5907,8 +5904,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); Loading
src/com/android/server/telecom/InCallController.java +2 −6 Original line number Diff line number Diff line Loading @@ -1516,9 +1516,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. Loading @@ -1533,9 +1531,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(); Loading
src/com/android/server/telecom/PhoneAccountRegistrar.java +2 −3 Original line number Diff line number Diff line Loading @@ -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