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

Commit d7a64860 authored by Irem Uguz's avatar Irem Uguz Committed by Android (Google) Code Review
Browse files

Revert^2 "usb: Initialize restricted radio button for USB settings"

This reverts commit 24a414ab.

Reason for revert: The initial revert was done because of bugs b/417967530 and b/418075552. However the investigation (thanks to rubinxu@google.com) shows that the reverted CL is not the culprit. That's why I am reverting the revert in order to keep the original submit https://googleplex-android-review.git.corp.google.com/c/platform/packages/apps/Settings/+/33507289.

Change-Id: I64ac89d89409012668ebdfb6d30260ef4d0a1420
parent 24a414ab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ public class UsbDefaultFragment extends RadioButtonPickerFragment implements
            if (pref != null) {
                final boolean isSupported = mUsbBackend.areFunctionsSupported(option);
                pref.setEnabled(isSupported);
                String userRestriction = mUsbBackend.maybeGetUserRestriction(option);
                String userRestriction = UsbBackend.maybeGetUserRestriction(option);
                if (userRestriction != null) {
                    pref.checkRestrictionAndSetDisabled(userRestriction);
                }
+2 −1
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
import com.android.settings.core.PreferenceXmlParserUtils;
import com.android.settings.core.PreferenceXmlParserUtils.MetadataFlag;
import com.android.settingslib.RestrictedSelectorWithWidgetPreference;
import com.android.settingslib.widget.CandidateInfo;
import com.android.settingslib.widget.IllustrationPreference;
import com.android.settingslib.widget.SelectorWithWidgetPreference;
@@ -178,7 +179,7 @@ public abstract class RadioButtonPickerFragment extends SettingsPreferenceFragme
     * A chance for subclasses to create a custom preference instance.
     */
    protected SelectorWithWidgetPreference createPreference() {
        return new SelectorWithWidgetPreference(getPrefContext());
        return new RestrictedSelectorWithWidgetPreference(getPrefContext());
    }

    public void updateCandidates() {