1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.wifi.mockwifi.nl80211; 18 19 import android.net.wifi.nl80211.IPnoScanEvent; 20 import android.net.wifi.nl80211.IScanEvent; 21 import android.net.wifi.nl80211.IWifiScannerImpl; 22 import android.net.wifi.nl80211.NativeScanResult; 23 import android.net.wifi.nl80211.PnoSettings; 24 import android.net.wifi.nl80211.SingleScanSettings; 25 import android.util.Log; 26 27 public class IWifiScannerImp extends IWifiScannerImpl.Stub { 28 private static final String TAG = "IWifiScannerImp"; 29 30 private String mIfaceName; 31 IWifiScannerImp(String ifaceName)32 public IWifiScannerImp(String ifaceName) { 33 mIfaceName = ifaceName; 34 } 35 36 // Supported methods in IWifiScannerImpl.aidl 37 @Override getScanResults()38 public NativeScanResult[] getScanResults() { 39 Log.i(TAG, "getScanResults"); 40 // TODO: Mock it when we have a use (test) case. 41 return null; 42 } 43 44 @Override getPnoScanResults()45 public NativeScanResult[] getPnoScanResults() { 46 Log.i(TAG, "getPnoScanResults"); 47 // TODO: Mock it when we have a use (test) case. 48 return null; 49 } 50 51 @Override scan(SingleScanSettings scanSettings)52 public boolean scan(SingleScanSettings scanSettings) { 53 Log.i(TAG, "scan"); 54 // TODO: Mock it when we have a use (test) case. 55 return true; 56 } 57 58 @Override scanRequest(SingleScanSettings scanSettings)59 public int scanRequest(SingleScanSettings scanSettings) { 60 Log.i(TAG, "scanRequest"); 61 // TODO: Mock it when we have a use (test) case. 62 return 0; 63 } 64 65 @Override subscribeScanEvents(IScanEvent handler)66 public void subscribeScanEvents(IScanEvent handler) { 67 Log.i(TAG, "subscribeScanEvents"); 68 // TODO: Mock it when we have a use (test) case. 69 } 70 71 @Override unsubscribeScanEvents()72 public void unsubscribeScanEvents() { 73 Log.i(TAG, "unsubscribeScanEvents"); 74 // TODO: Mock it when we have a use (test) case. 75 } 76 77 @Override subscribePnoScanEvents(IPnoScanEvent handler)78 public void subscribePnoScanEvents(IPnoScanEvent handler) { 79 Log.i(TAG, "subscribePnoScanEvents"); 80 // TODO: Mock it when we have a use (test) case. 81 } 82 83 @Override unsubscribePnoScanEvents()84 public void unsubscribePnoScanEvents() { 85 Log.i(TAG, "unsubscribePnoScanEvents"); 86 // TODO: Mock it when we have a use (test) case. 87 } 88 89 @Override startPnoScan(PnoSettings pnoSettings)90 public boolean startPnoScan(PnoSettings pnoSettings) { 91 Log.i(TAG, "startPnoScan"); 92 // TODO: Mock it when we have a use (test) case. 93 return false; 94 } 95 96 @Override stopPnoScan()97 public boolean stopPnoScan() { 98 Log.i(TAG, "stopPnoScan"); 99 // TODO: Mock it when we have a use (test) case. 100 return false; 101 } 102 103 @Override abortScan()104 public void abortScan() { 105 Log.i(TAG, "abortScan"); 106 // TODO: Mock it when we have a use (test) case. 107 } 108 109 @Override getMaxSsidsPerScan()110 public int getMaxSsidsPerScan() { 111 Log.i(TAG, "getMaxSsidsPerScan"); 112 // TODO: Mock it when we have a use (test) case. 113 return 0; 114 } 115 } 116