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

Commit 476aa0b3 authored by Ayush Sharma's avatar Ayush Sharma Committed by Android (Google) Code Review
Browse files

Merge "Dont throw exception if admin is null"

parents dcd1b92d 444cabf2
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -52,7 +52,6 @@ public abstract class ActionDisabledLearnMoreButtonLauncher {
    public final void setupLearnMoreButtonToShowAdminPolicies(Context context,
    public final void setupLearnMoreButtonToShowAdminPolicies(Context context,
            int enforcementAdminUserId, EnforcedAdmin enforcedAdmin) {
            int enforcementAdminUserId, EnforcedAdmin enforcedAdmin) {
        requireNonNull(context, "context cannot be null");
        requireNonNull(context, "context cannot be null");
        requireNonNull(enforcedAdmin, "enforcedAdmin cannot be null");


        // The "Learn more" button appears only if the restriction is enforced by an admin in the
        // The "Learn more" button appears only if the restriction is enforced by an admin in the
        // same profile group or by the device owner. Otherwise the admin package and its policies
        // same profile group or by the device owner. Otherwise the admin package and its policies
@@ -132,7 +131,7 @@ public abstract class ActionDisabledLearnMoreButtonLauncher {
    }
    }


    private void showAdminPolicies(Context context, EnforcedAdmin enforcedAdmin) {
    private void showAdminPolicies(Context context, EnforcedAdmin enforcedAdmin) {
        if (enforcedAdmin.component != null) {
        if (enforcedAdmin != null && enforcedAdmin.component != null) {
            launchShowAdminPolicies(context, enforcedAdmin.user, enforcedAdmin.component);
            launchShowAdminPolicies(context, enforcedAdmin.user, enforcedAdmin.component);
        } else {
        } else {
            launchShowAdminSettings(context);
            launchShowAdminSettings(context);