Add the dialog when clicking on the diabled switch.
Bug: 302189945 Change-Id: I0bf7774b80a59c70a2ea1725e0adba522854adde
This commit is contained in:
@@ -34,17 +34,11 @@ import com.android.settingslib.search.SearchIndexable;
|
||||
public class ContentProtectionPreferenceFragment extends DashboardFragment {
|
||||
private static final String TAG = "ContentProtectionPreferenceFragment";
|
||||
|
||||
@VisibleForTesting
|
||||
static final String KEY_WORK_PROFILE_SWITCH =
|
||||
"content_protection_preference_user_consent_work_profile_switch";
|
||||
|
||||
// Required by @SearchIndexable to make the fragment and preferences to be indexed.
|
||||
// Do not rename.
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.layout.content_protection_preference_fragment);
|
||||
|
||||
private SwitchPreference mWorkProfileSwitch;
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
@@ -53,14 +47,6 @@ public class ContentProtectionPreferenceFragment extends DashboardFragment {
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
mWorkProfileSwitch = getPreferenceScreen().findPreference(KEY_WORK_PROFILE_SWITCH);
|
||||
// If any work profile on the device, display the disable toggle unchecked
|
||||
if (Utils.getManagedProfile(getContext().getSystemService(UserManager.class)) != null) {
|
||||
mWorkProfileSwitch.setVisible(true);
|
||||
mWorkProfileSwitch.setEnabled(false);
|
||||
mWorkProfileSwitch.setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user