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

Commit dcc3ba7b authored by Sarah Chin's avatar Sarah Chin Committed by Android (Google) Code Review
Browse files

Merge changes from topics "revert-10153355-dev_cap-JUKVIAUYRW",...

Merge changes from topics "revert-10153355-dev_cap-JUKVIAUYRW", "revert-9919494-device_cap-HJIMIMXSXL"

* changes:
  Revert "Modify PhoneCapabilities for device capabilities"
  Revert "PhoneCapability cleanup"
parents 99cbdb2f a9667afd
Loading
Loading
Loading
Loading
+0 −37
Original line number Diff line number Diff line
@@ -47227,32 +47227,8 @@ package android.telephony {
  public final class PhoneCapability implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.List<java.lang.Integer> getBands(int);
    method @NonNull public java.util.List<java.util.List<java.lang.Long>> getConcurrentFeaturesSupport();
    method @NonNull public java.util.List<java.lang.String> getLogicalModemUuids();
    method public int getMaxActiveDedicatedBearers();
    method public int getMaxActiveInternetData();
    method public int getMaxActivePsVoice();
    method public long getPsDataConnectionLingerTimeMillis();
    method @NonNull public java.util.List<android.telephony.SimSlotCapability> getSimSlotCapabilities();
    method public long getSupportedRats();
    method public int getUeCategory(boolean, int);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhoneCapability> CREATOR;
    field public static final long MODEM_FEATURE_3GPP2_REG = 1L; // 0x1L
    field public static final long MODEM_FEATURE_3GPP_REG = 2L; // 0x2L
    field public static final long MODEM_FEATURE_CDMA2000_EHRPD_REG = 4L; // 0x4L
    field public static final long MODEM_FEATURE_CSIM = 8192L; // 0x2000L
    field public static final long MODEM_FEATURE_CS_VOICE_SESSION = 512L; // 0x200L
    field public static final long MODEM_FEATURE_DEDICATED_BEARER = 2048L; // 0x800L
    field public static final long MODEM_FEATURE_EUTRAN_REG = 32L; // 0x20L
    field public static final long MODEM_FEATURE_EUTRA_NR_DUAL_CONNECTIVITY_REG = 128L; // 0x80L
    field public static final long MODEM_FEATURE_GERAN_REG = 8L; // 0x8L
    field public static final long MODEM_FEATURE_INTERACTIVE_DATA_SESSION = 1024L; // 0x400L
    field public static final long MODEM_FEATURE_NETWORK_SCAN = 4096L; // 0x1000L
    field public static final long MODEM_FEATURE_NGRAN_REG = 64L; // 0x40L
    field public static final long MODEM_FEATURE_PS_VOICE_REG = 256L; // 0x100L
    field public static final long MODEM_FEATURE_UTRAN_REG = 16L; // 0x10L
  }
  public class PhoneNumberFormattingTextWatcher implements android.text.TextWatcher {
@@ -47442,18 +47418,6 @@ package android.telephony {
    field public static final int INVALID = 2147483647; // 0x7fffffff
  }
  public final class SimSlotCapability implements android.os.Parcelable {
    method public int describeContents();
    method public int getPhysicalSlotIndex();
    method public int getSlotType();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SimSlotCapability> CREATOR;
    field public static final int SLOT_TYPE_EUICC = 3; // 0x3
    field public static final int SLOT_TYPE_IUICC = 2; // 0x2
    field public static final int SLOT_TYPE_SOFT_SIM = 4; // 0x4
    field public static final int SLOT_TYPE_UICC = 1; // 0x1
  }
  public final class SmsManager {
    method public String createAppSpecificSmsToken(android.app.PendingIntent);
    method @Nullable public String createAppSpecificSmsTokenWithPackageInfo(@Nullable String, @NonNull android.app.PendingIntent);
@@ -47810,7 +47774,6 @@ package android.telephony {
    method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PRECISE_PHONE_STATE}) public int getNetworkSelectionMode();
    method public String getNetworkSpecifier();
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getNetworkType();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telephony.PhoneCapability getPhoneCapability();
    method @Deprecated public int getPhoneCount();
    method public int getPhoneType();
    method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PHONE_STATE}) public int getPreferredOpportunisticDataSubscription();
+109 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -16,80 +16,55 @@

package android.telephony;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Objects;

/**
 * Capabilities for a SIM Slot.
 * Information of a single logical modem indicating
 * its id, supported rats and whether it supports voice or data, etc.
 * @hide
 */
public final class SimSlotCapability implements Parcelable {
    /** Slot type for UICC (removable SIM). */
    public static final int SLOT_TYPE_UICC = 1;
    /** Slot type for iUICC/iSIM (integrated SIM). */
    public static final int SLOT_TYPE_IUICC = 2;
    /** Slot type for eUICC/eSIM (embedded SIM). */
    public static final int SLOT_TYPE_EUICC = 3;
    /** Slot type for soft SIM (no physical SIM). */
    public static final int SLOT_TYPE_SOFT_SIM = 4;

