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

Commit 4007ba99 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Drop FEATURE_TELEPHONY_GSM from interface requirements" into main

parents 02b2812c ad6599ea
Loading
Loading
Loading
Loading
+0 −19
Original line number Original line Diff line number Diff line
@@ -2298,13 +2298,9 @@ public class TelephonyManager {
     *
     *
     * See {@link #getImei(int)} for details on the required permissions and behavior
     * See {@link #getImei(int)} for details on the required permissions and behavior
     * when the caller does not hold sufficient permissions.
     * when the caller does not hold sufficient permissions.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_GSM}.
     */
     */
    @SuppressAutoDoc // No support for device / profile owner or carrier privileges (b/72967236).
    @SuppressAutoDoc // No support for device / profile owner or carrier privileges (b/72967236).
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    @RequiresFeature(PackageManager.FEATURE_TELEPHONY_GSM)
    public String getImei() {
    public String getImei() {
        return getImei(getSlotIndex());
        return getImei(getSlotIndex());
    }
    }
@@ -2343,13 +2339,9 @@ public class TelephonyManager {
     * </ul>
     * </ul>
     *
     *
     * @param slotIndex of which IMEI is returned
     * @param slotIndex of which IMEI is returned
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_GSM}.
     */
     */
    @SuppressAutoDoc // No support for device / profile owner or carrier privileges (b/72967236).
    @SuppressAutoDoc // No support for device / profile owner or carrier privileges (b/72967236).
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    @RequiresFeature(PackageManager.FEATURE_TELEPHONY_GSM)
    public String getImei(int slotIndex) {
    public String getImei(int slotIndex) {
        ITelephony telephony = getITelephony();
        ITelephony telephony = getITelephony();
        if (telephony == null) return null;
        if (telephony == null) return null;
@@ -2366,11 +2358,7 @@ public class TelephonyManager {
    /**
    /**
     * Returns the Type Allocation Code from the IMEI. Return null if Type Allocation Code is not
     * Returns the Type Allocation Code from the IMEI. Return null if Type Allocation Code is not
     * available.
     * available.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_GSM}.
     */
     */
    @RequiresFeature(PackageManager.FEATURE_TELEPHONY_GSM)
    @Nullable
    @Nullable
    public String getTypeAllocationCode() {
    public String getTypeAllocationCode() {
        return getTypeAllocationCode(getSlotIndex());
        return getTypeAllocationCode(getSlotIndex());
@@ -2381,11 +2369,7 @@ public class TelephonyManager {
     * available.
     * available.
     *
     *
     * @param slotIndex of which Type Allocation Code is returned
     * @param slotIndex of which Type Allocation Code is returned
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_GSM}.
     */
     */
    @RequiresFeature(PackageManager.FEATURE_TELEPHONY_GSM)
    @Nullable
    @Nullable
    public String getTypeAllocationCode(int slotIndex) {
    public String getTypeAllocationCode(int slotIndex) {
        ITelephony telephony = getITelephony();
        ITelephony telephony = getITelephony();
@@ -19378,12 +19362,9 @@ public class TelephonyManager {
     * </ul>
     * </ul>
     *
     *
     * @return Primary IMEI of type string
     * @return Primary IMEI of type string
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_GSM}.
     * @throws SecurityException if the caller does not have the required permission/privileges
     * @throws SecurityException if the caller does not have the required permission/privileges
     */
     */
    @NonNull
    @NonNull
    @RequiresFeature(PackageManager.FEATURE_TELEPHONY_GSM)
    public String getPrimaryImei() {
    public String getPrimaryImei() {
        try {
        try {
            ITelephony telephony = getITelephony();
            ITelephony telephony = getITelephony();