diff --git a/api/current.txt b/api/current.txt index 334ccebe1bc4c..9173a1d3d4c19 100644 --- a/api/current.txt +++ b/api/current.txt @@ -45150,7 +45150,7 @@ package android.telephony { method public int getDataState(); method @Deprecated @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public String getDeviceId(); method @Deprecated @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public String getDeviceId(int); - method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getDeviceSoftwareVersion(); + method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @Nullable public String getDeviceSoftwareVersion(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @NonNull public java.util.Map> getEmergencyNumberList(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @NonNull public java.util.Map> getEmergencyNumberList(int); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String[] getForbiddenPlmns(); diff --git a/api/system-current.txt b/api/system-current.txt index 46413d39cacac..75f39cd3aa35e 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -8259,6 +8259,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getDataActivationState(); method @Deprecated public boolean getDataEnabled(); method @Deprecated public boolean getDataEnabled(int); + method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDeviceSoftwareVersion(int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 03e57e728610f..06a737041f0d2 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1619,12 +1619,11 @@ public class TelephonyManager { * Returns the software version number for the device, for example, * the IMEI/SV for GSM phones. Return null if the software version is * not available. - * - *

Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} - * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}). + *

+ * Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}. */ - @SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) + @Nullable public String getDeviceSoftwareVersion() { return getDeviceSoftwareVersion(getSlotIndex()); } @@ -1633,12 +1632,16 @@ public class TelephonyManager { * Returns the software version number for the device, for example, * the IMEI/SV for GSM phones. Return null if the software version is * not available. + *

+ * Requires Permission: READ_PRIVILEGED_PHONE_STATE. * * @param slotIndex of which deviceID is returned + * + * @hide */ - /** {@hide} */ - @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) - @UnsupportedAppUsage + @SystemApi + @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + @Nullable public String getDeviceSoftwareVersion(int slotIndex) { ITelephony telephony = getITelephony(); if (telephony == null) return null;