Merge "tests: remove DisabledForUpdateToAnyMatcher"
diff --git a/service/java/com/android/server/wifi/WifiConnectivityManager.java b/service/java/com/android/server/wifi/WifiConnectivityManager.java
index 458f73a..c67e7c6 100644
--- a/service/java/com/android/server/wifi/WifiConnectivityManager.java
+++ b/service/java/com/android/server/wifi/WifiConnectivityManager.java
@@ -814,24 +814,38 @@
             }
         }
 
+        boolean isScanNeeded = true;
         boolean isFullBandScan = true;
+        boolean isTrafficOverThreshold = mWifiInfo.txSuccessRate > mFullScanMaxTxRate
+                || mWifiInfo.rxSuccessRate > mFullScanMaxRxRate;
 
-        // If the WiFi traffic is heavy, only partial scan is initiated.
-        if (mWifiState == WIFI_STATE_CONNECTED
-                && (mWifiInfo.txSuccessRate > mFullScanMaxTxRate
-                    || mWifiInfo.rxSuccessRate > mFullScanMaxRxRate)) {
-            localLog("No full band scan due to ongoing traffic");
-            isFullBandScan = false;
+        // If the WiFi traffic is heavy, only partial scan is proposed.
+        if (mWifiState == WIFI_STATE_CONNECTED && isTrafficOverThreshold) {
+            // If only partial scan is proposed and firmware roaming control is supported,
+            // we will not issue any scan because firmware roaming will take care of
+            // intra-SSID roam.
+            if (mConnectivityHelper.isFirmwareRoamingSupported()) {
+                localLog("No partial scan because firmware roaming is supported.");
+                isScanNeeded = false;
+            } else {
+                localLog("No full band scan due to ongoing traffic");
+                isFullBandScan = false;
+            }
         }
 
-        mLastPeriodicSingleScanTimeStamp = currentTimeStamp;
-        startSingleScan(isFullBandScan, WIFI_WORK_SOURCE);
-        schedulePeriodicScanTimer(mPeriodicSingleScanInterval);
+        if (isScanNeeded) {
+            mLastPeriodicSingleScanTimeStamp = currentTimeStamp;
+            startSingleScan(isFullBandScan, WIFI_WORK_SOURCE);
+            schedulePeriodicScanTimer(mPeriodicSingleScanInterval);
 
-        // Set up the next scan interval in an exponential backoff fashion.
-        mPeriodicSingleScanInterval *= 2;
-        if (mPeriodicSingleScanInterval >  MAX_PERIODIC_SCAN_INTERVAL_MS) {
-            mPeriodicSingleScanInterval = MAX_PERIODIC_SCAN_INTERVAL_MS;
+            // Set up the next scan interval in an exponential backoff fashion.
+            mPeriodicSingleScanInterval *= 2;
+            if (mPeriodicSingleScanInterval >  MAX_PERIODIC_SCAN_INTERVAL_MS) {
+                mPeriodicSingleScanInterval = MAX_PERIODIC_SCAN_INTERVAL_MS;
+            }
+        } else {
+            // Since we already skipped this scan, keep the same scan interval for next scan.
+            schedulePeriodicScanTimer(mPeriodicSingleScanInterval);
         }
     }
 
diff --git a/service/java/com/android/server/wifi/WifiDiagnostics.java b/service/java/com/android/server/wifi/WifiDiagnostics.java
index 921faa3..30294bd 100644
--- a/service/java/com/android/server/wifi/WifiDiagnostics.java
+++ b/service/java/com/android/server/wifi/WifiDiagnostics.java
@@ -454,6 +454,10 @@
             return false;
         }
 
