Return DISABLED_FOR_USER in IMEI availability if not admin user

The correct return when checking for the IMEI 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 ImeiInfoPreferenceControllerTest
Test: atest MobileNetworkImeiPreferenceControllerTest

Change-Id: I4ee89a84953993daad539d33d3a2e576540c580f
This commit is contained in:
Aleksander Morgado
2025-02-11 22:01:40 +00:00
parent 2a0ad1efdf
commit 64fb695d9b
4 changed files with 11 additions and 8 deletions

View File

@@ -67,8 +67,8 @@ class MobileNetworkImeiPreferenceController(context: Context, key: String) :
!SubscriptionUtil.isSimHardwareVisible(mContext)
|| Utils.isWifiOnly(mContext) -> UNSUPPORTED_ON_DEVICE
!Flags.isDualSimOnboardingEnabled()
|| !SubscriptionManager.isValidSubscriptionId(subId)
|| !mContext.userManager.isAdminUser -> CONDITIONALLY_UNAVAILABLE
|| !SubscriptionManager.isValidSubscriptionId(subId) -> CONDITIONALLY_UNAVAILABLE
!mContext.userManager.isAdminUser -> DISABLED_FOR_USER
else -> AVAILABLE
}