    /** @hide */
    @IntDef(prefix = {"SLOT_TYPE_" }, value = {
            SLOT_TYPE_UICC,
            SLOT_TYPE_IUICC,
            SLOT_TYPE_EUICC,
            SLOT_TYPE_SOFT_SIM,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface SlotType {
public class ModemInfo implements Parcelable {
    public final int modemId;
    public final int rat; /* bitset */
    public final boolean isVoiceSupported;
    public final boolean isDataSupported;

    // TODO b/121394331: Clean up this class after V1_1.PhoneCapability cleanup.
    public ModemInfo(int modemId) {
        this(modemId, 0, true, true);
    }

    private final int mPhysicalSlotIndex;
    private final int mSlotType;

    /** @hide */
    public SimSlotCapability(int physicalSlotId, int slotType) {
        this.mPhysicalSlotIndex = physicalSlotId;
        this.mSlotType = slotType;
    }

    private SimSlotCapability(Parcel in) {
        mPhysicalSlotIndex = in.readInt();
        mSlotType = in.readInt();
    public ModemInfo(int modemId, int rat, boolean isVoiceSupported, boolean isDataSupported) {
        this.modemId = modemId;
        this.rat = rat;
        this.isVoiceSupported = isVoiceSupported;
        this.isDataSupported = isDataSupported;
    }

    /**
     * @return physical SIM slot index
     */
    public int getPhysicalSlotIndex() {
        return mPhysicalSlotIndex;
    }

    /**
     * @return type of SIM {@link SlotType}
     */
    public @SlotType int getSlotType() {
        return mSlotType;
    public ModemInfo(Parcel in) {
        modemId = in.readInt();
        rat = in.readInt();
        isVoiceSupported = in.readBoolean();
        isDataSupported = in.readBoolean();
    }

    @Override
    public String toString() {
        return "mPhysicalSlotIndex=" + mPhysicalSlotIndex + " slotType=" + mSlotType;
        return "modemId=" + modemId + " rat=" + rat + " isVoiceSupported:" + isVoiceSupported
                + " isDataSupported:" + isDataSupported;
    }

    @Override
    public int hashCode() {
        return Objects.hash(mPhysicalSlotIndex, mSlotType);
        return Objects.hash(modemId, rat, isVoiceSupported, isDataSupported);
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || !(o instanceof SimSlotCapability) || hashCode() != o.hashCode()) {
        if (o == null || !(o instanceof ModemInfo) || hashCode() != o.hashCode()) {
            return false;
        }

@@ -97,34 +72,38 @@ public final class SimSlotCapability implements Parcelable {
            return true;
        }

        SimSlotCapability s = (SimSlotCapability) o;
        ModemInfo s = (ModemInfo) o;

        return (mPhysicalSlotIndex == s.mPhysicalSlotIndex && mSlotType == s.mSlotType);
        return (modemId == s.modemId
                && rat == s.rat
                && isVoiceSupported == s.isVoiceSupported
                && isDataSupported == s.isDataSupported);
    }

    /**
     * {@link Parcelable#describeContents}
     */
    public int describeContents() {
    public @ContentsFlags int describeContents() {
        return 0;
    }

    /**
     * {@link Parcelable#writeToParcel}
     */
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeInt(mPhysicalSlotIndex);
        dest.writeInt(mSlotType);
    public void writeToParcel(Parcel dest, @WriteFlags int flags) {
        dest.writeInt(modemId);
        dest.writeInt(rat);
        dest.writeBoolean(isVoiceSupported);
        dest.writeBoolean(isDataSupported);
    }

    public static final @NonNull Parcelable.Creator<SimSlotCapability> CREATOR =
            new Parcelable.Creator() {
                public SimSlotCapability createFromParcel(Parcel in) {
                    return new SimSlotCapability(in);
    public static final @android.annotation.NonNull Parcelable.Creator<ModemInfo> CREATOR = new Parcelable.Creator() {
        public ModemInfo createFromParcel(Parcel in) {
            return new ModemInfo(in);
        }

                public SimSlotCapability[] newArray(int size) {
                    return new SimSlotCapability[size];
        public ModemInfo[] newArray(int size) {
            return new ModemInfo[size];
        }
    };
}
+65 −389

File changed.

Preview size limit exceeded, changes collapsed.

+0 −18
Original line number Diff line number Diff line
@@ -1875,24 +1875,6 @@ public class TelephonyManager {
    //
    //

    /**
     * Returns the {@link PhoneCapability} for the device or null if it is not available.
     * <p>
     * Requires Permission: READ_PHONE_STATE or that the calling app has
     * carrier privileges (see {@link #hasCarrierPrivileges}).
     */
    @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
    @Nullable
    public PhoneCapability getPhoneCapability() {
        try {
            ITelephony telephony = getITelephony();
            return telephony == null ? null :
                    telephony.getPhoneCapability(getSubId(), getOpPackageName(), getFeatureId());
        } catch (RemoteException ex) {
            return null;
        }
    }

    /**
     * Returns the software version number for the device, for example,
     * the IMEI/SV for GSM phones. Return null if the software version is
+3 −9
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import android.telephony.ICellInfoCallback;
import android.telephony.ModemActivityInfo;
import android.telephony.NeighboringCellInfo;
import android.telephony.NetworkScanRequest;
import android.telephony.PhoneCapability;
import android.telephony.PhoneNumberRange;
import android.telephony.RadioAccessFamily;
import android.telephony.RadioAccessSpecifier;
@@ -1891,11 +1890,6 @@ interface ITelephony {
     */
     int getNetworkSelectionMode(int subId);

    /**
     * Return the PhoneCapability for the device.
     */
    PhoneCapability getPhoneCapability(int subId, String callingPackage, String callingFeatureId);

     /**
     * Return true if the device is in emergency sms mode, false otherwise.
     */
Loading