+        if (!isVerboseLoggingEnabled()) {
+            return false;
+        }
+
         for (WifiNative.RingBufferStatus buffer : mRingBuffers){
 
             if ((buffer.flag & RING_BUFFER_FLAG_HAS_PER_PACKET_ENTRIES) != 0) {
diff --git a/service/java/com/android/server/wifi/aware/WifiAwareServiceImpl.java b/service/java/com/android/server/wifi/aware/WifiAwareServiceImpl.java
index 62cc3ec..e609c86 100644
--- a/service/java/com/android/server/wifi/aware/WifiAwareServiceImpl.java
+++ b/service/java/com/android/server/wifi/aware/WifiAwareServiceImpl.java
@@ -242,7 +242,8 @@
         if (publishConfig == null) {
             throw new IllegalArgumentException("PublishConfig must not be null");
         }
-        publishConfig.assertValid(mStateManager.getCharacteristics());
+        publishConfig.assertValid(mStateManager.getCharacteristics(),
+                mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI_RTT));
 
         int uid = getMockableCallingUid();
         enforceClientValidity(uid, clientId);
@@ -262,7 +263,8 @@
         if (publishConfig == null) {
             throw new IllegalArgumentException("PublishConfig must not be null");
         }
-        publishConfig.assertValid(mStateManager.getCharacteristics());
+        publishConfig.assertValid(mStateManager.getCharacteristics(),
+                mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI_RTT));
 
         int uid = getMockableCallingUid();
         enforceClientValidity(uid, clientId);
@@ -287,7 +289,8 @@
         if (subscribeConfig == null) {
             throw new IllegalArgumentException("SubscribeConfig must not be null");
         }
-        subscribeConfig.assertValid(mStateManager.getCharacteristics());
+        subscribeConfig.assertValid(mStateManager.getCharacteristics(),
+                mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI_RTT));
 
         int uid = getMockableCallingUid();
         enforceClientValidity(uid, clientId);
@@ -307,7 +310,8 @@
         if (subscribeConfig == null) {
             throw new IllegalArgumentException("SubscribeConfig must not be null");
         }
-        subscribeConfig.assertValid(mStateManager.getCharacteristics());
+        subscribeConfig.assertValid(mStateManager.getCharacteristics(),
+                mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI_RTT));
 
         int uid = getMockableCallingUid();
         enforceClientValidity(uid, clientId);
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointConfigStoreData.java b/service/java/com/android/server/wifi/hotspot2/PasspointConfigStoreData.java
index 38401d2..553a38b 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointConfigStoreData.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointConfigStoreData.java
@@ -307,6 +307,7 @@
         String clientCertificateAlias = null;
         String clientPrivateKeyAlias = null;
         boolean hasEverConnected = false;
+        boolean shared = false;
         PasspointConfiguration config = null;
         while (XmlUtils.nextElementWithin(in, outerTagDepth)) {
             if (in.getAttributeValue(null, "name") != null) {
@@ -351,7 +352,7 @@
         }
         return new PasspointProvider(config, mKeyStore, mSimAccessor, providerId, creatorUid,
                 caCertificateAlias, clientCertificateAlias, clientPrivateKeyAlias,
-                hasEverConnected);
+                hasEverConnected, shared);
     }
 
     /**
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java
index fec3dd8..d29d00a 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java
@@ -720,7 +720,7 @@
                 mSimAccessor, mProviderIndex++, wifiConfig.creatorUid,
                 enterpriseConfig.getCaCertificateAlias(),
                 enterpriseConfig.getClientCertificateAlias(),
-                enterpriseConfig.getClientCertificateAlias(), false);
+                enterpriseConfig.getClientCertificateAlias(), false, false);
         mProviders.put(passpointConfig.getHomeSp().getFqdn(), provider);
         return true;
     }
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java b/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java
index c7943ed..23ab57f 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java
@@ -88,16 +88,17 @@
     private final AuthParam mAuthParam;
 
     private boolean mHasEverConnected;
+    private boolean mIsShared;
 
     public PasspointProvider(PasspointConfiguration config, WifiKeyStore keyStore,
             SIMAccessor simAccessor, long providerId, int creatorUid) {
-        this(config, keyStore, simAccessor, providerId, creatorUid, null, null, null, false);
+        this(config, keyStore, simAccessor, providerId, creatorUid, null, null, null, false, false);
     }
 
     public PasspointProvider(PasspointConfiguration config, WifiKeyStore keyStore,
             SIMAccessor simAccessor, long providerId, int creatorUid, String caCertificateAlias,
             String clientCertificateAlias, String clientPrivateKeyAlias,
-            boolean hasEverConnected) {
+            boolean hasEverConnected, boolean isShared) {
         // Maintain a copy of the configuration to avoid it being updated by others.
         mConfig = new PasspointConfiguration(config);
         mKeyStore = keyStore;
@@ -107,6 +108,7 @@
         mClientCertificateAlias = clientCertificateAlias;
         mClientPrivateKeyAlias = clientPrivateKeyAlias;
         mHasEverConnected = hasEverConnected;
+        mIsShared = isShared;
 
         // Setup EAP method and authentication parameter based on the credential.
         if (mConfig.getCredential().getUserCredential() != null) {
@@ -311,6 +313,7 @@
                     mConfig.getCredential().getSimCredential());
         }
         wifiConfig.enterpriseConfig = enterpriseConfig;
+        wifiConfig.shared = mIsShared;
         return wifiConfig;
     }
 
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
index 4fabd9d..30f823a 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
@@ -1027,11 +1027,12 @@
      * Verify that we perform partial scan when the currently connected network's tx/rx success
      * rate is high and when the currently connected network is present in scan
      * cache in WifiConfigManager.
+     * WifiConnectivityManager does partial scan only when firmware roaming is not supported.
      *
-     * Expected behavior: WifiConnectivityManager does full band scan.
+     * Expected behavior: WifiConnectivityManager does partial scan.
      */
     @Test
