Merge "Allow SUPL to use restricted network in emergency" into tm-dev

This commit is contained in:
TreeHugger Robot
2022-05-20 20:12:57 +00:00
committed by Android (Google) Code Review

View File

@@ -16,6 +16,8 @@
package com.android.server.location.gnss;
import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.LinkAddress;
@@ -47,7 +49,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* Handles network connection requests and network state change updates for AGPS data download.
*/
@@ -582,6 +583,7 @@ class GnssNetworkConnectivityHandler {
if (mNiHandler.getInEmergency() && mActiveSubId >= 0) {
if (DEBUG) Log.d(TAG, "Adding Network Specifier: " + Integer.toString(mActiveSubId));
networkRequestBuilder.setNetworkSpecifier(Integer.toString(mActiveSubId));
networkRequestBuilder.removeCapability(NET_CAPABILITY_NOT_RESTRICTED);
}
NetworkRequest networkRequest = networkRequestBuilder.build();
// Make sure we only have a single request.