diff options
4 files changed, 17 insertions, 11 deletions
diff --git a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/PasspointWifiEntry.java b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/PasspointWifiEntry.java index 4cb790024..39055d663 100644 --- a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/PasspointWifiEntry.java +++ b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/PasspointWifiEntry.java @@ -276,7 +276,7 @@ public class PasspointWifiEntry extends WifiEntry { // Do nothing. return; } - mWifiManager.setMeteredOverridePasspoint(mPasspointConfig.getHomeSp().getFqdn(), + mWifiManager.setPasspointMeteredOverride(mPasspointConfig.getHomeSp().getFqdn(), mMeteredOverride); } diff --git a/service/java/com/android/server/wifi/BaseWifiService.java b/service/java/com/android/server/wifi/BaseWifiService.java index 16e8eb5ee..34d902413 100644 --- a/service/java/com/android/server/wifi/BaseWifiService.java +++ b/service/java/com/android/server/wifi/BaseWifiService.java @@ -196,12 +196,18 @@ public class BaseWifiService extends IWifiManager.Stub { throw new UnsupportedOperationException(); } - @Override + /** @deprecated use {@link #setPasspointMeteredOverride} instead */ + @Deprecated public void setMeteredOverridePasspoint(String fqdn, int meteredOverride) { throw new UnsupportedOperationException(); } @Override + public void setPasspointMeteredOverride(String fqdn, int meteredOverride) { + throw new UnsupportedOperationException(); + } + + @Override public boolean startScan(String packageName, String featureId) { throw new UnsupportedOperationException(); } diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index f4d08454d..3b4e064f6 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -2554,19 +2554,19 @@ public class WifiServiceImpl extends BaseWifiService { } /** - * See {@link android.net.wifi.WifiManager#setMeteredOverridePasspoint(String, boolean)} + * See {@link android.net.wifi.WifiManager#setPasspointMeteredOverride(String, boolean)} * @param fqdn the FQDN that identifies the passpoint configuration * @param meteredOverride One of the values in {@link MeteredOverride} */ @Override - public void setMeteredOverridePasspoint(String fqdn, int meteredOverride) { + public void setPasspointMeteredOverride(String fqdn, int meteredOverride) { enforceNetworkSettingsPermission(); if (fqdn == null) { throw new IllegalArgumentException("FQDN cannot be null"); } int callingUid = Binder.getCallingUid(); - mLog.info("setMeteredOverridePasspoint=% uid=%") + mLog.info("setPasspointMeteredOverride=% uid=%") .c(meteredOverride).c(callingUid).flush(); mWifiThreadRunner.post( () -> mPasspointManager.setMeteredOverride(fqdn, meteredOverride)); diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java index 68211b268..d1d5ecf57 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java @@ -5095,16 +5095,16 @@ public class WifiServiceImplTest extends WifiBaseTest { } /** - * Test that setMeteredOverridePasspoint is protected by NETWORK_SETTINGS permission. + * Test that setPasspointMeteredOverride is protected by NETWORK_SETTINGS permission. */ @Test - public void testSetMeteredOverridePasspointFailureNoNetworkSettingsPermission() + public void testSetPasspointMeteredOverrideFailureNoNetworkSettingsPermission() throws Exception { doThrow(new SecurityException()).when(mContext) .enforceCallingOrSelfPermission(eq(android.Manifest.permission.NETWORK_SETTINGS), eq("WifiService")); try { - mWifiServiceImpl.setMeteredOverridePasspoint("TEST_FQDN", METERED_OVERRIDE_METERED); + mWifiServiceImpl.setPasspointMeteredOverride("TEST_FQDN", METERED_OVERRIDE_METERED); fail("Expected SecurityException"); } catch (SecurityException e) { // Test succeeded @@ -5112,11 +5112,11 @@ public class WifiServiceImplTest extends WifiBaseTest { } /** - * Test that setMeteredOverridePasspoint makes the appropriate calls. + * Test that setPasspointMeteredOverride makes the appropriate calls. */ @Test - public void testSetMeteredOverridePasspoint() throws Exception { - mWifiServiceImpl.setMeteredOverridePasspoint("TEST_FQDN", METERED_OVERRIDE_METERED); + public void testSetPasspointMeteredOverride() throws Exception { + mWifiServiceImpl.setPasspointMeteredOverride("TEST_FQDN", METERED_OVERRIDE_METERED); mLooper.dispatchAll(); verify(mPasspointManager).setMeteredOverride("TEST_FQDN", METERED_OVERRIDE_METERED); } |