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

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

Merge "Clean up telecom feature flag profile_user_support" into main

parents e77bbb58 6bb019a1
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
package: "com.android.server.telecom.flags"
container: "system"

# OWNER=huiwang TARGET=24Q3
flag {
  name: "profile_user_support"
  namespace: "telecom"
  description: "Fix issues related to the profile user like private profile"
  bug: "326270861"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+3 −20
Original line number Diff line number Diff line
@@ -2124,13 +2124,7 @@ public class InCallController extends CallsManagerListenerBase implements
                ? getUserFromCall(call)
                : userHandle;
        UserManager um = mContext.getSystemService(UserManager.class);
        UserHandle parentUser = mFeatureFlags.profileUserSupport()
                ? um.getProfileParent(userToBind) : null;

        if (!mFeatureFlags.profileUserSupport()
                && um.isManagedProfile(userToBind.getIdentifier())) {
            parentUser = um.getProfileParent(userToBind);
        }
        UserHandle parentUser = um.getProfileParent(userToBind);

        // Track the call if we don't already know about it.
        addCall(call);
@@ -2175,12 +2169,7 @@ public class InCallController extends CallsManagerListenerBase implements
    public void bindToServices(Call call) {
        UserHandle userFromCall = getUserFromCall(call);
        UserManager um = mContext.getSystemService(UserManager.class);
        UserHandle parentUser = mFeatureFlags.profileUserSupport()
                ? um.getProfileParent(userFromCall) : null;
        if (!mFeatureFlags.profileUserSupport()
                && um.isManagedProfile(userFromCall.getIdentifier())) {
            parentUser = um.getProfileParent(userFromCall);
        }
        UserHandle parentUser = um.getProfileParent(userFromCall);
        Log.i(this, "child:%s  parent:%s", userFromCall, parentUser);

        if (!mInCallServiceConnections.containsKey(userFromCall)) {
@@ -2262,13 +2251,7 @@ public class InCallController extends CallsManagerListenerBase implements
        UserHandle userFromCall = getUserFromCall(call);

        UserManager um = mContext.getSystemService(UserManager.class);
        UserHandle parentUser = mFeatureFlags.profileUserSupport()
                ? um.getProfileParent(userFromCall) : null;

        if (!mFeatureFlags.profileUserSupport()
                && um.isManagedProfile(userFromCall.getIdentifier())) {
            parentUser = um.getProfileParent(userFromCall);
        }
        UserHandle parentUser = um.getProfileParent(userFromCall);

        List<InCallServiceInfo> nonUIInCallComponents =
                getInCallServiceComponents(userFromCall, IN_CALL_SERVICE_TYPE_NON_UI);
+0 −3
Original line number Diff line number Diff line
@@ -329,7 +329,6 @@ public class InCallControllerTests extends TelecomTestCase {
        when(mFeatureFlags.separatelyBindToBtIncallService()).thenReturn(false);
        when(mFeatureFlags.telecomResolveHiddenDependencies()).thenReturn(true);
        when(mMockCurrentUserManager.isManagedProfile()).thenReturn(true);
        when(mFeatureFlags.profileUserSupport()).thenReturn(false);
        when(mFeatureFlags.resolveHiddenDependenciesTwo()).thenReturn(true);
    }

@@ -1945,7 +1944,6 @@ public class InCallControllerTests extends TelecomTestCase {
        when(mMockChildUserCall.getAssociatedUser()).thenReturn(mChildUserHandle);
        when(mMockCallsManager.getCurrentUserHandle()).thenReturn(mParentUserHandle);
        when(mMockUserManager.getProfileParent(mChildUserHandle)).thenReturn(mParentUserHandle);
        when(mFeatureFlags.profileUserSupport()).thenReturn(true);
    }

    /**
@@ -1959,7 +1957,6 @@ public class InCallControllerTests extends TelecomTestCase {
        when(mMockChildUserCall.getAssociatedUser()).thenReturn(mChildUserHandle);
        when(mMockCallsManager.getCurrentUserHandle()).thenReturn(mParentUserHandle);
        when(mMockUserManager.getProfileParent(mChildUserHandle)).thenReturn(mParentUserHandle);
        when(mFeatureFlags.profileUserSupport()).thenReturn(true);
        when(mMockContext.getSystemService(eq(UserManager.class)))
                .thenReturn(mMockUserManager);
        // verify a NullPointerException is not thrown