Modify HAL for Aware suspension mode

- Add an event to know the device is suspended
- More status code
- Add pub_sub_id in the datapath request to build the relationship

Bug: 247913151
Test: build
Change-Id: I77733c1bca821b77fdab7ed1ed03c1e54c9373b2
diff --git a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
index edca1d5..8a61a9c 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
@@ -28,7 +28,7 @@
 import android.hardware.wifi.NanPairingConfirmInd;
 import android.hardware.wifi.NanPairingRequestInd;
 import android.hardware.wifi.NanStatus;
-
+import android.hardware.wifi.NanSuspensionModeChangeInd;
 /**
  * NAN Response and Asynchronous Event Callbacks.
  *
@@ -141,6 +141,13 @@
     void eventTransmitFollowup(in char id, in NanStatus status);
 
     /**
+     * Callback indicating that device suspension mode status change
+     *
+     * @param event NanSuspensionModeChangeInd containing event details.
+     */
+    void eventSuspensionModeChanged(in NanSuspensionModeChangeInd event);
+
+    /**
      * Callback invoked in response to a capability request
      * |IWifiNanIface.getCapabilitiesRequest|.
      *
diff --git a/wifi/aidl/android/hardware/wifi/NanInitiateDataPathRequest.aidl b/wifi/aidl/android/hardware/wifi/NanInitiateDataPathRequest.aidl
index 264a873..2f25329 100644
--- a/wifi/aidl/android/hardware/wifi/NanInitiateDataPathRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanInitiateDataPathRequest.aidl
@@ -69,4 +69,9 @@
      * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites
      */
     byte[] serviceNameOutOfBand;
+    /**
+     * ID of an active publish or subscribe discovery session.
+     * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
+     */
+    byte discoverySessionId;
 }
diff --git a/wifi/aidl/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl b/wifi/aidl/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl
index 6960e71..e543b7b 100644
--- a/wifi/aidl/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl
@@ -58,4 +58,9 @@
      * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites
      */
     byte[] serviceNameOutOfBand;
+    /**
+     * ID of an active publish or subscribe discovery session.
+     * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
+     */
+    byte discoverySessionId;
 }
diff --git a/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl b/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl
index d609797..6706839 100644
--- a/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl
@@ -79,8 +79,16 @@
      * If the bootstrapping id is invalid
      */
     INVALID_BOOTSTRAPPING_ID = 14,
-    /**
-     * If the system is not in a valid state for the given request.
+    /*
+     * If same request is received again
      */
-    INVALID_STATE = 15
+    REDUNDANT_REQUEST = 15,
+    /*
+     * If current request is not supported
+     */
+    NOT_SUPPORTED = 16,
+    /*
+     * If no Wifi Aware connection is active
+     */
+    NO_CONNECTION = 17
 }
diff --git a/wifi/aidl/android/hardware/wifi/NanSuspensionModeChangeInd.aidl b/wifi/aidl/android/hardware/wifi/NanSuspensionModeChangeInd.aidl
new file mode 100644
index 0000000..afabe8c
--- /dev/null
+++ b/wifi/aidl/android/hardware/wifi/NanSuspensionModeChangeInd.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2023 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;
+
+/**
+ * Event indication that the device entered or exited the suspension mode
+ */
+@VintfStability
+parcelable NanSuspensionModeChangeInd {
+    /**
+     * Indication whether the device has entered or existed the NAN suspension mode(deep sleep)
+     */
+    boolean isSuspended;
+}