Merge "Revert "WifiManager: Return status from startScan()"" into pi-dev
This commit is contained in:
@@ -85,7 +85,7 @@ interface IWifiManager
|
|||||||
|
|
||||||
boolean disableNetwork(int netId, String packageName);
|
boolean disableNetwork(int netId, String packageName);
|
||||||
|
|
||||||
boolean startScan(String packageName);
|
void startScan(String packageName);
|
||||||
|
|
||||||
List<ScanResult> getScanResults(String callingPackage);
|
List<ScanResult> getScanResults(String callingPackage);
|
||||||
|
|
||||||
|
|||||||
@@ -1635,7 +1635,8 @@ public class WifiManager {
|
|||||||
public boolean startScan(WorkSource workSource) {
|
public boolean startScan(WorkSource workSource) {
|
||||||
try {
|
try {
|
||||||
String packageName = mContext.getOpPackageName();
|
String packageName = mContext.getOpPackageName();
|
||||||
return mService.startScan(packageName);
|
mService.startScan(packageName);
|
||||||
|
return true;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw e.rethrowFromSystemServer();
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1070,16 +1070,4 @@ i * Verify that a call to cancel WPS immediately returns a failure.
|
|||||||
fail("setWifiApConfiguration should rethrow Exceptions from WifiService");
|
fail("setWifiApConfiguration should rethrow Exceptions from WifiService");
|
||||||
} catch (SecurityException e) { }
|
} catch (SecurityException e) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check the call to startScan calls WifiService.
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
public void testStartScan() throws Exception {
|
|
||||||
when(mWifiService.startScan(TEST_PACKAGE_NAME)).thenReturn(true);
|
|
||||||
assertTrue(mWifiManager.startScan());
|
|
||||||
|
|
||||||
when(mWifiService.startScan(TEST_PACKAGE_NAME)).thenReturn(false);
|
|
||||||
assertFalse(mWifiManager.startScan());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user