-    public void checkSingleScanSettingsWhenConnectedWithHighDataRate() {
+    public void checkPartialScanRequestedWithHighDataRateWithoutFwRoaming() {
         mWifiInfo.txSuccessRate = mFullScanMaxTxPacketRate * 2;
         mWifiInfo.rxSuccessRate = mFullScanMaxRxPacketRate * 2;
 
@@ -1044,6 +1045,7 @@
                 .thenReturn(new WifiConfiguration());
         when(mWifiConfigManager.fetchChannelSetForNetworkForPartialScan(anyInt(), anyLong(),
                 anyInt())).thenReturn(channelList);
+        when(mWifiConnectivityHelper.isFirmwareRoamingSupported()).thenReturn(false);
 
         doAnswer(new AnswerWithArguments() {
             public void answer(ScanSettings settings, ScanListener listener,
@@ -1066,6 +1068,52 @@
     }
 
     /**
+     * Verify that we skip the partial scan when:
+     * 1. The currently connected network's tx/rx success rate is high.
+     * 2. When the currently connected network is present in scan
+     * cache in WifiConfigManager.
+     * 3. When firmware roaming is supported.
+     * Expected behavior: WifiConnectivityManager does no scan, but periodic scans
+     * are still scheduled.
+     */
+    @Test
+    public void checkPartialScanSkippedWithHighDataRateWithFwRoaming() {
+        mWifiInfo.txSuccessRate = mFullScanMaxTxPacketRate * 2;
+        mWifiInfo.rxSuccessRate = mFullScanMaxRxPacketRate * 2;
+
+        long currentTimeStamp = CURRENT_SYSTEM_TIME_MS;
+        when(mClock.getElapsedSinceBootMillis()).thenReturn(currentTimeStamp);
+
+        final HashSet<Integer> channelList = new HashSet<>();
+        channelList.add(1);
+        channelList.add(2);
+        channelList.add(3);
+
+        when(mWifiStateMachine.getCurrentWifiConfiguration())
+                .thenReturn(new WifiConfiguration());
+        when(mWifiConfigManager.fetchChannelSetForNetworkForPartialScan(anyInt(), anyLong(),
+                anyInt())).thenReturn(channelList);
+        // No scan will be requested when firmware roaming control is not supported.
+        when(mWifiConnectivityHelper.isFirmwareRoamingSupported()).thenReturn(true);
+
+        // Set screen to ON
+        mWifiConnectivityManager.handleScreenStateChanged(true);
+
+        // Set WiFi to connected state to trigger periodic scan
+        mWifiConnectivityManager.handleConnectionStateChanged(
+                WifiConnectivityManager.WIFI_STATE_CONNECTED);
+
+        verify(mWifiScanner, never()).startScan(anyObject(), anyObject(), anyObject());
+
+        // Get the first periodic scan interval to check that we are still scheduling
+        // periodic scans.
+        long firstIntervalMs = mAlarmManager
+                .getTriggerTimeMillis(WifiConnectivityManager.PERIODIC_SCAN_TIMER_TAG)
+                - currentTimeStamp;
+        assertEquals(firstIntervalMs, WifiConnectivityManager.PERIODIC_SCAN_INTERVAL_MS);
+    }
+
+    /**
      * Verify that we fall back to full band scan when the currently connected network's tx/rx
      * success rate is high and the currently connected network is not present in scan cache in
      * WifiConfigManager. This is simulated by returning an empty hashset in |makeChannelList|.
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java
index 6b93e05..f607b33 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java
@@ -20,6 +20,7 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.AdditionalMatchers.gt;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.contains;
 import static org.mockito.Mockito.anyInt;
@@ -119,7 +120,7 @@
     /** Verifies that startLogging() registers a logging event handler. */
     @Test
     public void startLoggingRegistersLogEventHandler() throws Exception {
-        final boolean verbosityToggle = false;  // even default mode wants log events from HAL
+        final boolean verbosityToggle = false;  // even default mode registers handler
         mWifiDiagnostics.startLogging(verbosityToggle);
         verify(mWifiNative).setLoggingEventHandler(anyObject());
     }
@@ -131,7 +132,7 @@
     @Test
     public void startLoggingRegistersLogEventHandlerIfPriorAttemptFailed()
             throws Exception {
-        final boolean verbosityToggle = false;  // even default mode wants log events from HAL
+        final boolean verbosityToggle = false;  // even default mode registers handler
 
         when(mWifiNative.setLoggingEventHandler(anyObject())).thenReturn(false);
         mWifiDiagnostics.startLogging(verbosityToggle);
@@ -147,7 +148,7 @@
     @Test
     public void startLoggingDoesNotRegisterLogEventHandlerIfPriorAttemptSucceeded()
             throws Exception {
-        final boolean verbosityToggle = false;  // even default mode wants log events from HAL
+        final boolean verbosityToggle = false;  // even default mode registers handler
 
         when(mWifiNative.setLoggingEventHandler(anyObject())).thenReturn(true);
         mWifiDiagnostics.startLogging(verbosityToggle);
@@ -166,19 +167,32 @@
      * b) instructs WifiNative to enable ring buffers of the appropriate log level.
      */
     @Test
-    public void startLoggingStopsAndRestartsRingBufferLogging() throws Exception {
-        final boolean verbosityToggle = false;
+    public void startLoggingStopsAndRestartsRingBufferLoggingInVerboseMode() throws Exception {
+        final boolean verbosityToggle = true;
         setBuildPropertiesToEnableRingBuffers();
         mWifiDiagnostics.startLogging(verbosityToggle);
         verify(mWifiNative).startLoggingRingBuffer(
                 eq(WifiDiagnostics.VERBOSE_NO_LOG), anyInt(), anyInt(), anyInt(),
                 eq(FAKE_RING_BUFFER_NAME));
         verify(mWifiNative).startLoggingRingBuffer(
-                eq(WifiDiagnostics.VERBOSE_NORMAL_LOG), anyInt(), anyInt(), anyInt(),
+                eq(WifiDiagnostics.VERBOSE_LOG_WITH_WAKEUP), anyInt(), anyInt(), anyInt(),
                 eq(FAKE_RING_BUFFER_NAME));
     }
 
     @Test
+    public void startLoggingStopsButDoesNotStartRingBufferLoggingInNormalMode() throws Exception {
+        final boolean verbosityToggle = false;
+        setBuildPropertiesToEnableRingBuffers();
+        mWifiDiagnostics.startLogging(verbosityToggle);
+        verify(mWifiNative).startLoggingRingBuffer(
+                eq(WifiDiagnostics.VERBOSE_NO_LOG), anyInt(), anyInt(), anyInt(),
+                eq(FAKE_RING_BUFFER_NAME));
+        verify(mWifiNative, never()).startLoggingRingBuffer(
+                gt(WifiDiagnostics.VERBOSE_NO_LOG), anyInt(), anyInt(), anyInt(),
+                anyString());
+    }
+
+    @Test
     public void startLoggingDoesNotStartRingBuffersOnUserBuilds() throws Exception {
         final boolean verbosityToggle = true;
         mWifiDiagnostics.startLogging(verbosityToggle);
@@ -189,7 +203,7 @@
     /** Verifies that, if a log handler was registered, then stopLogging() resets it. */
     @Test
     public void stopLoggingResetsLogHandlerIfHandlerWasRegistered() throws Exception {
-        final boolean verbosityToggle = false;  // even default mode wants log events from HAL
+        final boolean verbosityToggle = false;  // even default mode registers handler
 
         when(mWifiNative.setLoggingEventHandler(anyObject())).thenReturn(true);
         mWifiDiagnostics.startLogging(verbosityToggle);
@@ -202,7 +216,6 @@
     /** Verifies that, if a log handler is not registered, stopLogging() skips resetLogHandler(). */
     @Test
     public void stopLoggingOnlyResetsLogHandlerIfHandlerWasRegistered() throws Exception {
-        final boolean verbosityToggle = false;  // even default mode wants log events from HAL
         mWifiDiagnostics.stopLogging();
         verify(mWifiNative, never()).resetLogHandler();
     }
@@ -210,7 +223,7 @@
     /** Verifies that stopLogging() remembers that we've reset the log handler. */
     @Test
     public void multipleStopLoggingCallsOnlyResetLogHandlerOnce() throws Exception {
-        final boolean verbosityToggle = false;  // even default mode wants log events from HAL
+        final boolean verbosityToggle = false;  // even default mode registers handler
 
         when(mWifiNative.setLoggingEventHandler(anyObject())).thenReturn(true);
         mWifiDiagnostics.startLogging(verbosityToggle);
diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java
index f323110..a0abf16 100644
--- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java
@@ -120,6 +120,8 @@
         when(mContextMock.getPackageManager()).thenReturn(mPackageManagerMock);
         when(mPackageManagerMock.hasSystemFeature(PackageManager.FEATURE_WIFI_AWARE))
                 .thenReturn(true);
+        when(mPackageManagerMock.hasSystemFeature(PackageManager.FEATURE_WIFI_RTT))
+                .thenReturn(true);
         when(mAwareStateManagerMock.getCharacteristics()).thenReturn(getCharacteristics());
 
         mDut = new WifiAwareServiceImplSpy(mContextMock);
@@ -238,6 +240,41 @@
     }
 
     /**
+     * Validate that the RTT feature support is checked when attempting a Publish with ranging.
+     */
+    @Test(expected = IllegalArgumentException.class)
+    public void testFailOnPublishRangingWithoutRttFeature() throws Exception {
+        when(mPackageManagerMock.hasSystemFeature(PackageManager.FEATURE_WIFI_RTT)).thenReturn(
+                false);
+
+        PublishConfig publishConfig = new PublishConfig.Builder().setServiceName("something.valid")
+                .setRangingEnabled(true).build();
+        int clientId = doConnect();
+        IWifiAwareDiscoverySessionCallback mockCallback = mock(
+                IWifiAwareDiscoverySessionCallback.class);
+
+        mDut.publish(clientId, publishConfig, mockCallback);
+    }
+
+    /**
+     * Validate that the RTT feature support is checked when attempting a Subscribe with ranging.
+     */
+    @Test(expected = IllegalArgumentException.class)
+    public void testFailOnSubscribeRangingWithoutRttFeature() throws Exception {
+        when(mPackageManagerMock.hasSystemFeature(PackageManager.FEATURE_WIFI_RTT)).thenReturn(
+                false);
+
+        SubscribeConfig subscribeConfig = new SubscribeConfig.Builder().setServiceName(
+                "something.valid").setMaxDistanceMm(100).build();
+        int clientId = doConnect();
+        IWifiAwareDiscoverySessionCallback mockCallback = mock(
+                IWifiAwareDiscoverySessionCallback.class);
+
+        mDut.subscribe(clientId, subscribeConfig, mockCallback);
+    }
+
+
+    /**
      * Validates that on binder death we get a disconnect().
      */
     @Test
@@ -295,7 +332,7 @@
     @Test
     public void testPublish() {
         PublishConfig publishConfig = new PublishConfig.Builder().setServiceName("something.valid")
-                .build();
+                .setRangingEnabled(true).build();
         int clientId = doConnect();
         IWifiAwareDiscoverySessionCallback mockCallback = mock(
                 IWifiAwareDiscoverySessionCallback.class);
@@ -390,7 +427,7 @@
     @Test
     public void testSubscribe() {
         SubscribeConfig subscribeConfig = new SubscribeConfig.Builder()
-                .setServiceName("something.valid").build();
+                .setServiceName("something.valid").setMaxDistanceMm(100).build();
         int clientId = doConnect();
         IWifiAwareDiscoverySessionCallback mockCallback = mock(
                 IWifiAwareDiscoverySessionCallback.class);
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java
index 7e05c3d..8441eb0 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java
@@ -61,6 +61,7 @@
     private static final long TEST_PROVIDER_ID = 1;
     private static final int TEST_CREATOR_UID = 1234;
     private static final boolean TEST_HAS_EVER_CONNECTED = true;
+    private static final boolean TEST_SHARED = false;
 
     @Mock WifiKeyStore mKeyStore;
     @Mock SIMAccessor mSimAccessor;
@@ -239,7 +240,7 @@
         providerList.add(new PasspointProvider(createFullPasspointConfiguration(),
                 mKeyStore, mSimAccessor, TEST_PROVIDER_ID, TEST_CREATOR_UID,
                 TEST_CA_CERTIFICATE_ALIAS, TEST_CLIENT_CERTIFICATE_ALIAS,
-                TEST_CLIENT_PRIVATE_KEY_ALIAS, TEST_HAS_EVER_CONNECTED));
+                TEST_CLIENT_PRIVATE_KEY_ALIAS, TEST_HAS_EVER_CONNECTED, TEST_SHARED));
 
         // Serialize data for user store.
         when(mDataSource.getProviders()).thenReturn(providerList);
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
index 9ee9fc6..355c252 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
@@ -650,6 +650,7 @@
         assertTrue(Arrays.equals(rcOIs, wifiConfig.roamingConsortiumIds));
         assertTrue(wifiConfig.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.WPA_EAP));
         assertTrue(wifiConfig.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.IEEE8021X));
+        assertFalse(wifiConfig.shared);
         assertEquals(realm, wifiEnterpriseConfig.getRealm());
         assertEquals(fqdn, wifiEnterpriseConfig.getDomainSuffixMatch());
         assertEquals("anonymous@" + realm, wifiEnterpriseConfig.getAnonymousIdentity());
@@ -712,6 +713,7 @@
         assertTrue(Arrays.equals(rcOIs, wifiConfig.roamingConsortiumIds));
         assertTrue(wifiConfig.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.WPA_EAP));
         assertTrue(wifiConfig.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.IEEE8021X));
+        assertFalse(wifiConfig.shared);
         assertEquals(realm, wifiEnterpriseConfig.getRealm());
         assertEquals(fqdn, wifiEnterpriseConfig.getDomainSuffixMatch());
         assertEquals("anonymous@" + realm, wifiEnterpriseConfig.getAnonymousIdentity());
@@ -761,6 +763,7 @@
         assertTrue(Arrays.equals(rcOIs, wifiConfig.roamingConsortiumIds));
         assertTrue(wifiConfig.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.WPA_EAP));
         assertTrue(wifiConfig.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.IEEE8021X));
+        assertFalse(wifiConfig.shared);
         assertEquals(realm, wifiEnterpriseConfig.getRealm());
         assertEquals(fqdn, wifiEnterpriseConfig.getDomainSuffixMatch());
         assertEquals(WifiEnterpriseConfig.Eap.SIM, wifiEnterpriseConfig.getEapMethod());