diff options
author | Nate Jiang <qiangjiang@google.com> | 2020-02-27 02:10:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-02-27 02:10:28 +0000 |
commit | 3877359c5416e9444743c493959ca425bce87346 (patch) | |
tree | ff4194d7f92b8041dec3b270247a6e43bcb5665b | |
parent | 2d7d6154fd751d28114cc63af2af6963b125dc75 (diff) | |
parent | ffa8f72e4e7a1f7ab8849a355aae2f60b8e8fd71 (diff) |
Merge "Set creatorUid to NetworkCapabilities after connection" into rvc-dev
-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()); } /** |