From cd1a9faab17a14532425a10543429b68790309af Mon Sep 17 00:00:00 2001 From: Ningyuan Wang Date: Tue, 19 Dec 2017 10:17:13 -0800 Subject: Remove the use of ScanSettings This is an internal cleanup patch. Bug: 68388459 Test: compile, unit tests Test: manual test that wifi scan still works Change-Id: Iaa5bd5d8c78bc0adea3d29a0b2970a714743834f --- service/java/com/android/server/wifi/WifiServiceImpl.java | 8 ++------ .../src/com/android/server/wifi/WifiServiceImplTest.java | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index a88b20d62..43c549388 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -63,7 +63,6 @@ import android.net.ip.IpClient; import android.net.wifi.ISoftApCallback; import android.net.wifi.IWifiManager; import android.net.wifi.ScanResult; -import android.net.wifi.ScanSettings; import android.net.wifi.WifiActivityEnergyInfo; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; @@ -605,13 +604,10 @@ public class WifiServiceImpl extends IWifiManager.Stub { * see {@link android.net.wifi.WifiManager#startScan} * and {@link android.net.wifi.WifiManager#startCustomizedScan} * - * @param settings If null, use default parameter, i.e. full scan. - * @param workSource If null, all blame is given to the calling uid. * @param packageName Package name of the app that requests wifi scan. - * TODO(b/68388459): Remove |settings| & |worksource| */ @Override - public void startScan(ScanSettings settings, WorkSource workSource, String packageName) { + public void startScan(String packageName) { if (enforceChangePermission(packageName) != MODE_ALLOWED) { return; } @@ -693,7 +689,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { // Someone requested a scan while we were idle; do a full scan now. // A security check of the caller's identity was made when the request arrived via // Binder. Now we'll pass the current process's identity to startScan(). - startScan(null, null, mContext.getOpPackageName()); + startScan(mContext.getOpPackageName()); } } diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java index efd9b9fc0..72e463100 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java @@ -1025,7 +1025,7 @@ public class WifiServiceImplTest { setupWifiStateMachineHandlerForRunWithScissors(); doReturn(false).when(mHandlerSpyForWsmRunWithScissors) .runWithScissors(any(), anyLong()); - mWifiServiceImpl.startScan(null, null, SCAN_PACKAGE_NAME); + mWifiServiceImpl.startScan(SCAN_PACKAGE_NAME); verify(mScanRequestProxy, never()).startScan(Process.myUid(), SCAN_PACKAGE_NAME); } @@ -2523,7 +2523,7 @@ public class WifiServiceImplTest { TestUtil.sendIdleModeChanged(mBroadcastReceiverCaptor.getValue(), mContext); // Send a scan request while the device is idle. - mWifiServiceImpl.startScan(null, null, SCAN_PACKAGE_NAME); + mWifiServiceImpl.startScan(SCAN_PACKAGE_NAME); // No scans must be made yet as the device is idle. verify(mScanRequestProxy, never()).startScan(Process.myUid(), SCAN_PACKAGE_NAME); @@ -2540,7 +2540,7 @@ public class WifiServiceImplTest { // Send another scan request. The device is not idle anymore, so it must be executed // immediately. - mWifiServiceImpl.startScan(null, null, SCAN_PACKAGE_NAME); + mWifiServiceImpl.startScan(SCAN_PACKAGE_NAME); verify(mScanRequestProxy).startScan(Process.myUid(), SCAN_PACKAGE_NAME); } -- cgit v1.2.3