Loading wifi/java/android/net/wifi/WifiManager.java +12 −12 Original line number Diff line number Diff line Loading @@ -1802,25 +1802,25 @@ public class WifiManager { } /** * Start AccessPoint mode with the specified * configuration. If the radio is already running in * AP mode, update the new configuration * Note that starting in access point mode disables station * mode operation * This call will be deprecated and removed in an upcoming release. It is no longer used to * start WiFi Tethering. Please use {@link ConnectivityManager#startTethering(int, boolean, * ConnectivityManager#OnStartTetheringCallback)} if * the caller has proper permissions. Callers can also use the LocalOnlyHotspot feature for a * hotspot capable of communicating with co-located devices {@link * WifiManager#startLocalOnlyHotspot(LocalOnlyHotspotCallback)}. * * @param wifiConfig SSID, security and channel details as * part of WifiConfiguration * @return {@code true} if the operation succeeds, {@code false} otherwise * @return {@code false} * * @hide */ @SystemApi public boolean setWifiApEnabled(WifiConfiguration wifiConfig, boolean enabled) { try { mService.setWifiApEnabled(wifiConfig, enabled); return true; } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } String packageName = mContext.getOpPackageName(); Log.w(TAG, packageName + " attempted call to setWifiApEnabled: enabled = " + enabled); return false; } /** Loading wifi/tests/src/android/net/wifi/WifiManagerTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -778,4 +778,13 @@ public class WifiManagerTest { verify(mWifiService).stopWatchLocalOnlyHotspot(); } /** * Verify that calls to setWifiApEnabled return false. */ @Test public void testSetWifiApEnabledReturnsFalse() throws Exception { assertFalse(mWifiManager.setWifiApEnabled(null, true)); assertFalse(mWifiManager.setWifiApEnabled(null, false)); verify(mWifiService, never()).setWifiApEnabled(any(), anyBoolean()); } } Loading
wifi/java/android/net/wifi/WifiManager.java +12 −12 Original line number Diff line number Diff line Loading @@ -1802,25 +1802,25 @@ public class WifiManager { } /** * Start AccessPoint mode with the specified * configuration. If the radio is already running in * AP mode, update the new configuration * Note that starting in access point mode disables station * mode operation * This call will be deprecated and removed in an upcoming release. It is no longer used to * start WiFi Tethering. Please use {@link ConnectivityManager#startTethering(int, boolean, * ConnectivityManager#OnStartTetheringCallback)} if * the caller has proper permissions. Callers can also use the LocalOnlyHotspot feature for a * hotspot capable of communicating with co-located devices {@link * WifiManager#startLocalOnlyHotspot(LocalOnlyHotspotCallback)}. * * @param wifiConfig SSID, security and channel details as * part of WifiConfiguration * @return {@code true} if the operation succeeds, {@code false} otherwise * @return {@code false} * * @hide */ @SystemApi public boolean setWifiApEnabled(WifiConfiguration wifiConfig, boolean enabled) { try { mService.setWifiApEnabled(wifiConfig, enabled); return true; } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } String packageName = mContext.getOpPackageName(); Log.w(TAG, packageName + " attempted call to setWifiApEnabled: enabled = " + enabled); return false; } /** Loading
wifi/tests/src/android/net/wifi/WifiManagerTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -778,4 +778,13 @@ public class WifiManagerTest { verify(mWifiService).stopWatchLocalOnlyHotspot(); } /** * Verify that calls to setWifiApEnabled return false. */ @Test public void testSetWifiApEnabledReturnsFalse() throws Exception { assertFalse(mWifiManager.setWifiApEnabled(null, true)); assertFalse(mWifiManager.setWifiApEnabled(null, false)); verify(mWifiService, never()).setWifiApEnabled(any(), anyBoolean()); } }