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

Commit dc82f0a0 authored by Bonian Chen's avatar Bonian Chen Committed by Android (Google) Code Review
Browse files

Merge "[Settings] Avoid from Guest user to access UI which requires permission...

Merge "[Settings] Avoid from Guest user to access UI which requires permission for changing mobile networi configurations"
parents dce72966 6fa898d7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import androidx.preference.Preference;

import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.network.telephony.MobileNetworkUtils;
import com.android.settings.system.ResetDashboardFragment;

/**
@@ -52,6 +53,7 @@ public class EraseEuiccDataController extends BasePreferenceController {
    @Override
    public int getAvailabilityStatus() {
        return SubscriptionUtil.isSimHardwareVisible(mContext) &&
                (!MobileNetworkUtils.isMobileNetworkUserRestricted(mContext)) &&
                mContext.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_TELEPHONY_EUICC) ? AVAILABLE_UNSEARCHABLE
                : UNSUPPORTED_ON_DEVICE;
+2 −1
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ public class ConfirmSimDeletionPreferenceController extends BasePreferenceContro
    @Override
    public int getAvailabilityStatus() {
        // hide if eSim is not supported on the device
        return MobileNetworkUtils.showEuiccSettings(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
        return (!MobileNetworkUtils.isMobileNetworkUserRestricted(mContext)) &&
                MobileNetworkUtils.showEuiccSettings(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
    }

    private boolean getGlobalState() {