Define Wifi Offload HAL HIDL interface
This interface defines the interaction of the Wifi framework with the
new HAL module that will offload disconnected PNO scans when screen is
off. For details of the overall design, refer to this document:
https://docs.google.com/a/google.com/document/d/13OmqquTnRXTRnyWbtfpc1Ib7YY411EwjNW3njzJ5KyM/edit?usp=sharing
Cherry pick from 7ac4a32e6eca71fcf1a86991654af747d38928ad
Bug: 32842314
Change-Id: I01e1952458d58b9233f18fc0450491fc7c48e6e1
Test: Unit tests, Mannual Wifi turn on
diff --git a/wifi/offload/1.0/IOffload.hal b/wifi/offload/1.0/IOffload.hal
new file mode 100644
index 0000000..7ad902c
--- /dev/null
+++ b/wifi/offload/1.0/IOffload.hal
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.offload@1.0;
+
+import IOffloadCallback;
+
+interface IOffload {
+ /**
+ * Configure the offload module to perform scans and filter results
+ * Scans must not be triggered due to configuration of the module.
+ *
+ * @param ScanParam paramters for scanning
+ * @param ScanFilter settings to filter scan result
+ * @return boolean status indicating success (true) when configuration
+ * is applied or failure (false) for invalid configuration
+ */
+ @entry
+ @callflow(next={"setEventCallback", "subscribeScanResults"})
+ configureScans(ScanParam param, ScanFilter filter);
+
+ /**
+ * Get scan statistics
+ *
+ * @return ScanStats statistics of scans performed
+ */
+ @exit
+ @callflow(next={"subscribeScanResults", "unsubscribeScanResults", "getScanStats"})
+ getScanStats() generates (ScanStats scanStats);
+
+ /**
+ * Subscribe to asynchronous scan events sent by offload module. This enables
+ * offload scans to be performed as per scan parameters, filtering the scan
+ * results based on configured scan filter and delivering the results after
+ * at least delayMs milliseconds from this call. If the client is already
+ * subscribed to the scan results, a call to this API must be a no-op.
+ *
+ * @param delayMs an integer expressing the minimum delay in mS after
+ * subscribing when scan results must be delivered to the client
+ */
+ @callflow(next={"unsubscribeScanResults", "getScanStats"})
+ subscribeScanResults(uint32_t delayMs);
+
+ /**
+ * Unsubscribe to scan events sent by the offload module, hence disabling scans.
+ * If the client is already unsubscribed, a call to this API will be a no-op.
+ */
+ @exit
+ @callflow(next={"*"})
+ unsubscribeScanResults();
+
+ /**
+ * Setup the HIDL interface for reporting asynchronous scan events. A maximum
+ * of one callback interface is supported. Only one callback must be registered
+ * at any given time. If two consecutive calls are made with different callback
+ * interface objects, the latest one must be used to deliver events to client.
+ *
+ * @param cb An instance of the |IOffloadCallback| HIDL interface object
+ */
+ @entry
+ @callflow(next={"subscribeScanStats", "configureScans"})
+ setEventCallback(IOffloadCallback cb);
+};