Loading flags/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -39,5 +39,6 @@ aconfig_declarations { "telecom_bluetoothroutemanager_flags.aconfig", "telecom_work_profile_flags.aconfig", "telecom_connection_service_wrapper_flags.aconfig", "telecom_profile_user_flags.aconfig", ], } flags/telecom_profile_user_flags.aconfig 0 → 100644 +12 −0 Original line number Diff line number Diff line package: "com.android.server.telecom.flags" container: "system" flag { name: "profile_user_support" namespace: "telecom" description: "Fix issues related to the profile user like private profile" bug: "326270861" metadata { purpose: PURPOSE_BUGFIX } } src/com/android/server/telecom/InCallController.java +4 −12 Original line number Diff line number Diff line Loading @@ -104,8 +104,6 @@ public class InCallController extends CallsManagerListenerBase implements public static final String SET_IN_CALL_ADAPTER_ERROR_MSG = "Exception thrown while setting the in-call adapter."; private final com.android.internal.telephony.flags.FeatureFlags mTelephonyFeatureFlags; @VisibleForTesting public void setAnomalyReporterAdapter(AnomalyReporterAdapter mAnomalyReporterAdapter){ mAnomalyReporter = mAnomalyReporterAdapter; Loading Loading @@ -1296,12 +1294,6 @@ public class InCallController extends CallsManagerListenerBase implements userAddedFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY); mContext.registerReceiver(mUserAddedReceiver, userAddedFilter); mFeatureFlags = featureFlags; if (telephonyFeatureFlags != null) { mTelephonyFeatureFlags = telephonyFeatureFlags; } else { mTelephonyFeatureFlags = new com.android.internal.telephony.flags.FeatureFlagsImpl(); } } private void restrictPhoneCallOps() { Loading Loading @@ -2030,9 +2022,9 @@ public class InCallController extends CallsManagerListenerBase implements public void bindToServices(Call call, boolean skipBTServices) { UserHandle userFromCall = getUserFromCall(call); UserManager um = mContext.getSystemService(UserManager.class); UserHandle parentUser = mTelephonyFeatureFlags.workProfileApiSplit() UserHandle parentUser = mFeatureFlags.profileUserSupport() ? um.getProfileParent(userFromCall) : null; if (!mTelephonyFeatureFlags.workProfileApiSplit() if (!mFeatureFlags.profileUserSupport() && um.isManagedProfile(userFromCall.getIdentifier())) { parentUser = um.getProfileParent(userFromCall); } Loading Loading @@ -2111,10 +2103,10 @@ public class InCallController extends CallsManagerListenerBase implements UserHandle userFromCall = getUserFromCall(call); UserManager um = mContext.getSystemService(UserManager.class); UserHandle parentUser = mTelephonyFeatureFlags.workProfileApiSplit() UserHandle parentUser = mFeatureFlags.profileUserSupport() ? um.getProfileParent(userFromCall) : null; if (!mTelephonyFeatureFlags.workProfileApiSplit() if (!mFeatureFlags.profileUserSupport() && um.isManagedProfile(userFromCall.getIdentifier())) { parentUser = um.getProfileParent(userFromCall); } Loading tests/src/com/android/server/telecom/tests/InCallControllerTests.java +3 −5 Original line number Diff line number Diff line Loading @@ -208,7 +208,6 @@ public class InCallControllerTests extends TelecomTestCase { private UserHandle mChildUserHandle = UserHandle.of(10); private @Mock Call mMockChildUserCall; private UserHandle mParentUserHandle = UserHandle.of(1); private @Mock com.android.internal.telephony.flags.FeatureFlags mTelephonyFeatureFlags; @Override @Before Loading Loading @@ -239,11 +238,9 @@ public class InCallControllerTests extends TelecomTestCase { mMockPermissionInfo); when(mMockContext.getAttributionSource()).thenReturn(new AttributionSource(Process.myUid(), "com.android.server.telecom.tests", null)); when(mTelephonyFeatureFlags.workProfileApiSplit()).thenReturn(false); mInCallController = new InCallController(mMockContext, mLock, mMockCallsManager, mMockSystemStateHelper, mDefaultDialerCache, mTimeoutsAdapter, mEmergencyCallHelper, mCarModeTracker, mClockProxy, mFeatureFlags, mTelephonyFeatureFlags); mEmergencyCallHelper, mCarModeTracker, mClockProxy, mFeatureFlags); // Capture the broadcast receiver registered. doAnswer(invocation -> { mRegisteredReceiver = invocation.getArgument(0); Loading Loading @@ -319,6 +316,7 @@ public class InCallControllerTests extends TelecomTestCase { when(mMockUserManager.getUserInfo(anyInt())).thenReturn(mMockUserInfo); when(mMockUserInfo.isManagedProfile()).thenReturn(true); when(mFeatureFlags.separatelyBindToBtIncallService()).thenReturn(false); when(mFeatureFlags.profileUserSupport()).thenReturn(false); } @Override Loading Loading @@ -1941,7 +1939,7 @@ public class InCallControllerTests extends TelecomTestCase { mMockChildUserInfo); when(mMockUserManager.isManagedProfile(mParentUserHandle.getIdentifier())).thenReturn( false); when(mTelephonyFeatureFlags.workProfileApiSplit()).thenReturn(true); when(mFeatureFlags.profileUserSupport()).thenReturn(true); } @Test Loading Loading
flags/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -39,5 +39,6 @@ aconfig_declarations { "telecom_bluetoothroutemanager_flags.aconfig", "telecom_work_profile_flags.aconfig", "telecom_connection_service_wrapper_flags.aconfig", "telecom_profile_user_flags.aconfig", ], }
flags/telecom_profile_user_flags.aconfig 0 → 100644 +12 −0 Original line number Diff line number Diff line package: "com.android.server.telecom.flags" container: "system" flag { name: "profile_user_support" namespace: "telecom" description: "Fix issues related to the profile user like private profile" bug: "326270861" metadata { purpose: PURPOSE_BUGFIX } }
src/com/android/server/telecom/InCallController.java +4 −12 Original line number Diff line number Diff line Loading @@ -104,8 +104,6 @@ public class InCallController extends CallsManagerListenerBase implements public static final String SET_IN_CALL_ADAPTER_ERROR_MSG = "Exception thrown while setting the in-call adapter."; private final com.android.internal.telephony.flags.FeatureFlags mTelephonyFeatureFlags; @VisibleForTesting public void setAnomalyReporterAdapter(AnomalyReporterAdapter mAnomalyReporterAdapter){ mAnomalyReporter = mAnomalyReporterAdapter; Loading Loading @@ -1296,12 +1294,6 @@ public class InCallController extends CallsManagerListenerBase implements userAddedFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY); mContext.registerReceiver(mUserAddedReceiver, userAddedFilter); mFeatureFlags = featureFlags; if (telephonyFeatureFlags != null) { mTelephonyFeatureFlags = telephonyFeatureFlags; } else { mTelephonyFeatureFlags = new com.android.internal.telephony.flags.FeatureFlagsImpl(); } } private void restrictPhoneCallOps() { Loading Loading @@ -2030,9 +2022,9 @@ public class InCallController extends CallsManagerListenerBase implements public void bindToServices(Call call, boolean skipBTServices) { UserHandle userFromCall = getUserFromCall(call); UserManager um = mContext.getSystemService(UserManager.class); UserHandle parentUser = mTelephonyFeatureFlags.workProfileApiSplit() UserHandle parentUser = mFeatureFlags.profileUserSupport() ? um.getProfileParent(userFromCall) : null; if (!mTelephonyFeatureFlags.workProfileApiSplit() if (!mFeatureFlags.profileUserSupport() && um.isManagedProfile(userFromCall.getIdentifier())) { parentUser = um.getProfileParent(userFromCall); } Loading Loading @@ -2111,10 +2103,10 @@ public class InCallController extends CallsManagerListenerBase implements UserHandle userFromCall = getUserFromCall(call); UserManager um = mContext.getSystemService(UserManager.class); UserHandle parentUser = mTelephonyFeatureFlags.workProfileApiSplit() UserHandle parentUser = mFeatureFlags.profileUserSupport() ? um.getProfileParent(userFromCall) : null; if (!mTelephonyFeatureFlags.workProfileApiSplit() if (!mFeatureFlags.profileUserSupport() && um.isManagedProfile(userFromCall.getIdentifier())) { parentUser = um.getProfileParent(userFromCall); } Loading
tests/src/com/android/server/telecom/tests/InCallControllerTests.java +3 −5 Original line number Diff line number Diff line Loading @@ -208,7 +208,6 @@ public class InCallControllerTests extends TelecomTestCase { private UserHandle mChildUserHandle = UserHandle.of(10); private @Mock Call mMockChildUserCall; private UserHandle mParentUserHandle = UserHandle.of(1); private @Mock com.android.internal.telephony.flags.FeatureFlags mTelephonyFeatureFlags; @Override @Before Loading Loading @@ -239,11 +238,9 @@ public class InCallControllerTests extends TelecomTestCase { mMockPermissionInfo); when(mMockContext.getAttributionSource()).thenReturn(new AttributionSource(Process.myUid(), "com.android.server.telecom.tests", null)); when(mTelephonyFeatureFlags.workProfileApiSplit()).thenReturn(false); mInCallController = new InCallController(mMockContext, mLock, mMockCallsManager, mMockSystemStateHelper, mDefaultDialerCache, mTimeoutsAdapter, mEmergencyCallHelper, mCarModeTracker, mClockProxy, mFeatureFlags, mTelephonyFeatureFlags); mEmergencyCallHelper, mCarModeTracker, mClockProxy, mFeatureFlags); // Capture the broadcast receiver registered. doAnswer(invocation -> { mRegisteredReceiver = invocation.getArgument(0); Loading Loading @@ -319,6 +316,7 @@ public class InCallControllerTests extends TelecomTestCase { when(mMockUserManager.getUserInfo(anyInt())).thenReturn(mMockUserInfo); when(mMockUserInfo.isManagedProfile()).thenReturn(true); when(mFeatureFlags.separatelyBindToBtIncallService()).thenReturn(false); when(mFeatureFlags.profileUserSupport()).thenReturn(false); } @Override Loading Loading @@ -1941,7 +1939,7 @@ public class InCallControllerTests extends TelecomTestCase { mMockChildUserInfo); when(mMockUserManager.isManagedProfile(mParentUserHandle.getIdentifier())).thenReturn( false); when(mTelephonyFeatureFlags.workProfileApiSplit()).thenReturn(true); when(mFeatureFlags.profileUserSupport()).thenReturn(true); } @Test Loading