From 89c6362def55a9ef20626b21c5b72f30dc8c2219 Mon Sep 17 00:00:00 2001 From: Erik Kline Date: Fri, 26 Jan 2018 19:23:14 +0900 Subject: [PATCH] Add Tethering's UID to the legacy type NetworkCapabilities This is needed because satisfiedByNC() compares UIDs by default now, and the NCs we receive in callbacks have Tethering's UID patched in. Bug: 72498421 Test: as follows - built - flashed - booted - runtest frameworks-net passes, module library loading failures: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libdexfile.so" not found - manually starting tethering works fine Change-Id: I31f6516e2c1539809f8d052333fd2a616158cb92 --- .../server/connectivity/tethering/UpstreamNetworkMonitor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/core/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java b/services/core/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java index b35ed75106b31..34132910ca862 100644 --- a/services/core/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java +++ b/services/core/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java @@ -24,6 +24,7 @@ import static android.net.ConnectivityManager.TYPE_MOBILE_HIPRI; import android.content.Context; import android.os.Handler; import android.os.Looper; +import android.os.Process; import android.net.ConnectivityManager; import android.net.ConnectivityManager.NetworkCallback; import android.net.IpPrefix; @@ -476,6 +477,7 @@ public class UpstreamNetworkMonitor { ConnectivityManager.getNetworkTypeName(type)); continue; } + nc.setSingleUid(Process.myUid()); for (NetworkState value : netStates) { if (!nc.satisfiedByNetworkCapabilities(value.networkCapabilities)) {