diff options
author | Jason Monk <jmonk@google.com> | 2017-10-19 09:30:56 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2017-10-19 09:30:56 -0400 |
commit | d439404c9988df6001e4ff8bce31537e2692660e (patch) | |
tree | b1462a7177b8a2791140964761eb49d173cdc878 /android/telephony/NetworkScanRequest.java | |
parent | 93b7ee4fce01df52a6607f0b1965cbafdfeaf1a6 (diff) | |
download | android-28-d439404c9988df6001e4ff8bce31537e2692660e.tar.gz |
Import Android SDK Platform P [4402356]
/google/data/ro/projects/android/fetch_artifact \
--bid 4386628 \
--target sdk_phone_armv7-win_sdk \
sdk-repo-linux-sources-4402356.zip
AndroidVersion.ApiLevel has been modified to appear as 28
Change-Id: Ie49e24e1f4ae9dc96306111e953d3db1e1495b53
Diffstat (limited to 'android/telephony/NetworkScanRequest.java')
-rw-r--r-- | android/telephony/NetworkScanRequest.java | 105 |
1 files changed, 101 insertions, 4 deletions
diff --git a/android/telephony/NetworkScanRequest.java b/android/telephony/NetworkScanRequest.java index d2aef200..9674c930 100644 --- a/android/telephony/NetworkScanRequest.java +++ b/android/telephony/NetworkScanRequest.java @@ -19,6 +19,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; +import java.util.ArrayList; import java.util.Arrays; /** @@ -38,6 +39,20 @@ public final class NetworkScanRequest implements Parcelable { public static final int MAX_BANDS = 8; /** @hide */ public static final int MAX_CHANNELS = 32; + /** @hide */ + public static final int MAX_MCC_MNC_LIST_SIZE = 20; + /** @hide */ + public static final int MIN_SEARCH_PERIODICITY_SEC = 5; + /** @hide */ + public static final int MAX_SEARCH_PERIODICITY_SEC = 300; + /** @hide */ + public static final int MIN_SEARCH_MAX_SEC = 60; + /** @hide */ + public static final int MAX_SEARCH_MAX_SEC = 3600; + /** @hide */ + public static final int MIN_INCREMENTAL_PERIODICITY_SEC = 1; + /** @hide */ + public static final int MAX_INCREMENTAL_PERIODICITY_SEC = 10; /** Performs the scan only once */ public static final int SCAN_TYPE_ONE_SHOT = 0; @@ -46,24 +61,84 @@ public final class NetworkScanRequest implements Parcelable { * * The modem will start new scans periodically, and the interval between two scans is usually * multiple minutes. - * */ + */ public static final int SCAN_TYPE_PERIODIC = 1; /** Defines the type of the scan. */ public int scanType; + /** + * Search periodicity (in seconds). + * Expected range for the input is [5s - 300s] + * This value must be less than or equal to maxSearchTime + */ + public int searchPeriodicity; + + /** + * Maximum duration of the periodic search (in seconds). + * Expected range for the input is [60s - 3600s] + * If the search lasts this long, it will be terminated. + */ + public int maxSearchTime; + + /** + * Indicates whether the modem should report incremental + * results of the network scan to the client. + * FALSE – Incremental results are not reported. + * TRUE (default) – Incremental results are reported + */ + public boolean incrementalResults; + + /** + * Indicates the periodicity with which the modem should + * report incremental results to the client (in seconds). + * Expected range for the input is [1s - 10s] + * This value must be less than or equal to maxSearchTime + */ + public int incrementalResultsPeriodicity; + /** Describes the radio access technologies with bands or channels that need to be scanned. */ public RadioAccessSpecifier[] specifiers; /** + * Describes the List of PLMN ids (MCC-MNC) + * If any PLMN of this list is found, search should end at that point and + * results with all PLMN found till that point should be sent as response. + * If list not sent, search to be completed till end and all PLMNs found to be reported. + * Max size of array is MAX_MCC_MNC_LIST_SIZE + */ + public ArrayList<String> mccMncs; + + /** * Creates a new NetworkScanRequest with scanType and network specifiers * * @param scanType The type of the scan * @param specifiers the radio network with bands / channels to be scanned + * @param searchPeriodicity Search periodicity (in seconds) + * @param maxSearchTime Maximum duration of the periodic search (in seconds) + * @param incrementalResults Indicates whether the modem should report incremental + * results of the network scan to the client + * @param incrementalResultsPeriodicity Indicates the periodicity with which the modem should + * report incremental results to the client (in seconds) + * @param mccMncs Describes the List of PLMN ids (MCC-MNC) */ - public NetworkScanRequest(int scanType, RadioAccessSpecifier[] specifiers) { + public NetworkScanRequest(int scanType, RadioAccessSpecifier[] specifiers, + int searchPeriodicity, + int maxSearchTime, + boolean incrementalResults, + int incrementalResultsPeriodicity, + ArrayList<String> mccMncs) { this.scanType = scanType; this.specifiers = specifiers; + this.searchPeriodicity = searchPeriodicity; + this.maxSearchTime = maxSearchTime; + this.incrementalResults = incrementalResults; + this.incrementalResultsPeriodicity = incrementalResultsPeriodicity; + if (mccMncs != null) { + this.mccMncs = mccMncs; + } else { + this.mccMncs = new ArrayList<>(); + } } @Override @@ -75,6 +150,11 @@ public final class NetworkScanRequest implements Parcelable { public void writeToParcel(Parcel dest, int flags) { dest.writeInt(scanType); dest.writeParcelableArray(specifiers, flags); + dest.writeInt(searchPeriodicity); + dest.writeInt(maxSearchTime); + dest.writeBoolean(incrementalResults); + dest.writeInt(incrementalResultsPeriodicity); + dest.writeStringList(mccMncs); } private NetworkScanRequest(Parcel in) { @@ -82,6 +162,12 @@ public final class NetworkScanRequest implements Parcelable { specifiers = (RadioAccessSpecifier[]) in.readParcelableArray( Object.class.getClassLoader(), RadioAccessSpecifier.class); + searchPeriodicity = in.readInt(); + maxSearchTime = in.readInt(); + incrementalResults = in.readBoolean(); + incrementalResultsPeriodicity = in.readInt(); + mccMncs = new ArrayList<>(); + in.readStringList(mccMncs); } @Override @@ -99,13 +185,24 @@ public final class NetworkScanRequest implements Parcelable { } return (scanType == nsr.scanType - && Arrays.equals(specifiers, nsr.specifiers)); + && Arrays.equals(specifiers, nsr.specifiers) + && searchPeriodicity == nsr.searchPeriodicity + && maxSearchTime == nsr.maxSearchTime + && incrementalResults == nsr.incrementalResults + && incrementalResultsPeriodicity == nsr.incrementalResultsPeriodicity + && (((mccMncs != null) + && mccMncs.equals(nsr.mccMncs)))); } @Override public int hashCode () { return ((scanType * 31) - + (Arrays.hashCode(specifiers)) * 37); + + (Arrays.hashCode(specifiers)) * 37 + + (searchPeriodicity * 41) + + (maxSearchTime * 43) + + ((incrementalResults == true? 1 : 0) * 47) + + (incrementalResultsPeriodicity * 53) + + (mccMncs.hashCode() * 59)); } public static final Creator<NetworkScanRequest> CREATOR = |