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

Commit 22c88405 authored by Aleksander Morgado's avatar Aleksander Morgado
Browse files

Return DISABLED_FOR_USER in deviceinfo/simstatus availability if not admin user

The correct return when checking for the SIM status field availability
for non-admin users is DISABLED_FOR_USER.

UNSUPPORTED_ON_DEVICE should only be used when the setting is
unconditionally hidden as the device does not support the feature.

Bug: 395714454
Flag: EXEMPT bugfix
Test: atest SimStatusPreferenceControllerTest

Change-Id: I9bd290f1bdd73909be383a24f2c762d295089ff6
parent d58d0be2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public class SimStatusPreferenceController extends BasePreferenceController {
            return UNSUPPORTED_ON_DEVICE;
        }
        if (!mContext.getSystemService(UserManager.class).isAdminUser()) {
            return CONDITIONALLY_UNAVAILABLE;
            return DISABLED_FOR_USER;
        }
        return AVAILABLE;
    }
+1 −1
Original line number Diff line number Diff line
@@ -251,7 +251,7 @@ public class SimStatusPreferenceControllerTest {

        when(mUserManager.isAdminUser()).thenReturn(false);
        assertThat(mController.getAvailabilityStatus()).isEqualTo(
                BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
                BasePreferenceController.DISABLED_FOR_USER);
    }

    private <T> void mockService(String serviceName, Class<T> serviceClass, T service) {