Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fda0d93b authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make SUPL satellite message constrained" into main

parents bf7b5761 fcb9e91d
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -619,7 +619,18 @@ class GnssNetworkConnectivityHandler {
                ServiceState state = telephonyManager.getServiceState();
                if (state != null && state.isUsingNonTerrestrialNetwork()) {
                    networkRequestBuilder.removeCapability(NET_CAPABILITY_NOT_RESTRICTED);
                    networkRequestBuilder.addTransportType(NetworkCapabilities.TRANSPORT_SATELLITE);
                    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.
                    }
                }
            }
        }