summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorDoris Ling <dling@google.com>2018-04-26 23:26:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-04-26 23:26:09 +0000
commit3a7d1334697959faee0d646f9ba22cdf38d592ba (patch)
treefa67f274afee1340888dca8f523e4b81d156f6f1 /service
parenta0daf40587b185e4f65549964c465ba7489ad753 (diff)
parentbef13ac26de200570a6b5cfc1c679a54f5c436cb (diff)
Merge "Revert "WifiService: Return status from startScan()"" into pi-dev
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java28
1 files changed, 12 insertions, 16 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index 541fb28f4..cb3628b98 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -600,14 +600,15 @@ public class WifiServiceImpl extends IWifiManager.Stub {
}
/**
- * See {@link android.net.wifi.WifiManager#startScan}
+ * see {@link android.net.wifi.WifiManager#startScan}
+ * and {@link android.net.wifi.WifiManager#startCustomizedScan}
*
* @param packageName Package name of the app that requests wifi scan.
*/
@Override
- public boolean startScan(String packageName) {
+ public void startScan(String packageName) {
if (enforceChangePermission(packageName) != MODE_ALLOWED) {
- return false;
+ return;
}
int callingUid = Binder.getCallingUid();
@@ -623,24 +624,19 @@ public class WifiServiceImpl extends IWifiManager.Stub {
// be sent directly until b/31398592 is fixed.
sendFailedScanBroadcast();
mScanPending = true;
- return false;
+ return;
}
}
- Mutable<Boolean> scanSuccess = new Mutable<>();
- boolean runWithScissorsSuccess = mWifiInjector.getWifiStateMachineHandler()
- .runWithScissors(() -> {
- scanSuccess.value = mScanRequestProxy.startScan(callingUid, packageName);
- }, RUN_WITH_SCISSORS_TIMEOUT_MILLIS);
- if (!runWithScissorsSuccess) {
+ boolean success = mWifiInjector.getWifiStateMachineHandler().runWithScissors(() -> {
+ if (!mScanRequestProxy.startScan(callingUid, packageName)) {
+ Log.e(TAG, "Failed to start scan");
+ }
+ }, RUN_WITH_SCISSORS_TIMEOUT_MILLIS);
+ if (!success) {
+ // TODO: should return false here
Log.e(TAG, "Failed to post runnable to start scan");
sendFailedScanBroadcast();
- return false;
}
- if (!scanSuccess.value) {
- Log.e(TAG, "Failed to start scan");
- return false;
- }
- return true;
}
// Send a failed scan broadcast to indicate the current scan request failed.