diff options
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 2 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index fa6ac8c6e..a1cdbf771 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -4320,6 +4320,8 @@ public class ClientModeImpl extends StateMachine { result.addCapability(NetworkCapabilities.NET_CAPABILITY_TRUSTED); } + result.setOwnerUid(currentWifiConfiguration.creatorUid); + if (!WifiConfiguration.isMetered(currentWifiConfiguration, mWifiInfo)) { result.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED); } else { diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java index c14f7bb69..737980f2f 100644 --- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java @@ -3524,6 +3524,7 @@ public class ClientModeImplTest extends WifiBaseTest { // should have internet capability. assertTrue(networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)); assertNull(networkCapabilities.getNetworkSpecifier()); + assertEquals(mConnectedNetwork.creatorUid, networkCapabilities.getOwnerUid()); } /** |