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

Commit 76b2fcbe authored by Matías Hernández's avatar Matías Hernández
Browse files

Allow tests to verify the result of PrimarySwitchPreference.setSwitchEnabled()

Bug: 265064188
Test: atest AppChannelsBypassingDndPreferenceControllerTest
Change-Id: Ic6f921fc0d0d6da03b05be8b2c2b0439241ebdd9
parent f2de79eb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.widget.Switch;

import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.preference.PreferenceViewHolder;

import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
@@ -132,6 +133,11 @@ public class PrimarySwitchPreference extends RestrictedPreference {
        }
    }

    @VisibleForTesting(otherwise = VisibleForTesting.NONE)
    public boolean isSwitchEnabled() {
        return mEnableSwitch;
    }

    /**
     * If admin is not null, disables the switch.
     * Otherwise, keep it enabled.