Loading wifi/java/android/net/wifi/IWifiManager.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -122,7 +122,7 @@ interface IWifiManager DhcpInfo getDhcpInfo(); void setScanAlwaysAvailable(boolean isAvailable); void setScanAlwaysAvailable(boolean isAvailable, String packageName); boolean isScanAlwaysAvailable(); Loading @@ -142,9 +142,9 @@ interface IWifiManager void updateInterfaceIpState(String ifaceName, int mode); boolean startSoftAp(in WifiConfiguration wifiConfig); boolean startSoftAp(in WifiConfiguration wifiConfig, String packageName); boolean startTetheredHotspot(in SoftApConfiguration softApConfig); boolean startTetheredHotspot(in SoftApConfiguration softApConfig, String packageName); boolean stopSoftAp(); Loading wifi/java/android/net/wifi/WifiManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -2802,7 +2802,7 @@ public class WifiManager { @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setScanAlwaysAvailable(boolean isAvailable) { try { mService.setScanAlwaysAvailable(isAvailable); mService.setScanAlwaysAvailable(isAvailable, mContext.getOpPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -3035,7 +3035,7 @@ public class WifiManager { }) public boolean startSoftAp(@Nullable WifiConfiguration wifiConfig) { try { return mService.startSoftAp(wifiConfig); return mService.startSoftAp(wifiConfig, mContext.getOpPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -3059,7 +3059,7 @@ public class WifiManager { }) public boolean startTetheredHotspot(@Nullable SoftApConfiguration softApConfig) { try { return mService.startTetheredHotspot(softApConfig); return mService.startTetheredHotspot(softApConfig, mContext.getOpPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading wifi/tests/src/android/net/wifi/WifiManagerTest.java +11 −9 Original line number Diff line number Diff line Loading @@ -218,10 +218,10 @@ public class WifiManagerTest { */ @Test public void testStartSoftApCallsServiceWithWifiConfig() throws Exception { when(mWifiService.startSoftAp(eq(mApConfig))).thenReturn(true); when(mWifiService.startSoftAp(mApConfig, TEST_PACKAGE_NAME)).thenReturn(true); assertTrue(mWifiManager.startSoftAp(mApConfig)); when(mWifiService.startSoftAp(eq(mApConfig))).thenReturn(false); when(mWifiService.startSoftAp(mApConfig, TEST_PACKAGE_NAME)).thenReturn(false); assertFalse(mWifiManager.startSoftAp(mApConfig)); } Loading @@ -231,10 +231,10 @@ public class WifiManagerTest { */ @Test public void testStartSoftApCallsServiceWithNullConfig() throws Exception { when(mWifiService.startSoftAp(eq(null))).thenReturn(true); when(mWifiService.startSoftAp(null, TEST_PACKAGE_NAME)).thenReturn(true); assertTrue(mWifiManager.startSoftAp(null)); when(mWifiService.startSoftAp(eq(null))).thenReturn(false); when(mWifiService.startSoftAp(null, TEST_PACKAGE_NAME)).thenReturn(false); assertFalse(mWifiManager.startSoftAp(null)); } Loading @@ -257,10 +257,12 @@ public class WifiManagerTest { @Test public void testStartTetheredHotspotCallsServiceWithSoftApConfig() throws Exception { SoftApConfiguration softApConfig = generatorTestSoftApConfig(); when(mWifiService.startTetheredHotspot(eq(softApConfig))).thenReturn(true); when(mWifiService.startTetheredHotspot(softApConfig, TEST_PACKAGE_NAME)) .thenReturn(true); assertTrue(mWifiManager.startTetheredHotspot(softApConfig)); when(mWifiService.startTetheredHotspot(eq(softApConfig))).thenReturn(false); when(mWifiService.startTetheredHotspot(softApConfig, TEST_PACKAGE_NAME)) .thenReturn(false); assertFalse(mWifiManager.startTetheredHotspot(softApConfig)); } Loading @@ -270,10 +272,10 @@ public class WifiManagerTest { */ @Test public void testStartTetheredHotspotCallsServiceWithNullConfig() throws Exception { when(mWifiService.startTetheredHotspot(eq(null))).thenReturn(true); when(mWifiService.startTetheredHotspot(null, TEST_PACKAGE_NAME)).thenReturn(true); assertTrue(mWifiManager.startTetheredHotspot(null)); when(mWifiService.startTetheredHotspot(eq(null))).thenReturn(false); when(mWifiService.startTetheredHotspot(null, TEST_PACKAGE_NAME)).thenReturn(false); assertFalse(mWifiManager.startTetheredHotspot(null)); } Loading Loading @@ -2375,7 +2377,7 @@ public class WifiManagerTest { @Test public void testScanAvailable() throws Exception { mWifiManager.setScanAlwaysAvailable(true); verify(mWifiService).setScanAlwaysAvailable(true); verify(mWifiService).setScanAlwaysAvailable(true, TEST_PACKAGE_NAME); when(mWifiService.isScanAlwaysAvailable()).thenReturn(false); assertFalse(mWifiManager.isScanAlwaysAvailable()); Loading Loading
wifi/java/android/net/wifi/IWifiManager.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -122,7 +122,7 @@ interface IWifiManager DhcpInfo getDhcpInfo(); void setScanAlwaysAvailable(boolean isAvailable); void setScanAlwaysAvailable(boolean isAvailable, String packageName); boolean isScanAlwaysAvailable(); Loading @@ -142,9 +142,9 @@ interface IWifiManager void updateInterfaceIpState(String ifaceName, int mode); boolean startSoftAp(in WifiConfiguration wifiConfig); boolean startSoftAp(in WifiConfiguration wifiConfig, String packageName); boolean startTetheredHotspot(in SoftApConfiguration softApConfig); boolean startTetheredHotspot(in SoftApConfiguration softApConfig, String packageName); boolean stopSoftAp(); Loading
wifi/java/android/net/wifi/WifiManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -2802,7 +2802,7 @@ public class WifiManager { @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setScanAlwaysAvailable(boolean isAvailable) { try { mService.setScanAlwaysAvailable(isAvailable); mService.setScanAlwaysAvailable(isAvailable, mContext.getOpPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -3035,7 +3035,7 @@ public class WifiManager { }) public boolean startSoftAp(@Nullable WifiConfiguration wifiConfig) { try { return mService.startSoftAp(wifiConfig); return mService.startSoftAp(wifiConfig, mContext.getOpPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -3059,7 +3059,7 @@ public class WifiManager { }) public boolean startTetheredHotspot(@Nullable SoftApConfiguration softApConfig) { try { return mService.startTetheredHotspot(softApConfig); return mService.startTetheredHotspot(softApConfig, mContext.getOpPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
wifi/tests/src/android/net/wifi/WifiManagerTest.java +11 −9 Original line number Diff line number Diff line Loading @@ -218,10 +218,10 @@ public class WifiManagerTest { */ @Test public void testStartSoftApCallsServiceWithWifiConfig() throws Exception { when(mWifiService.startSoftAp(eq(mApConfig))).thenReturn(true); when(mWifiService.startSoftAp(mApConfig, TEST_PACKAGE_NAME)).thenReturn(true); assertTrue(mWifiManager.startSoftAp(mApConfig)); when(mWifiService.startSoftAp(eq(mApConfig))).thenReturn(false); when(mWifiService.startSoftAp(mApConfig, TEST_PACKAGE_NAME)).thenReturn(false); assertFalse(mWifiManager.startSoftAp(mApConfig)); } Loading @@ -231,10 +231,10 @@ public class WifiManagerTest { */ @Test public void testStartSoftApCallsServiceWithNullConfig() throws Exception { when(mWifiService.startSoftAp(eq(null))).thenReturn(true); when(mWifiService.startSoftAp(null, TEST_PACKAGE_NAME)).thenReturn(true); assertTrue(mWifiManager.startSoftAp(null)); when(mWifiService.startSoftAp(eq(null))).thenReturn(false); when(mWifiService.startSoftAp(null, TEST_PACKAGE_NAME)).thenReturn(false); assertFalse(mWifiManager.startSoftAp(null)); } Loading @@ -257,10 +257,12 @@ public class WifiManagerTest { @Test public void testStartTetheredHotspotCallsServiceWithSoftApConfig() throws Exception { SoftApConfiguration softApConfig = generatorTestSoftApConfig(); when(mWifiService.startTetheredHotspot(eq(softApConfig))).thenReturn(true); when(mWifiService.startTetheredHotspot(softApConfig, TEST_PACKAGE_NAME)) .thenReturn(true); assertTrue(mWifiManager.startTetheredHotspot(softApConfig)); when(mWifiService.startTetheredHotspot(eq(softApConfig))).thenReturn(false); when(mWifiService.startTetheredHotspot(softApConfig, TEST_PACKAGE_NAME)) .thenReturn(false); assertFalse(mWifiManager.startTetheredHotspot(softApConfig)); } Loading @@ -270,10 +272,10 @@ public class WifiManagerTest { */ @Test public void testStartTetheredHotspotCallsServiceWithNullConfig() throws Exception { when(mWifiService.startTetheredHotspot(eq(null))).thenReturn(true); when(mWifiService.startTetheredHotspot(null, TEST_PACKAGE_NAME)).thenReturn(true); assertTrue(mWifiManager.startTetheredHotspot(null)); when(mWifiService.startTetheredHotspot(eq(null))).thenReturn(false); when(mWifiService.startTetheredHotspot(null, TEST_PACKAGE_NAME)).thenReturn(false); assertFalse(mWifiManager.startTetheredHotspot(null)); } Loading Loading @@ -2375,7 +2377,7 @@ public class WifiManagerTest { @Test public void testScanAvailable() throws Exception { mWifiManager.setScanAlwaysAvailable(true); verify(mWifiService).setScanAlwaysAvailable(true); verify(mWifiService).setScanAlwaysAvailable(true, TEST_PACKAGE_NAME); when(mWifiService.isScanAlwaysAvailable()).thenReturn(false); assertFalse(mWifiManager.isScanAlwaysAvailable()); Loading