Stay organized with collections
Save and categorize content based on your preferences.
NetworkScan
public
class
NetworkScan
extends Object
The caller of
TelephonyManager.requestNetworkScan(NetworkScanRequest, Executor, NetworkScanCallback)
will receive an instance of NetworkScan
, which contains a callback method
stopScan()
for stopping the in-progress scan.
Summary
Public methods |
void
|
stopScan()
Stops the network scan
Use this method to stop an ongoing scan.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Constants
ERROR_INTERRUPTED
public static final int ERROR_INTERRUPTED
The scan has been interrupted by another scan with higher priority.
Constant Value:
10002
(0x00002712)
ERROR_INVALID_SCAN
public static final int ERROR_INVALID_SCAN
The parameters of the scan is invalid.
Constant Value:
2
(0x00000002)
ERROR_INVALID_SCANID
public static final int ERROR_INVALID_SCANID
The scan ID is invalid. The user is either trying to stop a scan which does not exist
or started by others.
Constant Value:
10001
(0x00002711)
ERROR_MODEM_ERROR
public static final int ERROR_MODEM_ERROR
The scan has failed due to some modem errors.
Constant Value:
1
(0x00000001)
ERROR_MODEM_UNAVAILABLE
public static final int ERROR_MODEM_UNAVAILABLE
The modem can not perform the scan because it is doing something else.
Constant Value:
3
(0x00000003)
ERROR_RADIO_INTERFACE_ERROR
public static final int ERROR_RADIO_INTERFACE_ERROR
The RIL returns nothing or exceptions.
Constant Value:
10000
(0x00002710)
ERROR_UNSUPPORTED
public static final int ERROR_UNSUPPORTED
The modem does not support the request scan.
Constant Value:
4
(0x00000004)
SUCCESS
public static final int SUCCESS
The RIL has successfully performed the network scan.
Constant Value:
0
(0x00000000)
Public methods
stopScan
public void stopScan ()
Stops the network scan
Use this method to stop an ongoing scan. When user requests a new scan, a NetworkScan
object will be returned, and the user can stop the scan by calling this method.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# NetworkScan\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Constants](#constants) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nNetworkScan\n===========\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/telephony/NetworkScan \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\nclass\nNetworkScan\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|-------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.telephony.NetworkScan |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe caller of\n[TelephonyManager.requestNetworkScan(NetworkScanRequest, Executor, NetworkScanCallback)](/reference/android/telephony/TelephonyManager#requestNetworkScan(android.telephony.NetworkScanRequest,%20java.util.concurrent.Executor,%20android.telephony.TelephonyScanManager.NetworkScanCallback))\nwill receive an instance of [NetworkScan](/reference/android/telephony/NetworkScan), which contains a callback method\n[stopScan()](/reference/android/telephony/NetworkScan#stopScan()) for stopping the in-progress scan.\n\nSummary\n-------\n\n| ### Constants ||\n|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | [ERROR_INTERRUPTED](/reference/android/telephony/NetworkScan#ERROR_INTERRUPTED) The scan has been interrupted by another scan with higher priority. |\n| `int` | [ERROR_INVALID_SCAN](/reference/android/telephony/NetworkScan#ERROR_INVALID_SCAN) The parameters of the scan is invalid. |\n| `int` | [ERROR_INVALID_SCANID](/reference/android/telephony/NetworkScan#ERROR_INVALID_SCANID) The scan ID is invalid. |\n| `int` | [ERROR_MODEM_ERROR](/reference/android/telephony/NetworkScan#ERROR_MODEM_ERROR) The scan has failed due to some modem errors. |\n| `int` | [ERROR_MODEM_UNAVAILABLE](/reference/android/telephony/NetworkScan#ERROR_MODEM_UNAVAILABLE) The modem can not perform the scan because it is doing something else. |\n| `int` | [ERROR_RADIO_INTERFACE_ERROR](/reference/android/telephony/NetworkScan#ERROR_RADIO_INTERFACE_ERROR) The RIL returns nothing or exceptions. |\n| `int` | [ERROR_UNSUPPORTED](/reference/android/telephony/NetworkScan#ERROR_UNSUPPORTED) The modem does not support the request scan. |\n| `int` | [SUCCESS](/reference/android/telephony/NetworkScan#SUCCESS) The RIL has successfully performed the network scan. |\n\n| ### Public methods ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[stopScan](/reference/android/telephony/NetworkScan#stopScan())`() ` Stops the network scan Use this method to stop an ongoing scan. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nConstants\n---------\n\n### ERROR_INTERRUPTED\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int ERROR_INTERRUPTED\n```\n\nThe scan has been interrupted by another scan with higher priority.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n10002\n(0x00002712)\n\n\n### ERROR_INVALID_SCAN\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int ERROR_INVALID_SCAN\n```\n\nThe parameters of the scan is invalid.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\n### ERROR_INVALID_SCANID\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int ERROR_INVALID_SCANID\n```\n\nThe scan ID is invalid. The user is either trying to stop a scan which does not exist\nor started by others.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n10001\n(0x00002711)\n\n\n### ERROR_MODEM_ERROR\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int ERROR_MODEM_ERROR\n```\n\nThe scan has failed due to some modem errors.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\n### ERROR_MODEM_UNAVAILABLE\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int ERROR_MODEM_UNAVAILABLE\n```\n\nThe modem can not perform the scan because it is doing something else.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n3\n(0x00000003)\n\n\n### ERROR_RADIO_INTERFACE_ERROR\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int ERROR_RADIO_INTERFACE_ERROR\n```\n\nThe RIL returns nothing or exceptions.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n10000\n(0x00002710)\n\n\n### ERROR_UNSUPPORTED\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int ERROR_UNSUPPORTED\n```\n\nThe modem does not support the request scan.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n4\n(0x00000004)\n\n\n### SUCCESS\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int SUCCESS\n```\n\nThe RIL has successfully performed the network scan.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\nPublic methods\n--------------\n\n### stopScan\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void stopScan ()\n```\n\nStops the network scan\n\nUse this method to stop an ongoing scan. When user requests a new scan, a [NetworkScan](/reference/android/telephony/NetworkScan)\nobject will be returned, and the user can stop the scan by calling this method.\n\n\u003cbr /\u003e"]]