// Define the phone state listener. The `PhoneStateListener` can be replaced by `TelephonyCallback` once the minimum API >= 31.
phoneStateListener = object : PhoneStateListener() {
+ @Deprecated("Deprecated in Java")
@SuppressLint("SwitchIntDef")
override fun onDisplayInfoChanged(telephonyDisplayInfo: TelephonyDisplayInfo) {
// Declare the stingray dialog type integer.
}
}
+ @Deprecated("Deprecated in Java")
override fun onServiceStateChanged(serviceState: ServiceState) {
// Get the network registration info for the voice network, which is the second of the three entries (the first appears to be Wi-Fi and the third appears to be the cell data network).
val networkRegistrationInfo = serviceState.networkRegistrationInfoList[1]