diff options
| -rw-r--r-- | services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java b/services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java index 12495bb4f2cc..d7d0eb40af70 100644 --- a/services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java +++ b/services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java @@ -612,25 +612,23 @@ class GnssNetworkConnectivityHandler { networkRequestBuilder.addCapability(getNetworkCapability(mAGpsType)); networkRequestBuilder.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR); - if (com.android.internal.telephony.flags.Flags.satelliteInternet()) { - // Add transport type NetworkCapabilities.TRANSPORT_SATELLITE on satellite network. - TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class); - if (telephonyManager != null) { - ServiceState state = telephonyManager.getServiceState(); - if (state != null && state.isUsingNonTerrestrialNetwork()) { - networkRequestBuilder.removeCapability(NET_CAPABILITY_NOT_RESTRICTED); - try { - networkRequestBuilder.addTransportType(NetworkCapabilities - .TRANSPORT_SATELLITE); - networkRequestBuilder.removeCapability(NetworkCapabilities - .NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED); - } catch (IllegalArgumentException ignored) { - // In case TRANSPORT_SATELLITE or NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED - // are not recognized, meaning an old connectivity module runs on new - // android in which case no network with such capabilities will be brought - // up, so it's safe to ignore the exception. - // TODO: Can remove the try-catch in next quarter release. - } + // Add transport type NetworkCapabilities.TRANSPORT_SATELLITE on satellite network. + TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class); + if (telephonyManager != null) { + ServiceState state = telephonyManager.getServiceState(); + if (state != null && state.isUsingNonTerrestrialNetwork()) { + networkRequestBuilder.removeCapability(NET_CAPABILITY_NOT_RESTRICTED); + try { + networkRequestBuilder.addTransportType(NetworkCapabilities + .TRANSPORT_SATELLITE); + networkRequestBuilder.removeCapability(NetworkCapabilities + .NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED); + } catch (IllegalArgumentException ignored) { + // In case TRANSPORT_SATELLITE or NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED + // are not recognized, meaning an old connectivity module runs on new + // android in which case no network with such capabilities will be brought + // up, so it's safe to ignore the exception. + // TODO: Can remove the try-catch in next quarter release. } } } |