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

Commit f5ea386d authored by yuemingw's avatar yuemingw Committed by Yueming Wang
Browse files

Handle null for the return of getCrossProfileCalendarPackages.

The return value of this API could be null after our decision for
API change as in b/121179845.

Bug: 121179845
Test: make ROBOTEST_FILTER=CrossProfileCalendarPreferenceControllerTest -j40 RunSettingsRoboTests
Change-Id: I834ccf83ecca8959d95288ac4fa1473d12eabfca
parent d2bfbc82
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import androidx.annotation.VisibleForTesting;
import com.android.internal.widget.LockPatternUtils;

import java.util.List;
import java.util.Set;

/**
 * Utility class to host methods usable in adding a restricted padlock icon and showing admin
@@ -325,7 +326,8 @@ public class RestrictedLockUtilsInternal extends RestrictedLockUtils {
        if (admin == null) {
            return null;
        }
        if (dpm.getCrossProfileCalendarPackages().isEmpty()) {
        final Set<String> packages = dpm.getCrossProfileCalendarPackages();
        if (packages != null && packages.isEmpty()) {
            return admin;
        }
        return null;