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

Commit fcb9e91d authored by Ling Ma's avatar Ling Ma
Browse files

Make SUPL satellite message constrained

SUPL request can bring up unrestricted network depending on carrier config KEY_SATELLITE_DATA_SUPPORT_MODE_INT, in which case the network is constrained and thus SUPL request needs to be constrained.

Test: data browsing + voice call
Test: reviewed BR
Bug: 339688297
Change-Id: I5010804e43e861a200ca8f5112ba98f11a317812
parent 6b2a3990
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.
                    }
                }
            }
        }