Provide network bands in AvailableNetworkInfo
Provide network bands in AvailableNetworkInfo Test: verified using CTS and make Bug: 123292899 Merged-In: I0d0a180eb4da3edf50a94ba621505ad95c7a262c Change-Id: I0d0a180eb4da3edf50a94ba621505ad95c7a262c
This commit is contained in:
@@ -42099,9 +42099,10 @@ package android.telephony {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class AvailableNetworkInfo implements android.os.Parcelable {
|
public final class AvailableNetworkInfo implements android.os.Parcelable {
|
||||||
ctor public AvailableNetworkInfo(int, int, java.util.List<java.lang.String>);
|
ctor public AvailableNetworkInfo(int, int, @NonNull java.util.List<java.lang.String>, @NonNull java.util.List<java.lang.Integer>);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
method public java.util.List<java.lang.String> getMccMncs();
|
method @NonNull public java.util.List<java.lang.Integer> getBands();
|
||||||
|
method @NonNull public java.util.List<java.lang.String> getMccMncs();
|
||||||
method public int getPriority();
|
method public int getPriority();
|
||||||
method public int getSubId();
|
method public int getSubId();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.telephony;
|
package android.telephony;
|
||||||
|
|
||||||
|
import android.annotation.NonNull;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
@@ -62,10 +63,21 @@ public final class AvailableNetworkInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* Describes the List of PLMN ids (MCC-MNC) associated with mSubId.
|
* Describes the List of PLMN ids (MCC-MNC) associated with mSubId.
|
||||||
* If this entry is left empty, then the platform software will not scan the network
|
* If this entry is left empty, then the platform software will not scan the network
|
||||||
* to revalidate the input.
|
* to revalidate the input else platform will scan and verify specified PLMNs are available.
|
||||||
*/
|
*/
|
||||||
private ArrayList<String> mMccMncs;
|
private ArrayList<String> mMccMncs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the frequency bands associated with the {@link #getMccMncs() MCC/MNCs}.
|
||||||
|
* Opportunistic network service will use these bands to scan.
|
||||||
|
*
|
||||||
|
* When no specific bands are specified (empty array or null) CBRS band (B48) will be
|
||||||
|
* used for network scan.
|
||||||
|
*
|
||||||
|
* See {@link AccessNetworkConstants} for details.
|
||||||
|
*/
|
||||||
|
private ArrayList<Integer> mBands;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return subscription Id of the available network.
|
* Return subscription Id of the available network.
|
||||||
* This value must be one of the entry retrieved from
|
* This value must be one of the entry retrieved from
|
||||||
@@ -91,10 +103,20 @@ public final class AvailableNetworkInfo implements Parcelable {
|
|||||||
* to revalidate the input.
|
* to revalidate the input.
|
||||||
* @return list of PLMN ids
|
* @return list of PLMN ids
|
||||||
*/
|
*/
|
||||||
public List<String> getMccMncs() {
|
public @NonNull List<String> getMccMncs() {
|
||||||
return (List<String>) mMccMncs.clone();
|
return (List<String>) mMccMncs.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the frequency bands that need to be scanned by opportunistic network service
|
||||||
|
*
|
||||||
|
* The returned value is defined in either of {@link AccessNetworkConstants.GeranBand},
|
||||||
|
* {@link AccessNetworkConstants.UtranBand} and {@link AccessNetworkConstants.EutranBand}
|
||||||
|
*/
|
||||||
|
public @NonNull List<Integer> getBands() {
|
||||||
|
return (List<Integer>) mBands.clone();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int describeContents() {
|
public int describeContents() {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -105,6 +127,7 @@ public final class AvailableNetworkInfo implements Parcelable {
|
|||||||
dest.writeInt(mSubId);
|
dest.writeInt(mSubId);
|
||||||
dest.writeInt(mPriority);
|
dest.writeInt(mPriority);
|
||||||
dest.writeStringList(mMccMncs);
|
dest.writeStringList(mMccMncs);
|
||||||
|
dest.writeList(mBands);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AvailableNetworkInfo(Parcel in) {
|
private AvailableNetworkInfo(Parcel in) {
|
||||||
@@ -112,12 +135,16 @@ public final class AvailableNetworkInfo implements Parcelable {
|
|||||||
mPriority = in.readInt();
|
mPriority = in.readInt();
|
||||||
mMccMncs = new ArrayList<>();
|
mMccMncs = new ArrayList<>();
|
||||||
in.readStringList(mMccMncs);
|
in.readStringList(mMccMncs);
|
||||||
|
mBands = new ArrayList<>();
|
||||||
|
in.readList(mBands, Integer.class.getClassLoader());
|
||||||
}
|
}
|
||||||
|
|
||||||
public AvailableNetworkInfo(int subId, int priority, List<String> mccMncs) {
|
public AvailableNetworkInfo(int subId, int priority, @NonNull List<String> mccMncs,
|
||||||
|
@NonNull List<Integer> bands) {
|
||||||
mSubId = subId;
|
mSubId = subId;
|
||||||
mPriority = priority;
|
mPriority = priority;
|
||||||
mMccMncs = new ArrayList<String>(mccMncs);
|
mMccMncs = new ArrayList<String>(mccMncs);
|
||||||
|
mBands = new ArrayList<Integer>(bands);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -135,14 +162,15 @@ public final class AvailableNetworkInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (mSubId == ani.mSubId
|
return (mSubId == ani.mSubId
|
||||||
&& mPriority == ani.mPriority
|
&& mPriority == ani.mPriority
|
||||||
&& (((mMccMncs != null)
|
&& (((mMccMncs != null)
|
||||||
&& mMccMncs.equals(ani.mMccMncs))));
|
&& mMccMncs.equals(ani.mMccMncs)))
|
||||||
|
&& mBands.equals(ani.mBands));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mSubId, mPriority, mMccMncs);
|
return Objects.hash(mSubId, mPriority, mMccMncs, mBands);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<AvailableNetworkInfo> CREATOR =
|
public static final Parcelable.Creator<AvailableNetworkInfo> CREATOR =
|
||||||
@@ -161,9 +189,9 @@ public final class AvailableNetworkInfo implements Parcelable {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return ("AvailableNetworkInfo:"
|
return ("AvailableNetworkInfo:"
|
||||||
+ " mSubId: " + mSubId
|
+ " mSubId: " + mSubId
|
||||||
+ " mPriority: " + mPriority
|
+ " mPriority: " + mPriority
|
||||||
+ " mMccMncs: " + Arrays.toString(mMccMncs.toArray()));
|
+ " mMccMncs: " + Arrays.toString(mMccMncs.toArray())
|
||||||
|
+ " mBands: " + Arrays.toString(mBands.toArray()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10243,11 +10243,11 @@ public class TelephonyManager {
|
|||||||
/**
|
/**
|
||||||
* Update availability of a list of networks in the current location.
|
* Update availability of a list of networks in the current location.
|
||||||
*
|
*
|
||||||
* This api should be called by opportunistic network selection app to inform
|
* This api should be called to inform OpportunisticNetwork Service about the availability
|
||||||
* OpportunisticNetwork Service about the availability of a network at the current location.
|
* of a network at the current location. This information will be used by OpportunisticNetwork
|
||||||
* This information will be used by OpportunisticNetwork service to decide to attach to the
|
* service to decide to attach to the network opportunistically. If an empty list is passed,
|
||||||
* network opportunistically.
|
* it is assumed that no network is available and will result in disabling the modem stack
|
||||||
* If an empty list is passed, it is assumed that no network is available.
|
* to save power.
|
||||||
* Requires that the calling app has carrier privileges on both primary and
|
* Requires that the calling app has carrier privileges on both primary and
|
||||||
* secondary subscriptions (see {@link #hasCarrierPrivileges}), or has permission
|
* secondary subscriptions (see {@link #hasCarrierPrivileges}), or has permission
|
||||||
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
|
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
|
||||||
|
|||||||
Reference in New Issue
Block a user