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

Commit 6e638302 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Correctly restrict UI for WifiSettings in Guest profile."

parents efce4492 8fc61244
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -55,11 +55,15 @@ public class LinkablePreference extends Preference {
        super.onBindViewHolder(view);

        TextView textView = (TextView) view.findViewById(android.R.id.title);
        if (textView == null || mContentTitle == null || mClickListener == null) {
        if (textView == null) {
            return;
        }

        textView.setSingleLine(false);

        if (mContentTitle == null || mClickListener == null) {
            return;
        }

        StringBuilder contentBuilder = new StringBuilder().append(mContentTitle);
        if (mContentDescription != null) {
            contentBuilder.append("\n\n");
+9 −3
Original line number Diff line number Diff line
@@ -179,9 +179,11 @@ public class WifiSettings extends RestrictedSettingsFragment
        super.onViewCreated(view, savedInstanceState);
        final Activity activity = getActivity();
        if (activity != null) {
            if (!isUiRestricted()) {
                mProgressHeader = (ProgressBar) setPinnedHeaderView(R.layout.wifi_progress_header);
            }
        }
    }

    @Override
    public void onCreate(Bundle icicle) {
@@ -201,6 +203,10 @@ public class WifiSettings extends RestrictedSettingsFragment
        mConfigureWifiSettingsPreference = findPreference(PREF_KEY_CONFIGURE_WIFI_SETTINGS);
        mSavedNetworksPreference = findPreference(PREF_KEY_SAVED_NETWORKS);

        if (isUiRestricted()) {
            getPreferenceScreen().removePreference(mAdditionalSettingsPreferenceCategory);
        }

        Context prefContext = getPrefContext();
        mAddPreference = new Preference(prefContext);
        mAddPreference.setIcon(R.drawable.ic_menu_add_inset);
@@ -818,11 +824,11 @@ public class WifiSettings extends RestrictedSettingsFragment

    private void setOffMessage() {
        if (isUiRestricted()) {
            removeConnectedAccessPointPreference();
            mAccessPointsPreferenceCategory.removeAll();
            if (!isUiRestrictedByOnlyAdmin()) {
                addMessagePreference(R.string.wifi_empty_list_user_restricted);
            }
            removeConnectedAccessPointPreference();
            mAccessPointsPreferenceCategory.removeAll();
            return;
        }