Disable Wifi Projection + Fix assistant hang/missing audio. (#2)
* Bonus: Fix assistant hang/missing audio. * Add new wireless projection config section. * Add check box to disable/enable wireless projection. Checking this box causes the service factory to skip the bluetooth and wifi services.
This commit is contained in:
parent
5da1376565
commit
a5cdf161ad
@ -110,6 +110,8 @@ public:
|
|||||||
void setBluetoothAdapterType(BluetoothAdapterType value) override;
|
void setBluetoothAdapterType(BluetoothAdapterType value) override;
|
||||||
std::string getBluetoothRemoteAdapterAddress() const override;
|
std::string getBluetoothRemoteAdapterAddress() const override;
|
||||||
void setBluetoothRemoteAdapterAddress(const std::string& value) override;
|
void setBluetoothRemoteAdapterAddress(const std::string& value) override;
|
||||||
|
bool getWirelessProjectionEnabled() const override;
|
||||||
|
void setWirelessProjectionEnabled(bool value) override;
|
||||||
|
|
||||||
bool musicAudioChannelEnabled() const override;
|
bool musicAudioChannelEnabled() const override;
|
||||||
void setMusicAudioChannelEnabled(bool value) override;
|
void setMusicAudioChannelEnabled(bool value) override;
|
||||||
@ -152,6 +154,7 @@ private:
|
|||||||
bool enablePlayerControl_;
|
bool enablePlayerControl_;
|
||||||
ButtonCodes buttonCodes_;
|
ButtonCodes buttonCodes_;
|
||||||
BluetoothAdapterType bluetoothAdapterType_;
|
BluetoothAdapterType bluetoothAdapterType_;
|
||||||
|
bool wirelessProjectionEnabled_;
|
||||||
std::string bluetoothRemoteAdapterAddress_;
|
std::string bluetoothRemoteAdapterAddress_;
|
||||||
bool musicAudioChannelEnabled_;
|
bool musicAudioChannelEnabled_;
|
||||||
bool speechAudiochannelEnabled_;
|
bool speechAudiochannelEnabled_;
|
||||||
@ -194,6 +197,7 @@ private:
|
|||||||
|
|
||||||
static const std::string cBluetoothAdapterTypeKey;
|
static const std::string cBluetoothAdapterTypeKey;
|
||||||
static const std::string cBluetoothRemoteAdapterAddressKey;
|
static const std::string cBluetoothRemoteAdapterAddressKey;
|
||||||
|
static const std::string cBluetoothWirelessProjectionEnabledKey;
|
||||||
|
|
||||||
static const std::string cInputEnableTouchscreenKey;
|
static const std::string cInputEnableTouchscreenKey;
|
||||||
static const std::string cInputEnablePlayerControlKey;
|
static const std::string cInputEnablePlayerControlKey;
|
||||||
|
@ -114,6 +114,8 @@ public:
|
|||||||
virtual void setBluetoothAdapterType(BluetoothAdapterType value) = 0;
|
virtual void setBluetoothAdapterType(BluetoothAdapterType value) = 0;
|
||||||
virtual std::string getBluetoothRemoteAdapterAddress() const = 0;
|
virtual std::string getBluetoothRemoteAdapterAddress() const = 0;
|
||||||
virtual void setBluetoothRemoteAdapterAddress(const std::string& value) = 0;
|
virtual void setBluetoothRemoteAdapterAddress(const std::string& value) = 0;
|
||||||
|
virtual bool getWirelessProjectionEnabled() const = 0;
|
||||||
|
virtual void setWirelessProjectionEnabled(bool value) = 0;
|
||||||
|
|
||||||
virtual bool musicAudioChannelEnabled() const = 0;
|
virtual bool musicAudioChannelEnabled() const = 0;
|
||||||
virtual void setMusicAudioChannelEnabled(bool value) = 0;
|
virtual void setMusicAudioChannelEnabled(bool value) = 0;
|
||||||
|
@ -66,6 +66,7 @@ const std::string Configuration::cAudioOutputBackendType = "Audio.OutputBackendT
|
|||||||
|
|
||||||
const std::string Configuration::cBluetoothAdapterTypeKey = "Bluetooth.AdapterType";
|
const std::string Configuration::cBluetoothAdapterTypeKey = "Bluetooth.AdapterType";
|
||||||
const std::string Configuration::cBluetoothRemoteAdapterAddressKey = "Bluetooth.RemoteAdapterAddress";
|
const std::string Configuration::cBluetoothRemoteAdapterAddressKey = "Bluetooth.RemoteAdapterAddress";
|
||||||
|
const std::string Configuration::cBluetoothWirelessProjectionEnabledKey = "Bluetooth.WirelessProjectionEnabled";
|
||||||
|
|
||||||
const std::string Configuration::cInputEnableTouchscreenKey = "Input.EnableTouchscreen";
|
const std::string Configuration::cInputEnableTouchscreenKey = "Input.EnableTouchscreen";
|
||||||
const std::string Configuration::cInputEnablePlayerControlKey = "Input.EnablePlayerControl";
|
const std::string Configuration::cInputEnablePlayerControlKey = "Input.EnablePlayerControl";
|
||||||
@ -137,6 +138,8 @@ void Configuration::load()
|
|||||||
bluetoothAdapterType_ = static_cast<BluetoothAdapterType>(iniConfig.get<uint32_t>(cBluetoothAdapterTypeKey,
|
bluetoothAdapterType_ = static_cast<BluetoothAdapterType>(iniConfig.get<uint32_t>(cBluetoothAdapterTypeKey,
|
||||||
static_cast<uint32_t>(BluetoothAdapterType::NONE)));
|
static_cast<uint32_t>(BluetoothAdapterType::NONE)));
|
||||||
|
|
||||||
|
wirelessProjectionEnabled_ = iniConfig.get<bool>(cBluetoothWirelessProjectionEnabledKey, true);
|
||||||
|
|
||||||
bluetoothRemoteAdapterAddress_ = iniConfig.get<std::string>(cBluetoothRemoteAdapterAddressKey, "");
|
bluetoothRemoteAdapterAddress_ = iniConfig.get<std::string>(cBluetoothRemoteAdapterAddressKey, "");
|
||||||
musicAudioChannelEnabled_ = iniConfig.get<bool>(cAudioMusicAudioChannelEnabled, true);
|
musicAudioChannelEnabled_ = iniConfig.get<bool>(cAudioMusicAudioChannelEnabled, true);
|
||||||
speechAudiochannelEnabled_ = iniConfig.get<bool>(cAudioSpeechAudioChannelEnabled, true);
|
speechAudiochannelEnabled_ = iniConfig.get<bool>(cAudioSpeechAudioChannelEnabled, true);
|
||||||
@ -222,6 +225,7 @@ void Configuration::save()
|
|||||||
|
|
||||||
iniConfig.put<uint32_t>(cBluetoothAdapterTypeKey, static_cast<uint32_t>(bluetoothAdapterType_));
|
iniConfig.put<uint32_t>(cBluetoothAdapterTypeKey, static_cast<uint32_t>(bluetoothAdapterType_));
|
||||||
iniConfig.put<std::string>(cBluetoothRemoteAdapterAddressKey, bluetoothRemoteAdapterAddress_);
|
iniConfig.put<std::string>(cBluetoothRemoteAdapterAddressKey, bluetoothRemoteAdapterAddress_);
|
||||||
|
iniConfig.put<bool>(cBluetoothWirelessProjectionEnabledKey, wirelessProjectionEnabled_);
|
||||||
|
|
||||||
iniConfig.put<bool>(cAudioMusicAudioChannelEnabled, musicAudioChannelEnabled_);
|
iniConfig.put<bool>(cAudioMusicAudioChannelEnabled, musicAudioChannelEnabled_);
|
||||||
iniConfig.put<bool>(cAudioSpeechAudioChannelEnabled, speechAudiochannelEnabled_);
|
iniConfig.put<bool>(cAudioSpeechAudioChannelEnabled, speechAudiochannelEnabled_);
|
||||||
@ -528,6 +532,14 @@ void Configuration::setBluetoothRemoteAdapterAddress(const std::string& value)
|
|||||||
bluetoothRemoteAdapterAddress_ = value;
|
bluetoothRemoteAdapterAddress_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Configuration::getWirelessProjectionEnabled() const {
|
||||||
|
return wirelessProjectionEnabled_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Configuration::setWirelessProjectionEnabled(bool value) {
|
||||||
|
wirelessProjectionEnabled_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
bool Configuration::musicAudioChannelEnabled() const
|
bool Configuration::musicAudioChannelEnabled() const
|
||||||
{
|
{
|
||||||
return musicAudioChannelEnabled_;
|
return musicAudioChannelEnabled_;
|
||||||
|
@ -249,7 +249,8 @@ void AndroidAutoEntity::onPingRequest(const aasdk::proto::messages::PingRequest&
|
|||||||
|
|
||||||
void AndroidAutoEntity::onVoiceSessionRequest(const aasdk::proto::messages::VoiceSessionRequest& request)
|
void AndroidAutoEntity::onVoiceSessionRequest(const aasdk::proto::messages::VoiceSessionRequest& request)
|
||||||
{
|
{
|
||||||
OPENAUTO_LOG(error) << "[AndroidAutoEntity] voice session request not implemented";
|
OPENAUTO_LOG(info) << "[AndroidAutoEntity] onVoiceSessionRequest()";
|
||||||
|
controlServiceChannel_->receive(this->shared_from_this());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidAutoEntity::onShutdownResponse(const aasdk::proto::messages::ShutdownResponse&)
|
void AndroidAutoEntity::onShutdownResponse(const aasdk::proto::messages::ShutdownResponse&)
|
||||||
|
@ -66,9 +66,12 @@ ServiceList ServiceFactory::create(aasdk::messenger::IMessenger::Pointer messeng
|
|||||||
this->createAudioServices(serviceList, messenger);
|
this->createAudioServices(serviceList, messenger);
|
||||||
serviceList.emplace_back(std::make_shared<SensorService>(ioService_, messenger));
|
serviceList.emplace_back(std::make_shared<SensorService>(ioService_, messenger));
|
||||||
serviceList.emplace_back(this->createVideoService(messenger));
|
serviceList.emplace_back(this->createVideoService(messenger));
|
||||||
serviceList.emplace_back(this->createBluetoothService(messenger));
|
if (configuration_->getWirelessProjectionEnabled())
|
||||||
|
{
|
||||||
|
serviceList.emplace_back(this->createBluetoothService(messenger));
|
||||||
|
serviceList.emplace_back(std::make_shared<WifiService>(ioService_, messenger, configuration_));
|
||||||
|
}
|
||||||
serviceList.emplace_back(this->createInputService(messenger));
|
serviceList.emplace_back(this->createInputService(messenger));
|
||||||
serviceList.emplace_back(std::make_shared<WifiService>(ioService_, messenger, configuration_));
|
|
||||||
|
|
||||||
return serviceList;
|
return serviceList;
|
||||||
}
|
}
|
||||||
|
@ -250,6 +250,12 @@ void SettingsWindow::onSave()
|
|||||||
configuration_->setBluetoothAdapterType(configuration::BluetoothAdapterType::REMOTE);
|
configuration_->setBluetoothAdapterType(configuration::BluetoothAdapterType::REMOTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ui_->disableProjectionButton->isChecked()) {
|
||||||
|
configuration_->setWirelessProjectionEnabled(false);
|
||||||
|
} else {
|
||||||
|
configuration_->setWirelessProjectionEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
configuration_->setBluetoothRemoteAdapterAddress(ui_->lineEditExternalBluetoothAdapterAddress->text().toStdString());
|
configuration_->setBluetoothRemoteAdapterAddress(ui_->lineEditExternalBluetoothAdapterAddress->text().toStdString());
|
||||||
|
|
||||||
configuration_->setMusicAudioChannelEnabled(ui_->checkBoxMusicAudioChannel->isChecked());
|
configuration_->setMusicAudioChannelEnabled(ui_->checkBoxMusicAudioChannel->isChecked());
|
||||||
@ -524,6 +530,7 @@ void SettingsWindow::load()
|
|||||||
ui_->radioButtonUseExternalBluetoothAdapter->setChecked(configuration_->getBluetoothAdapterType() == configuration::BluetoothAdapterType::REMOTE);
|
ui_->radioButtonUseExternalBluetoothAdapter->setChecked(configuration_->getBluetoothAdapterType() == configuration::BluetoothAdapterType::REMOTE);
|
||||||
ui_->lineEditExternalBluetoothAdapterAddress->setEnabled(configuration_->getBluetoothAdapterType() == configuration::BluetoothAdapterType::REMOTE);
|
ui_->lineEditExternalBluetoothAdapterAddress->setEnabled(configuration_->getBluetoothAdapterType() == configuration::BluetoothAdapterType::REMOTE);
|
||||||
ui_->lineEditExternalBluetoothAdapterAddress->setText(QString::fromStdString(configuration_->getBluetoothRemoteAdapterAddress()));
|
ui_->lineEditExternalBluetoothAdapterAddress->setText(QString::fromStdString(configuration_->getBluetoothRemoteAdapterAddress()));
|
||||||
|
ui_->disableProjectionButton->setChecked(!configuration_->getWirelessProjectionEnabled());
|
||||||
|
|
||||||
ui_->checkBoxMusicAudioChannel->setChecked(configuration_->musicAudioChannelEnabled());
|
ui_->checkBoxMusicAudioChannel->setChecked(configuration_->musicAudioChannelEnabled());
|
||||||
ui_->checkBoxSpeechAudioChannel->setChecked(configuration_->speechAudioChannelEnabled());
|
ui_->checkBoxSpeechAudioChannel->setChecked(configuration_->speechAudioChannelEnabled());
|
||||||
|
@ -2979,6 +2979,49 @@ outline: none;</string>
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupWirelessProjection">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="cursor">
|
||||||
|
<cursorShape>ArrowCursor</cursorShape>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Wireless Projection</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="groupWirelessProjection_layout" stretch="0">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="disableProjectionButton">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable Wireless Projection</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="horizontalWidget" native="true">
|
<widget class="QWidget" name="horizontalWidget" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user