Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67f6c1b7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "wifi: add new status code for unsupported cases"

parents 52861d4c 4d9f1eed
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.hardware.wifi.supplicant@1.4;

import @1.2::ISupplicantP2pIface;
import @1.0::SupplicantStatus;

/**
 * Interface exposed by the supplicant for each P2P mode network
+0 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.hardware.wifi.supplicant@1.4;

import @1.0::SupplicantStatus;
import ISupplicantStaIfaceCallback;
import @1.3::ISupplicantStaIface;

+0 −1
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package android.hardware.wifi.supplicant@1.4;

import @1.3::ISupplicantStaNetwork;
import @1.4::ISupplicantStaNetworkCallback;
import @1.0::SupplicantStatus;

/**
 * Interface exposed by the supplicant for each station mode network
+21 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.hardware.wifi.supplicant@1.4;

import @1.0::SupplicantStatusCode;
import @1.3::ConnectionCapabilities;

/**
@@ -50,3 +51,23 @@ struct ConnectionCapabilities {
     */
    LegacyMode legacyMode;
};

/**
 * Enum values indicating the status of any supplicant operation.
 */
enum SupplicantStatusCode : @1.0::SupplicantStatusCode {
    FAILURE_UNSUPPORTED,
};

/**
 * Generic structure to return the status of any supplicant operation.
 */
struct SupplicantStatus {
  SupplicantStatusCode code;
  /**
   * A vendor specific error message to provide more information beyond the
   * status code.
   * This will be used for debbuging purposes only.
   */
  string debugMessage;
};
+13 −8
Original line number Diff line number Diff line
@@ -33,6 +33,11 @@ using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
using ::android::hardware::wifi::supplicant::V1_4::ISupplicantP2pIface;

using SupplicantStatusV1_4 =
    ::android::hardware::wifi::supplicant::V1_4::SupplicantStatus;
using SupplicantStatusCodeV1_4 =
    ::android::hardware::wifi::supplicant::V1_4::SupplicantStatusCode;

class SupplicantP2pIfaceHidlTest : public SupplicantHidlTestBaseV1_4 {
   public:
    virtual void SetUp() override {
@@ -50,18 +55,18 @@ class SupplicantP2pIfaceHidlTest : public SupplicantHidlTestBaseV1_4 {
 * SetGetEdmg
 */
TEST_P(SupplicantP2pIfaceHidlTest, SetGetEdmg) {
    p2p_iface_->setEdmg(true, [&](const SupplicantStatus& status) {
        EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
    p2p_iface_->setEdmg(true, [&](const SupplicantStatusV1_4& status) {
        EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
    });
    p2p_iface_->getEdmg([&](const SupplicantStatus& status, bool enable) {
        EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
    p2p_iface_->getEdmg([&](const SupplicantStatusV1_4& status, bool enable) {
        EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
        EXPECT_EQ(true, enable);
    });
    p2p_iface_->setEdmg(false, [&](const SupplicantStatus& status) {
        EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
    p2p_iface_->setEdmg(false, [&](const SupplicantStatusV1_4& status) {
        EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
    });
    p2p_iface_->getEdmg([&](const SupplicantStatus& status, bool enable) {
        EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
    p2p_iface_->getEdmg([&](const SupplicantStatusV1_4& status, bool enable) {
        EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
        EXPECT_EQ(false, enable);
    });
}
Loading