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

Commit 70b1751d authored by Victor Chang's avatar Victor Chang
Browse files

Fix that can't launch managed QuickContact in ContactSearch

It happens when caller id is disabled but contacts search is enabled

BUG=26740020

Change-Id: I4ca79c82ed27f6f1da514b31d8d89fc71fd243fb
parent 64382cb7
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -7138,7 +7138,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                if (managedUserId < 0) {
                    return;
                }
                if (getCrossProfileCallerIdDisabledForUser(managedUserId)) {
                if (isCrossProfileQuickContactDisabled(managedUserId)) {
                    if (VERBOSE_LOG) {
                        Log.v(LOG_TAG,
                                "Cross-profile contacts access disabled for user " + managedUserId);
@@ -7153,6 +7153,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        }
    }

    /**
     * @return true if cross-profile QuickContact is disabled
     */
    private boolean isCrossProfileQuickContactDisabled(int userId) {
        return getCrossProfileCallerIdDisabledForUser(userId)
                && getCrossProfileContactsSearchDisabledForUser(userId);
    }

    /**
     * @return the user ID of the managed user that is linked to the current user, if any.
     * Otherwise -1.