Loading wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ interface IWifiChip { void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag); void setMloMode(in android.hardware.wifi.IWifiChip.ChipMloMode mode); @PropagateAllowBlocking android.hardware.wifi.IWifiApIface createApOrBridgedApIface(in android.hardware.wifi.IfaceConcurrencyType iface, in android.hardware.wifi.common.OuiKeyedData[] vendorData); void setVoipMode(in android.hardware.wifi.IWifiChip.VoipMode mode); const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF; @Backing(type="int") @VintfStability enum FeatureSetMask { Loading Loading @@ -162,6 +163,11 @@ interface IWifiChip { NAN_INSTANT_MODE = (1 << 2) /* 4 */, } @Backing(type="int") @VintfStability enum VoipMode { OFF = 0, VOICE = 1, } @Backing(type="int") @VintfStability enum ChannelCategoryMask { INDOOR_CHANNEL = (1 << 0) /* 1 */, DFS_CHANNEL = (1 << 1) /* 2 */, Loading wifi/aidl/android/hardware/wifi/IWifiChip.aidl +29 −0 Original line number Diff line number Diff line Loading @@ -384,6 +384,16 @@ interface IWifiChip { NAN_INSTANT_MODE = 1 << 2, } /** * This enum represents the different VoIP mode that can be set through |setVoipMode|. */ @VintfStability @Backing(type="int") enum VoipMode { OFF = 0, VOICE = 1, } /** * Configure the Chip. * This may NOT be called to reconfigure a chip due to an internal Loading Loading @@ -1173,4 +1183,23 @@ interface IWifiChip { @PropagateAllowBlocking IWifiApIface createApOrBridgedApIface( in IfaceConcurrencyType iface, in OuiKeyedData[] vendorData); /** * API to set the wifi VoIP mode. * * The VoIP mode is a hint to the HAL to enable or disable Wi-Fi VoIP * optimization. The optimization should be enabled if the mode is NOT set to |OFF|. * Furthermore, HAL should implement relevant optimization techniques based on the * current operational mode. * * Note: Wi-Fi VoIP optimization may trade-off power against Wi-Fi * performance but it provides better voice quility. * * @param mode Voip mode as defined by the enum |VoipMode| * @throws ServiceSpecificException with one of the following values: * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, * |WifiStatusCode.ERROR_INVALID_ARGS|, * |WifiStatusCode.ERROR_UNKNOWN| */ void setVoipMode(in VoipMode mode); } wifi/aidl/default/wifi_chip.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <android-base/unique_fd.h> #include <cutils/properties.h> #include <fcntl.h> #include <hardware_legacy/wifi_hal.h> #include <net/if.h> #include <sys/stat.h> #include <sys/sysmacros.h> Loading Loading @@ -605,6 +606,11 @@ ndk::ScopedAStatus WifiChip::setMloMode(const ChipMloMode in_mode) { &WifiChip::setMloModeInternal, in_mode); } ndk::ScopedAStatus WifiChip::setVoipMode(const VoipMode in_mode) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, &WifiChip::setVoipModeInternal, in_mode); } void WifiChip::invalidateAndRemoveAllIfaces() { invalidateAndClearBridgedApAll(); invalidateAndClearAll(ap_ifaces_); Loading Loading @@ -1913,6 +1919,23 @@ ndk::ScopedAStatus WifiChip::setMloModeInternal(const WifiChip::ChipMloMode in_m return createWifiStatusFromLegacyError(legacy_hal_.lock()->setMloMode(mode)); } ndk::ScopedAStatus WifiChip::setVoipModeInternal(const WifiChip::VoipMode in_mode) { const auto ifname = getFirstActiveWlanIfaceName(); wifi_voip_mode mode; switch (in_mode) { case WifiChip::VoipMode::VOICE: mode = wifi_voip_mode::WIFI_VOIP_MODE_ON; break; case WifiChip::VoipMode::OFF: mode = wifi_voip_mode::WIFI_VOIP_MODE_OFF; break; default: PLOG(ERROR) << "Error: invalid mode: " << toString(in_mode); return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } return createWifiStatusFromLegacyError(legacy_hal_.lock()->setVoipMode(ifname, mode)); } } // namespace wifi } // namespace hardware } // namespace android Loading wifi/aidl/default/wifi_chip.h +2 −0 Original line number Diff line number Diff line Loading @@ -158,6 +158,7 @@ class WifiChip : public BnWifiChip { int32_t in_channelCategoryEnableFlag) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; ndk::ScopedAStatus setMloMode(const ChipMloMode in_mode) override; ndk::ScopedAStatus setVoipMode(const VoipMode in_mode) override; private: void invalidateAndRemoveAllIfaces(); Loading Loading @@ -269,6 +270,7 @@ class WifiChip : public BnWifiChip { getSupportedRadioCombinationsInternal(); std::pair<WifiChipCapabilities, ndk::ScopedAStatus> getWifiChipCapabilitiesInternal(); ndk::ScopedAStatus setMloModeInternal(const ChipMloMode in_mode); ndk::ScopedAStatus setVoipModeInternal(const VoipMode in_mode); void retrieveDynamicIfaceCombination(); void setWeakPtr(std::weak_ptr<WifiChip> ptr); Loading Loading
wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ interface IWifiChip { void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag); void setMloMode(in android.hardware.wifi.IWifiChip.ChipMloMode mode); @PropagateAllowBlocking android.hardware.wifi.IWifiApIface createApOrBridgedApIface(in android.hardware.wifi.IfaceConcurrencyType iface, in android.hardware.wifi.common.OuiKeyedData[] vendorData); void setVoipMode(in android.hardware.wifi.IWifiChip.VoipMode mode); const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF; @Backing(type="int") @VintfStability enum FeatureSetMask { Loading Loading @@ -162,6 +163,11 @@ interface IWifiChip { NAN_INSTANT_MODE = (1 << 2) /* 4 */, } @Backing(type="int") @VintfStability enum VoipMode { OFF = 0, VOICE = 1, } @Backing(type="int") @VintfStability enum ChannelCategoryMask { INDOOR_CHANNEL = (1 << 0) /* 1 */, DFS_CHANNEL = (1 << 1) /* 2 */, Loading
wifi/aidl/android/hardware/wifi/IWifiChip.aidl +29 −0 Original line number Diff line number Diff line Loading @@ -384,6 +384,16 @@ interface IWifiChip { NAN_INSTANT_MODE = 1 << 2, } /** * This enum represents the different VoIP mode that can be set through |setVoipMode|. */ @VintfStability @Backing(type="int") enum VoipMode { OFF = 0, VOICE = 1, } /** * Configure the Chip. * This may NOT be called to reconfigure a chip due to an internal Loading Loading @@ -1173,4 +1183,23 @@ interface IWifiChip { @PropagateAllowBlocking IWifiApIface createApOrBridgedApIface( in IfaceConcurrencyType iface, in OuiKeyedData[] vendorData); /** * API to set the wifi VoIP mode. * * The VoIP mode is a hint to the HAL to enable or disable Wi-Fi VoIP * optimization. The optimization should be enabled if the mode is NOT set to |OFF|. * Furthermore, HAL should implement relevant optimization techniques based on the * current operational mode. * * Note: Wi-Fi VoIP optimization may trade-off power against Wi-Fi * performance but it provides better voice quility. * * @param mode Voip mode as defined by the enum |VoipMode| * @throws ServiceSpecificException with one of the following values: * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, * |WifiStatusCode.ERROR_INVALID_ARGS|, * |WifiStatusCode.ERROR_UNKNOWN| */ void setVoipMode(in VoipMode mode); }
wifi/aidl/default/wifi_chip.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <android-base/unique_fd.h> #include <cutils/properties.h> #include <fcntl.h> #include <hardware_legacy/wifi_hal.h> #include <net/if.h> #include <sys/stat.h> #include <sys/sysmacros.h> Loading Loading @@ -605,6 +606,11 @@ ndk::ScopedAStatus WifiChip::setMloMode(const ChipMloMode in_mode) { &WifiChip::setMloModeInternal, in_mode); } ndk::ScopedAStatus WifiChip::setVoipMode(const VoipMode in_mode) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, &WifiChip::setVoipModeInternal, in_mode); } void WifiChip::invalidateAndRemoveAllIfaces() { invalidateAndClearBridgedApAll(); invalidateAndClearAll(ap_ifaces_); Loading Loading @@ -1913,6 +1919,23 @@ ndk::ScopedAStatus WifiChip::setMloModeInternal(const WifiChip::ChipMloMode in_m return createWifiStatusFromLegacyError(legacy_hal_.lock()->setMloMode(mode)); } ndk::ScopedAStatus WifiChip::setVoipModeInternal(const WifiChip::VoipMode in_mode) { const auto ifname = getFirstActiveWlanIfaceName(); wifi_voip_mode mode; switch (in_mode) { case WifiChip::VoipMode::VOICE: mode = wifi_voip_mode::WIFI_VOIP_MODE_ON; break; case WifiChip::VoipMode::OFF: mode = wifi_voip_mode::WIFI_VOIP_MODE_OFF; break; default: PLOG(ERROR) << "Error: invalid mode: " << toString(in_mode); return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } return createWifiStatusFromLegacyError(legacy_hal_.lock()->setVoipMode(ifname, mode)); } } // namespace wifi } // namespace hardware } // namespace android Loading
wifi/aidl/default/wifi_chip.h +2 −0 Original line number Diff line number Diff line Loading @@ -158,6 +158,7 @@ class WifiChip : public BnWifiChip { int32_t in_channelCategoryEnableFlag) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; ndk::ScopedAStatus setMloMode(const ChipMloMode in_mode) override; ndk::ScopedAStatus setVoipMode(const VoipMode in_mode) override; private: void invalidateAndRemoveAllIfaces(); Loading Loading @@ -269,6 +270,7 @@ class WifiChip : public BnWifiChip { getSupportedRadioCombinationsInternal(); std::pair<WifiChipCapabilities, ndk::ScopedAStatus> getWifiChipCapabilitiesInternal(); ndk::ScopedAStatus setMloModeInternal(const ChipMloMode in_mode); ndk::ScopedAStatus setVoipModeInternal(const VoipMode in_mode); void retrieveDynamicIfaceCombination(); void setWeakPtr(std::weak_ptr<WifiChip> ptr); Loading