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

Unverified Commit 78f9ab9a authored by LuK1337's avatar LuK1337
Browse files

Revert "LineagePreferenceLib: Ensure the preference is available before replacing"

This reverts commit 214c2c41.

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/9753
Change-Id: Ie82b89cb85048e6b212ae68b8e2d313108432d55
parent c210717e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2016 The CyanogenMod Project
 * SPDX-FileCopyrightText: 2017-2025 The LineageOS Project
 * SPDX-FileCopyrightText: 2017,2019-2020 The LineageOS Project
 * SPDX-License-Identifier: Apache-2.0
 */
package lineageos.preference;
@@ -71,11 +71,11 @@ public class ConstraintsHelper {
        TypedArray a = context.getResources().obtainAttributes(attrs,
                R.styleable.lineage_SelfRemovingPreference);
        mSummaryMinLines = a.getInteger(lineage_SelfRemovingPreference_minSummaryLines, -1);
        setAvailable(checkConstraints());
        String replacesKey = a.getString(lineage_SelfRemovingPreference_replacesKey);
        if (replacesKey != null && mAvailable) {
        if (replacesKey != null) {
            mReplacesKey = replacesKey.split("\\|");
        }
        setAvailable(checkConstraints());

        Log.d(TAG, "construct key=" + mPref.getKey() + " available=" + mAvailable);
    }
@@ -316,7 +316,7 @@ public class ConstraintsHelper {
    public void onAttached() {
        checkIntent();

        if (mReplacesKey != null) {
        if (isAvailable() && mReplacesKey != null) {
            Graveyard.get(mContext).addTombstones(mReplacesKey);
        }