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

Commit 76f46fc8 authored by Tony Mantler's avatar Tony Mantler
Browse files

Fix sketchy usage of new PreferenceScreen

Things get weird if you don't use PreferenceManager#createPreferenceScreen

Bug: 37216851
Test: Compiles and runs
Change-Id: I7cebec133c4f27f7eeda83c95d8acb4823f67dc4
parent 8bb9f33c
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2017 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<PreferenceScreen />
+1 −2
Original line number Diff line number Diff line
@@ -184,8 +184,7 @@ public class ApnSettings extends RestrictedSettingsFragment implements
        mUnavailable = isUiRestricted();
        setHasOptionsMenu(!mUnavailable);
        if (mUnavailable) {
            setPreferenceScreen(new PreferenceScreen(getPrefContext(), null));
            getPreferenceScreen().removeAll();
            addPreferencesFromResource(R.xml.empty_settings);
            return;
        }

+1 −1
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
            // Block access to developer options if the user is not the owner, if user policy
            // restricts it, or if the device has not been provisioned
            mUnavailable = true;
            setPreferenceScreen(new PreferenceScreen(getPrefContext(), null));
            addPreferencesFromResource(R.xml.empty_settings);
            return;
        }