Merge "Allow tests to verify the result of PrimarySwitchPreference.setSwitchEnabled()" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
abe2b54bae
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user