Merge changes from topics "ApiReview_DEVICE_NR_CAPABILITY", "getPhoneCapability" am: 8c19236f8f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1772928 Change-Id: I99b79a6553669bd1cb616bbadb73ae8411f243be
This commit is contained in:
@@ -9755,12 +9755,11 @@ package android.telephony {
|
|||||||
|
|
||||||
public final class PhoneCapability implements android.os.Parcelable {
|
public final class PhoneCapability implements android.os.Parcelable {
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
method public int getDeviceNrCapabilityBitmask();
|
method @NonNull public int[] getDeviceNrCapabilities();
|
||||||
method @IntRange(from=1) public int getMaxActiveInternetData();
|
method @IntRange(from=1) public int getMaxActiveDataSubscriptions();
|
||||||
method @IntRange(from=1) public int getMaxActivePacketSwitchedVoiceCalls();
|
method @IntRange(from=1) public int getMaxActiveVoiceSubscriptions();
|
||||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhoneCapability> CREATOR;
|
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhoneCapability> CREATOR;
|
||||||
field public static final int DEVICE_NR_CAPABILITY_NONE = 0; // 0x0
|
|
||||||
field public static final int DEVICE_NR_CAPABILITY_NSA = 1; // 0x1
|
field public static final int DEVICE_NR_CAPABILITY_NSA = 1; // 0x1
|
||||||
field public static final int DEVICE_NR_CAPABILITY_SA = 2; // 0x2
|
field public static final int DEVICE_NR_CAPABILITY_SA = 2; // 0x2
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import android.os.Parcelable;
|
|||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@@ -47,26 +48,18 @@ public final class PhoneCapability implements Parcelable {
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef(prefix = { "DEVICE_NR_CAPABILITY_" }, value = {
|
@IntDef(prefix = { "DEVICE_NR_CAPABILITY_" }, value = {
|
||||||
DEVICE_NR_CAPABILITY_NONE,
|
|
||||||
DEVICE_NR_CAPABILITY_NSA,
|
DEVICE_NR_CAPABILITY_NSA,
|
||||||
DEVICE_NR_CAPABILITY_SA,
|
DEVICE_NR_CAPABILITY_SA,
|
||||||
})
|
})
|
||||||
public @interface DeviceNrCapability {}
|
public @interface DeviceNrCapability {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates DEVICE_NR_CAPABILITY_NONE determine that the device does not enable 5G NR.
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@SystemApi
|
|
||||||
public static final int DEVICE_NR_CAPABILITY_NONE = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates DEVICE_NR_CAPABILITY_NSA determine that the device enable the non-standalone
|
* Indicates DEVICE_NR_CAPABILITY_NSA determine that the device enable the non-standalone
|
||||||
* (NSA) mode of 5G NR.
|
* (NSA) mode of 5G NR.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
public static final int DEVICE_NR_CAPABILITY_NSA = 1 << 0;
|
public static final int DEVICE_NR_CAPABILITY_NSA = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates DEVICE_NR_CAPABILITY_SA determine that the device enable the standalone (SA)
|
* Indicates DEVICE_NR_CAPABILITY_SA determine that the device enable the standalone (SA)
|
||||||
@@ -74,7 +67,7 @@ public final class PhoneCapability implements Parcelable {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
public static final int DEVICE_NR_CAPABILITY_SA = 1 << 1;
|
public static final int DEVICE_NR_CAPABILITY_SA = 2;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
ModemInfo modemInfo1 = new ModemInfo(0, 0, true, true);
|
ModemInfo modemInfo1 = new ModemInfo(0, 0, true, true);
|
||||||
@@ -83,31 +76,34 @@ public final class PhoneCapability implements Parcelable {
|
|||||||
List<ModemInfo> logicalModemList = new ArrayList<>();
|
List<ModemInfo> logicalModemList = new ArrayList<>();
|
||||||
logicalModemList.add(modemInfo1);
|
logicalModemList.add(modemInfo1);
|
||||||
logicalModemList.add(modemInfo2);
|
logicalModemList.add(modemInfo2);
|
||||||
|
int[] deviceNrCapabilities = new int[0];
|
||||||
|
|
||||||
DEFAULT_DSDS_CAPABILITY = new PhoneCapability(1, 1, logicalModemList, false,
|
DEFAULT_DSDS_CAPABILITY = new PhoneCapability(1, 1, logicalModemList, false,
|
||||||
DEVICE_NR_CAPABILITY_NONE);
|
deviceNrCapabilities);
|
||||||
|
|
||||||
logicalModemList = new ArrayList<>();
|
logicalModemList = new ArrayList<>();
|
||||||
logicalModemList.add(modemInfo1);
|
logicalModemList.add(modemInfo1);
|
||||||
DEFAULT_SSSS_CAPABILITY = new PhoneCapability(1, 1, logicalModemList, false,
|
DEFAULT_SSSS_CAPABILITY = new PhoneCapability(1, 1, logicalModemList, false,
|
||||||
DEVICE_NR_CAPABILITY_NONE);
|
deviceNrCapabilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MaxActivePsVoice defines the maximum number of active voice calls. For a dual sim dual
|
* mMaxActiveVoiceSubscriptions defines the maximum subscriptions that can support
|
||||||
* standby (DSDS) modem it would be one, but for a dual sim dual active modem it would be 2.
|
* simultaneous voice calls. For a dual sim dual standby (DSDS) device it would be one, but
|
||||||
|
* for a dual sim dual active device it would be 2.
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
private final int mMaxActivePsVoice;
|
private final int mMaxActiveVoiceSubscriptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MaxActiveInternetData defines how many logical modems can have
|
* mMaxActiveDataSubscriptions defines the maximum subscriptions that can support
|
||||||
* PS attached simultaneously. For example, for L+L modem it
|
* simultaneous data connections.
|
||||||
* should be 2.
|
* For example, for L+L device it should be 2.
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
private final int mMaxActiveInternetData;
|
private final int mMaxActiveDataSubscriptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether modem supports both internet PDN up so
|
* Whether modem supports both internet PDN up so
|
||||||
@@ -126,42 +122,45 @@ public final class PhoneCapability implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
private final int mDeviceNrCapability;
|
private final int[] mDeviceNrCapabilities;
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public PhoneCapability(int maxActivePsVoice, int maxActiveInternetData,
|
public PhoneCapability(int maxActiveVoiceSubscriptions, int maxActiveDataSubscriptions,
|
||||||
List<ModemInfo> logicalModemList, boolean networkValidationBeforeSwitchSupported,
|
List<ModemInfo> logicalModemList, boolean networkValidationBeforeSwitchSupported,
|
||||||
int deviceNrCapability) {
|
int[] deviceNrCapabilities) {
|
||||||
this.mMaxActivePsVoice = maxActivePsVoice;
|
this.mMaxActiveVoiceSubscriptions = maxActiveVoiceSubscriptions;
|
||||||
this.mMaxActiveInternetData = maxActiveInternetData;
|
this.mMaxActiveDataSubscriptions = maxActiveDataSubscriptions;
|
||||||
// Make sure it's not null.
|
// Make sure it's not null.
|
||||||
this.mLogicalModemList = logicalModemList == null ? new ArrayList<>() : logicalModemList;
|
this.mLogicalModemList = logicalModemList == null ? new ArrayList<>() : logicalModemList;
|
||||||
this.mNetworkValidationBeforeSwitchSupported = networkValidationBeforeSwitchSupported;
|
this.mNetworkValidationBeforeSwitchSupported = networkValidationBeforeSwitchSupported;
|
||||||
this.mDeviceNrCapability = deviceNrCapability;
|
this.mDeviceNrCapabilities = deviceNrCapabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "mMaxActivePsVoice=" + mMaxActivePsVoice
|
return "mMaxActiveVoiceSubscriptions=" + mMaxActiveVoiceSubscriptions
|
||||||
+ " mMaxActiveInternetData=" + mMaxActiveInternetData
|
+ " mMaxActiveDataSubscriptions=" + mMaxActiveDataSubscriptions
|
||||||
+ " mNetworkValidationBeforeSwitchSupported="
|
+ " mNetworkValidationBeforeSwitchSupported="
|
||||||
+ mNetworkValidationBeforeSwitchSupported
|
+ mNetworkValidationBeforeSwitchSupported
|
||||||
+ " mDeviceNrCapability " + mDeviceNrCapability;
|
+ " mDeviceNrCapability " + Arrays.toString(mDeviceNrCapabilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PhoneCapability(Parcel in) {
|
private PhoneCapability(Parcel in) {
|
||||||
mMaxActivePsVoice = in.readInt();
|
mMaxActiveVoiceSubscriptions = in.readInt();
|
||||||
mMaxActiveInternetData = in.readInt();
|
mMaxActiveDataSubscriptions = in.readInt();
|
||||||
mNetworkValidationBeforeSwitchSupported = in.readBoolean();
|
mNetworkValidationBeforeSwitchSupported = in.readBoolean();
|
||||||
mLogicalModemList = new ArrayList<>();
|
mLogicalModemList = new ArrayList<>();
|
||||||
in.readList(mLogicalModemList, ModemInfo.class.getClassLoader());
|
in.readList(mLogicalModemList, ModemInfo.class.getClassLoader());
|
||||||
mDeviceNrCapability = in.readInt();
|
mDeviceNrCapabilities = in.createIntArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mMaxActivePsVoice, mMaxActiveInternetData, mLogicalModemList,
|
return Objects.hash(mMaxActiveVoiceSubscriptions,
|
||||||
mNetworkValidationBeforeSwitchSupported, mDeviceNrCapability);
|
mMaxActiveDataSubscriptions,
|
||||||
|
mLogicalModemList,
|
||||||
|
mNetworkValidationBeforeSwitchSupported,
|
||||||
|
Arrays.hashCode(mDeviceNrCapabilities));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -176,12 +175,12 @@ public final class PhoneCapability implements Parcelable {
|
|||||||
|
|
||||||
PhoneCapability s = (PhoneCapability) o;
|
PhoneCapability s = (PhoneCapability) o;
|
||||||
|
|
||||||
return (mMaxActivePsVoice == s.mMaxActivePsVoice
|
return (mMaxActiveVoiceSubscriptions == s.mMaxActiveVoiceSubscriptions
|
||||||
&& mMaxActiveInternetData == s.mMaxActiveInternetData
|
&& mMaxActiveDataSubscriptions == s.mMaxActiveDataSubscriptions
|
||||||
&& mNetworkValidationBeforeSwitchSupported
|
&& mNetworkValidationBeforeSwitchSupported
|
||||||
== s.mNetworkValidationBeforeSwitchSupported
|
== s.mNetworkValidationBeforeSwitchSupported
|
||||||
&& mLogicalModemList.equals(s.mLogicalModemList)
|
&& mLogicalModemList.equals(s.mLogicalModemList)
|
||||||
&& mDeviceNrCapability == s.mDeviceNrCapability);
|
&& Arrays.equals(mDeviceNrCapabilities, s.mDeviceNrCapabilities));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -195,11 +194,11 @@ public final class PhoneCapability implements Parcelable {
|
|||||||
* {@link Parcelable#writeToParcel}
|
* {@link Parcelable#writeToParcel}
|
||||||
*/
|
*/
|
||||||
public void writeToParcel(@NonNull Parcel dest, @Parcelable.WriteFlags int flags) {
|
public void writeToParcel(@NonNull Parcel dest, @Parcelable.WriteFlags int flags) {
|
||||||
dest.writeInt(mMaxActivePsVoice);
|
dest.writeInt(mMaxActiveVoiceSubscriptions);
|
||||||
dest.writeInt(mMaxActiveInternetData);
|
dest.writeInt(mMaxActiveDataSubscriptions);
|
||||||
dest.writeBoolean(mNetworkValidationBeforeSwitchSupported);
|
dest.writeBoolean(mNetworkValidationBeforeSwitchSupported);
|
||||||
dest.writeList(mLogicalModemList);
|
dest.writeList(mLogicalModemList);
|
||||||
dest.writeInt(mDeviceNrCapability);
|
dest.writeIntArray(mDeviceNrCapabilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final @android.annotation.NonNull Parcelable.Creator<PhoneCapability> CREATOR =
|
public static final @android.annotation.NonNull Parcelable.Creator<PhoneCapability> CREATOR =
|
||||||
@@ -214,25 +213,24 @@ public final class PhoneCapability implements Parcelable {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the maximum number of active packet-switched calls. For a dual
|
* @return the maximum subscriptions that can support simultaneous voice calls. For a dual
|
||||||
* sim dual standby (DSDS) modem it would be one, but for a dual sim dual active modem it
|
* sim dual standby (DSDS) device it would be one, but for a dual sim dual active device it
|
||||||
* would be 2.
|
* would be 2.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
public @IntRange(from = 1) int getMaxActivePacketSwitchedVoiceCalls() {
|
public @IntRange(from = 1) int getMaxActiveVoiceSubscriptions() {
|
||||||
return mMaxActivePsVoice;
|
return mMaxActiveVoiceSubscriptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return MaxActiveInternetData defines how many logical modems can have PS attached
|
* @return the maximum subscriptions that can support simultaneous data connections.
|
||||||
* simultaneously.
|
* For example, for L+L device it should be 2.
|
||||||
* For example, for L+L modem it should be 2.
|
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
public @IntRange(from = 1) int getMaxActiveInternetData() {
|
public @IntRange(from = 1) int getMaxActiveDataSubscriptions() {
|
||||||
return mMaxActiveInternetData;
|
return mMaxActiveDataSubscriptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -254,13 +252,16 @@ public final class PhoneCapability implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the device's NR capability.
|
* Return List of the device's NR capability. If the device doesn't support NR capability,
|
||||||
|
* then this api return empty array.
|
||||||
|
* @see DEVICE_NR_CAPABILITY_NSA
|
||||||
|
* @see DEVICE_NR_CAPABILITY_SA
|
||||||
*
|
*
|
||||||
* @return {@link DeviceNrCapability} the device's NR capability.
|
* @return List of the device's NR capability.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
public @DeviceNrCapability int getDeviceNrCapabilityBitmask() {
|
public @NonNull @DeviceNrCapability int[] getDeviceNrCapabilities() {
|
||||||
return mDeviceNrCapability;
|
return mDeviceNrCapabilities == null ? (new int[0]) : mDeviceNrCapabilities;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user