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

Commit fcb3c7cc authored by Hui Wang's avatar Hui Wang Committed by Android (Google) Code Review
Browse files

Merge "Update the flag for the fix related to the profile user issues" into main

parents 534e7fdc 4936b1fd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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",
    ],
}
+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
  }
}
+4 −12
Original line number Diff line number Diff line
@@ -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;
@@ -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() {
@@ -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);
        }
@@ -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);
        }
+3 −5
Original line number Diff line number Diff line
@@ -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
@@ -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);
@@ -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
@@ -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