Phone number only available for admin users
The phone number is hidden to non-admin users, following the same reasoning that exists for other telephony-specific fields like the baseband IMEI. Bug: 392808943 Flag: EXEMPT bugfix Test: atest PhoneNumberPreferenceControllerTest Test: atest MobileNetworkPhoneNumberPreferenceControllerTest Change-Id: I4e612219d0c7439930e91b3e1d6e368a0dfd073e
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.android.settings.deviceinfo;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.UserManager;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
@@ -51,8 +52,13 @@ public class PhoneNumberPreferenceController extends BasePreferenceController {
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return SubscriptionUtil.isSimHardwareVisible(mContext) ?
|
||||
AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
if (!SubscriptionUtil.isSimHardwareVisible(mContext)) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
if (!mContext.getSystemService(UserManager.class).isAdminUser()) {
|
||||
return DISABLED_FOR_USER;
|
||||
}
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user