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

Commit a28c5e1c authored by Wenyu Zhang's avatar Wenyu Zhang
Browse files

Skip user restriction check on desktop

The Catalyst user restriction check crashes the Settings app on desktop
device. Skip the check for desktop device for now since this crash
blocks many development/testing work.

Change-Id: I27e3db48ce175381917681fe517d63bf6b4aede2
Bug: b/379130874, b/377600992
Test: verify locally on desktop device, presubmit
Flag: EXEMPT_bug fix
parent ec1017c0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.settings;

import static com.android.settings.SettingsActivity.EXTRA_FRAGMENT_ARG_KEY;
import static com.android.settingslib.media.PhoneMediaDevice.isDesktop;

import android.app.Activity;
import android.app.Dialog;
@@ -186,6 +187,13 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF

    /** Returns if catalyst is enabled on current screen. */
    protected final boolean isCatalystEnabled() {
        // TODO(b/379130874): make Catalyst compatible with desktop device, such as user restriction
        // check.
        Context context = getContext();
        if (context != null && isDesktop(context)) {
            return false;
        }

        return getPreferenceScreenCreator() != null;
    }