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

Commit a40c5b99 authored by Matías Hernández's avatar Matías Hernández Committed by Automerger Merge Worker
Browse files

Merge "Allow tests to verify the result of...

Merge "Allow tests to verify the result of PrimarySwitchPreference.setSwitchEnabled()" into udc-dev am: abe2b54b am: b6e6e6b3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21850643



Change-Id: I284b1fd8c015ac4d923fbb4403601b7d00442e15
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents afdc27d7 b6e6e6b3
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.