GraphicService::GetInstance()->PostGraphicEvent(std::bind(ACLConnectionSuss, *bdAddr));\r
\r
#ifdef SUPPORT_CAT1_HFP_AG_SERV\r
- SendMsgToUIService(EARPHONE_CONNECTED_TO_UI, 0, nullptr, 0);\r
\r
- uapi_dev_runtime_set_earphone_connect_stat(1);\r
- uapi_save_runtime_log(RUNTIME_LOG_BR_CONNECT_A2DP_HEADSET);\r
+ uapi_dev_runtime_set_earphone_connect_stat(1);\r
+ uapi_save_runtime_log(RUNTIME_LOG_BR_CONNECT_A2DP_HEADSET);\r
if(headset_Is_connect() == false)\r
do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CONNECT_AG, nullptr, 0);\r
\r
PhoneAudioManagerSetDeviceConnState(OUT_BLUETOOTH_A2DP, AUDIO_DEVICE_DISCONNECTED);\r
GraphicService::GetInstance()->PostGraphicEvent(std::bind(ACLConnectionFail, *bdAddr));\r
\r
- #ifdef SUPPORT_BLE_SERVICE\r
- // SendMsgToUIService(EARPHONE_DISCONNECTED_TO_UI, 0, nullptr, 0);\r
- #endif\r
-\r
uapi_save_runtime_log(RUNTIME_LOG_BR_DISCONNECT_A2DP_HEADSET);\r
/* 实验室测试耳机回连场景,用户根据需要调整策略 */\r
bool ret = gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE, 60); // start scan\r
namespace OHOS\r
{\r
\r
- REGIST_SLICE(VIEW_BLUETOOTH_EARPHONE, MainBluetoothView, BluetoothPresenter);\r
+ // REGIST_SLICE(VIEW_BLUETOOTH_EARPHONE, MainBluetoothView, BluetoothPresenter);\r
\r
static BluetoothPresenter *g_pBluetoothPresenter = nullptr;\r
\r
bool SetUpBlueToothToggleButton(void);\r
UIScrollView *BlueToothScrollView = nullptr;\r
UILabelExt *Title = nullptr;\r
- UILabelButtonExt *BlueToothEarPhoneButton = nullptr; // 蓝牙耳机按钮\r
UILabelButtonExt *TradionalBlueToothButton = nullptr; // 传统蓝牙按钮\r
UILabelButtonExt *BluetoothServiceOptionsButton = nullptr; // 蓝牙服务选项按钮\r
- UILabelExt *BlueToothEarPhoneLabel = nullptr; // 蓝牙耳机\r
UILabelExt *TradionalBlueToothLabel = nullptr; // 传统蓝牙\r
UILabelExt *BluetoothServiceOptionsLabel = nullptr; // 蓝牙服务选项\r
UILabelExt *AttentionLabel = nullptr;\r
\r
if (strcmp(view.GetViewId(), BLUETOOTHEARPHONEBUTTON) == 0)\r
{\r
- NativeAbility::GetInstance().EnterSlice(VIEW_BLUETOOTH_EARPHONE);\r
+ // NativeAbility::GetInstance().EnterSlice(VIEW_BLUETOOTH_EARPHONE);\r
}\r
else if (strcmp(view.GetViewId(), BLUETOOTHSERVICEOPTIONSBUTTON) == 0)\r
{\r
delete Title;\r
Title = nullptr;\r
}\r
- if (BlueToothEarPhoneButton != nullptr)\r
- {\r
- delete BlueToothEarPhoneButton;\r
- BlueToothEarPhoneButton = nullptr;\r
- }\r
if (TradionalBlueToothButton != nullptr)\r
{\r
delete TradionalBlueToothButton;\r
delete BluetoothServiceOptionsButton;\r
BluetoothServiceOptionsButton = nullptr;\r
}\r
- if (BlueToothEarPhoneLabel != nullptr)\r
- {\r
- delete BlueToothEarPhoneLabel;\r
- BlueToothEarPhoneLabel = nullptr;\r
- }\r
if (TradionalBlueToothLabel != nullptr)\r
{\r
delete TradionalBlueToothLabel;\r
.height = 35,\r
.fontSize = 30,\r
.lineHeigh = 35,\r
- .textId = STR_BLUETOOTH_HEADPHONES, /*蓝牙耳机*/\r
+ // .textId = STR_BLUETOOTH_HEADPHONES, /*蓝牙耳机*/\r
+ .textId = STR_TRADITIONAL_BLUETOOTH, /*传统蓝牙*/\r
.lineBreakMode = UILabel::LINE_BREAK_OSCILLATION,\r
};\r
- BlueToothEarPhoneLabel = SetClassicBlueToothViewLabel(labelconfig);\r
- if (nullptr == BlueToothEarPhoneLabel)\r
- {\r
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ClassicBlueToothView::BlueToothEarPhoneLabel is nullptr!");\r
- return false;\r
- }\r
- /* -------------------------------------------------------------------------- */\r
- labelconfig.top = 273;\r
- labelconfig.textId = STR_TRADITIONAL_BLUETOOTH; /*传统蓝牙*/\r
TradionalBlueToothLabel = SetClassicBlueToothViewLabel(labelconfig);\r
if (nullptr == TradionalBlueToothLabel)\r
{\r
return false;\r
}\r
/* -------------------------------------------------------------------------- */\r
- labelconfig.top = 393;\r
+ labelconfig.top = 273;\r
labelconfig.textId = STR_BLUETOOTH_SERVICE_OPTIONS; /*蓝牙服务选项*/\r
BluetoothServiceOptionsLabel = SetClassicBlueToothViewLabel(labelconfig);\r
if (nullptr == BluetoothServiceOptionsLabel)\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ClassicBlueToothView::AttentionLabel is nullptr!");\r
return false;\r
}\r
- AttentionLabel->SetPosition(53, 499, 360, 180); // 位置大小\r
+ int y = 0;\r
+ if (BluetoothServiceOptionsButton)\r
+ {\r
+ y = BluetoothServiceOptionsButton->GetY() + BluetoothServiceOptionsButton->GetHeight() + 39;\r
+ }\r
+ AttentionLabel->SetPosition(53, y, 360, 180); // 位置大小\r
AttentionLabel->SetStyle(STYLE_TEXT_FONT, 20); // 字体大小\r
AttentionLabel->SetStyle(STYLE_LINE_HEIGHT, 30); // 字体行高\r
//.text = "注:开启后10分钟没连接成功会自动关闭,因为传统蓝牙长时间打开会增加电耗,建议在有需要的时候使用(该功能主要用于电话拨打/通知、音乐控制/传输等)",\r
// 按钮初始化\r
bool ClassicBlueToothView::SetUpBlueToothButton(void)\r
{\r
- BlueToothEarPhoneButton = new UILabelButtonExt();\r
- if (BlueToothEarPhoneButton == nullptr)\r
- {\r
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " ClassicBlueToothView::BlueToothEarPhoneButton new fail!");\r
- return false;\r
- }\r
- BlueToothEarPhoneButton->SetPosition(43, 120, 380, 100);\r
- BlueToothEarPhoneButton->SetViewId(BLUETOOTHEARPHONEBUTTON);\r
- BlueToothEarPhoneButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);\r
- BlueToothEarPhoneButton->SetImagePosition(326, 37);\r
- BlueToothEarPhoneButton->SetImageSrc(PNG_SETTING_NEXT_IMAGE, PNG_SETTING_NEXT_IMAGE);\r
- BlueToothEarPhoneButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);\r
/* -------------------------------------------------------------------------- */\r
TradionalBlueToothButton = new UILabelButtonExt();\r
if (TradionalBlueToothButton == nullptr)\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " ClassicBlueToothView::TradionalBlueToothButton new fail!");\r
return false;\r
}\r
- TradionalBlueToothButton->SetPosition(43, 240, 380, 100);\r
+ TradionalBlueToothButton->SetPosition(43, 120, 380, 100);\r
TradionalBlueToothButton->SetViewId(TRADIONALBLUETOOTHBUTTON);\r
TradionalBlueToothButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);\r
TradionalBlueToothButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 16);\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " ClassicBlueToothView::BluetoothServiceOptionsButton new fail!");\r
return false;\r
}\r
- BluetoothServiceOptionsButton->SetPosition(43, 360, 380, 100);\r
+ BluetoothServiceOptionsButton->SetPosition(43, 240, 380, 100);\r
BluetoothServiceOptionsButton->SetViewId(BLUETOOTHSERVICEOPTIONSBUTTON);\r
BluetoothServiceOptionsButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);\r
BluetoothServiceOptionsButton->SetImagePosition(326, 37);\r
BluetoothServiceOptionsButton->SetImageSrc(PNG_SETTING_NEXT_IMAGE, PNG_SETTING_NEXT_IMAGE);\r
BluetoothServiceOptionsButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);\r
/* -------------------------------------------------------------------------- */\r
- BlueToothEarPhoneButton->SetOnClickListener(presenter_);\r
BluetoothServiceOptionsButton->SetOnClickListener(presenter_);\r
\r
return true;\r
TradionalBlueToothToggleButton = new UIToggleButton();\r
if (nullptr == TradionalBlueToothToggleButton)\r
{\r
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " ClassicBlueToothView::BlueToothEarPhoneButton new fail!");\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " ClassicBlueToothView::TradionalBlueToothToggleButton new fail!");\r
return false;\r
}\r
- TradionalBlueToothToggleButton->SetPosition(298, 265, 100, 50);\r
+ TradionalBlueToothToggleButton->SetPosition(298, 145, 100, 50);\r
TradionalBlueToothToggleButton->SetState(ConfigModel::GetInstance()->GetClassicBlueToothState());\r
TradionalBlueToothToggleButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);\r
TradionalBlueToothToggleButton->SetImages(PNG_TOGGLEBUTTON_ON_IMAGE, PNG_TOGGLEBUTTON_OFF_IMAGE);\r
return;\r
}\r
BlueToothScrollView->Add(Title);\r
- BlueToothScrollView->Add(BlueToothEarPhoneButton);\r
BlueToothScrollView->Add(TradionalBlueToothButton);\r
BlueToothScrollView->Add(BluetoothServiceOptionsButton);\r
- BlueToothScrollView->Add(BlueToothEarPhoneLabel);\r
BlueToothScrollView->Add(TradionalBlueToothLabel);\r
BlueToothScrollView->Add(BluetoothServiceOptionsLabel);\r
BlueToothScrollView->Add(AttentionLabel);\r
typedef enum : uint8_t
{
PHONECONNECTEDSTATUS_ID = 0,
- EARPHONECONNECTESTATUS_ID,
BLUETOOTHCONNECTEDSTATUS,
MAX_CONNECTEDSTATUS_ID,
} CONNECTEDSTATUS_ID;
UIViewGroup *ConnectedStatusViewInit(void);
UIButton *GetCloseButton();
void UpdatePhoneConnectedStatus(int status);
- void UpdateEarPhoneConnectedStatus(int status);
void UpdateBlueToothConnectedStatus(int status);
struct LabelConfig
UIImageView *background[MAX_CONNECTEDSTATUS_ID]{nullptr};
UIImageView *PhoneConnectedStatusImage{nullptr}; // 显示手机连接状态
- UIImageView *EarPhoneConnectedStatusImage{nullptr}; // 显示耳机连接状态
UIImageView *BluetoothConnectedStatusImage{nullptr}; // 显示蓝牙连接状态
UILabelExt *ConnectedStatusLabel[MAX_CONNECTEDSTATUS_ID]{nullptr};
/* ---------------------------------- 1.连接状态 ---------------------------------- */
public:
bool GetPhoneConnectedStatus(void);
- bool GetEarPhoneConnectedStatus(void);
bool GetBlueToothConnectedStatus(void);
void UpdatePhoneStatus(int status);
- void UpdateEarPhoneStatus(int status);
void UpdateBlueToothStatus(int status);
- void SetPhoneConnectedIsVisible(bool state);
private:
UIImageView *DropDownConnectedStatusImageViweInit(int16_t x, int16_t y, int16_t w, int16_t h);
{
static OHOS::ColorType connectedColor[MAX_CONNECTEDSTATUS_ID] = {
Color::GetColorFromRGBA(0xff, 0x8f, 0x00, 0xff),
- Color::GetColorFromRGBA(0x4f, 0xc3, 0x4c, 0xff),
Color::GetColorFromRGBA(0x01, 0x76, 0xff, 0xff),
};
static OHOS::ColorType disconnectedColor = Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff);
delete PhoneConnectedStatusImage;
PhoneConnectedStatusImage = nullptr;
- delete EarPhoneConnectedStatusImage;
- EarPhoneConnectedStatusImage = nullptr;
-
delete BluetoothConnectedStatusImage;
BluetoothConnectedStatusImage = nullptr;
bool ConnectedStatusView::initBackground(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ConnectedStatusView::initBackground");
- int background_position_x = 33;
+ int background_position_x = 97;
for (int i = 0; i < MAX_CONNECTEDSTATUS_ID; i++)
{
background[i] = new UIImageView();
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "background[%d] new fail!!", i);
return false;
}
- background[i]->SetPosition(background_position_x + i * 140, 113, 120, 200);
+ background[i]->SetPosition(background_position_x + i * 152, 113, 120, 200);
background[i]->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
background[i]->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
background[i]->SetStyle(STYLE_BORDER_RADIUS, 40);
}
StatusImageParams params = {
- .x = 63,
+ .x = 127,
.y = 135,
.width = 60,
.height = 60,
group->Add(PhoneConnectedStatusImage);
params = {
- .x = 203,
- .y = 135,
- .width = 60,
- .height = 60,
- .connectedImage = DROPDOWN_EARPHONESCONNECTED,
- .disconnectedImage = DROPDOWN_EARPHONESDISCONNECTED,
- .isConnected = pullUpDownView->GetEarPhoneConnectedStatus(),
- };
- EarPhoneConnectedStatusImage = InitStatusImage(params);
- group->Add(EarPhoneConnectedStatusImage);
-
- params = {
- .x = 343,
+ .x = 279,
.y = 135,
.width = 60,
.height = 60,
uint16_t deviceName[MAX_CONNECTEDSTATUS_ID] = {
STR_PHONE, // 手机
- STR_HEADSET, // 耳机
STR_BLUETOOTH, // 蓝牙
}; // 初始化设备名称数组
- int PhoneAndEarAndBluetooth_position_x = 53;
- int ConnectedStatusLabel_position_x = 59;
+ int PhoneAndEarAndBluetooth_position_x = 117;
+ int ConnectedStatusLabel_position_x = 123;
for (int i = 0; i < MAX_CONNECTEDSTATUS_ID; i++)
{
- LabelConfig titleConfig = {PhoneAndEarAndBluetooth_position_x + i * 140, 220, 80, 35, 30, 35, deviceName[i]};
+ LabelConfig titleConfig = {PhoneAndEarAndBluetooth_position_x + i * 152, 220, 80, 35, 30, 35, deviceName[i]};
PhoneAndEarAndBluetooth[i] = InitLabel(titleConfig);
group->Add(PhoneAndEarAndBluetooth[i]);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ConnectedStatusLabel[%d] new fail!!", i);
return false;
}
- ConnectedStatusLabel[i]->SetPosition(ConnectedStatusLabel_position_x + i * 140, 258, 70, 27);
+ ConnectedStatusLabel[i]->SetPosition(ConnectedStatusLabel_position_x + i * 152, 258, 70, 27);
ConnectedStatusLabel[i]->SetStyle(STYLE_TEXT_FONT, 23);
ConnectedStatusLabel[i]->SetStyle(STYLE_LINE_HEIGHT, 27);
ConnectedStatusLabel[i]->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
group->Add(ConnectedStatusLabel[i]);
}
UpdatePhoneConnectedStatus(pullUpDownView->GetPhoneConnectedStatus());
- UpdateEarPhoneConnectedStatus(pullUpDownView->GetEarPhoneConnectedStatus());
UpdateBlueToothConnectedStatus(pullUpDownView->GetBlueToothConnectedStatus());
return true;
updateConnectionStatus(params);
}
- // 更新蓝牙耳机连接状态
- void ConnectedStatusView::UpdateEarPhoneConnectedStatus(int status)
- {
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ConnectedStatusView::UpdateEarPhoneConnectedStatus");
-
- ConnectionStatusParams params = {
- .statusImage = EarPhoneConnectedStatusImage,
- .statusLabel = ConnectedStatusLabel[EARPHONECONNECTESTATUS_ID],
- .status = status,
- .connectedImage = DROPDOWN_EARPHONESCONNECTED,
- .disconnectedImage = DROPDOWN_EARPHONESDISCONNECTED,
- .connectedText = STR_CONNECTED,
- .disconnectedText = STR_DISCONNECTED,
- .connectedColor = connectedColor[EARPHONECONNECTESTATUS_ID],
- .disconnectedColor = disconnectedColor,
- };
-
- updateConnectionStatus(params);
- }
-
// 更新蓝牙连接状态
void ConnectedStatusView::UpdateBlueToothConnectedStatus(int status)
{
// 手机连接状态
static constexpr const char *DROPDOWN_PHONECONNECTED_IMAGE = "/user/res/dropdown/phone_connect.bin";
static constexpr const char *DROPDOWN_PHONEDISCONNECTED_IMAGE = "/user/res/dropdown/phone_disconnect.bin";
- // 耳机连接状态
- static constexpr const char *DROPDOWN_EARPHONESCONNECTED_IMAGE = "/user/res/dropdown/earphones_connect.bin";
- static constexpr const char *DROPDOWN_EARPHONESDISCONNECTED_IMAGE = "/user/res/dropdown/earphones_disconnect.bin";
// 蓝牙连接状态
static constexpr const char *DROPDOWN_BLUETOOTHCONNECTED_IMAGE = "/user/res/dropdown/bluetooth_connect.bin";
static constexpr const char *DROPDOWN_BLUETOOTHDISCONNECTED_IMAGE = "/user/res/dropdown/bluetooth_disconnect.bin";
bool PullUpDownView::GetPhoneConnectedStatus(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::GetPhoneConnectedStatus");
- // uint8_t ret = uapi_dev_runtime_get_ble_connect_stat();
- // WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "ble phone connect stat = %d", ret);
- // if (ret == 1)
- // return true;
- // else
- // return false;
return SettingModel::GetInstance().GetPhoneConnectStatus();
}
- // 获取蓝牙耳机连接状态
- bool PullUpDownView::GetEarPhoneConnectedStatus(void)
- {
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::GetEarPhoneConnectedStatus");
- // uint8_t ret = uapi_dev_runtime_get_earphone_connect_stat();
- // WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "earphone connect stat = %d", ret);
- // if (ret == 1)
- // return true;
- // else
- // return false;
-
- return SettingModel::GetInstance().GetEarPhoneConnectStatus();
- }
// 获取蓝牙连接状态
bool PullUpDownView::GetBlueToothConnectedStatus(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::GetBlueToothConnectedStatus");
- // uint8_t ret = uapi_dev_runtime_get_br_connect_stat();
- // WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "br connect stat = %d [0 no connect, 1 a2dp, 2 hfp, 3 both]", ret);
- // if (ret != 0)
- // return true;
- // else
- // return false;
return SettingModel::GetInstance().GetBlueToothConnectStatus();
}
- // 设置蓝牙连接状态是否显示
- void PullUpDownView::SetPhoneConnectedIsVisible(bool state)
- {
- if (connectedStatusBackgroundButton && showPhoneConnectedStatus && showEarPhoneConnectedStatus && showBluetoothConnectedStatus)
- {
- if (!state)
- {
- connectedStatusBackgroundButton->SetPosition(153, 10, 160, 50);
- int x = connectedStatusBackgroundButton->GetX();
- int y = connectedStatusBackgroundButton->GetY();
- showPhoneConnectedStatus->SetVisible(true);
- showEarPhoneConnectedStatus->SetPosition(x + 68, y + 13);
- showBluetoothConnectedStatus->SetPosition(x + 110, y + 13);
- }
- else
- {
- connectedStatusBackgroundButton->SetPosition(178, 10, 110, 50);
- int x = connectedStatusBackgroundButton->GetX();
- int y = connectedStatusBackgroundButton->GetY();
- showPhoneConnectedStatus->SetVisible(false);
- showEarPhoneConnectedStatus->SetPosition(x + 22, y + 13);
- showBluetoothConnectedStatus->SetPosition(showEarPhoneConnectedStatus->GetX() + showEarPhoneConnectedStatus->GetWidth() + 18, y + 13);
- }
- connectedStatusBackgroundButton->Invalidate();
- showPhoneConnectedStatus->Invalidate();
- showEarPhoneConnectedStatus->Invalidate();
- showBluetoothConnectedStatus->Invalidate();
- }
- }
-
// 更新手机连接状态
void PullUpDownView::UpdatePhoneStatus(int status)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showPhoneConnectedStatus nullptr");
return;
}
- // showPhoneConnectedStatus->SetSrc(status ? DROPDOWN_PHONECONNECTED_IMAGE : DROPDOWN_PHONEDISCONNECTED_IMAGE);
- // showPhoneConnectedStatus->Invalidate();
if (status)
showPhoneConnectedStatus->SetSrc(DROPDOWN_PHONECONNECTED_IMAGE);
else
showPhoneConnectedStatus->SetSrc(DROPDOWN_PHONEDISCONNECTED_IMAGE);
- SetPhoneConnectedIsVisible(status);
-
if (GetConnectedStatusView() != nullptr)
GetConnectedStatusView()->UpdatePhoneConnectedStatus(status);
return;
}
- // 更新蓝牙耳机连接状态
- void PullUpDownView::UpdateEarPhoneStatus(int status)
- {
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::UpdateEarPhoneStatus");
- if (showEarPhoneConnectedStatus == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showEarPhoneConnectedStatus nullptr");
- return;
- }
- showEarPhoneConnectedStatus->SetSrc(status ? DROPDOWN_EARPHONESCONNECTED_IMAGE : DROPDOWN_EARPHONESDISCONNECTED_IMAGE);
- showEarPhoneConnectedStatus->Invalidate();
-
- if (GetConnectedStatusView() != nullptr)
- GetConnectedStatusView()->UpdateEarPhoneConnectedStatus(status);
-
- return;
- }
// 更新蓝牙连接状态
void PullUpDownView::UpdateBlueToothStatus(int status)
{
return;
}
}
- connectedStatusBackgroundButton->SetPosition(153, 10, 160, 50);
+ connectedStatusBackgroundButton->SetPosition(178, 10, 110, 50);
connectedStatusBackgroundButton->SetViewId(CONNECTEDSTATUSBACKGROUNDBUTTON);
connectedStatusBackgroundButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
connectedStatusBackgroundButton->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
return;
}
}
- /* -------------------------------- 显示耳机连接状态 -------------------------------- */
- if (showEarPhoneConnectedStatus == nullptr)
- {
- showEarPhoneConnectedStatus = DropDownConnectedStatusImageViweInit(x + 68, y + 13, 24, 24);
- if (showEarPhoneConnectedStatus == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showEarPhoneConnectedStatus new fail");
- return;
- }
- }
/* -------------------------------- 显示蓝牙连接状态 -------------------------------- */
if (showBluetoothConnectedStatus == nullptr)
{
- showBluetoothConnectedStatus = DropDownConnectedStatusImageViweInit(x + 110, y + 13, 24, 24);
+ showBluetoothConnectedStatus = DropDownConnectedStatusImageViweInit(x + 68, y + 13, 24, 24);
if (showBluetoothConnectedStatus == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showBluetoothConnectedStatus new fail");
}
/* -------------------------------------------------------------------------- */
UpdatePhoneStatus(GetPhoneConnectedStatus());
- UpdateEarPhoneStatus(GetEarPhoneConnectedStatus());
UpdateBlueToothStatus(GetBlueToothConnectedStatus());
/* -------------------------------------------------------------------------- */
group[DROPDOWNVIEW]->Add(connectedStatusBackgroundButton);
group[DROPDOWNVIEW]->Add(showPhoneConnectedStatus);
- group[DROPDOWNVIEW]->Add(showEarPhoneConnectedStatus);
group[DROPDOWNVIEW]->Add(showBluetoothConnectedStatus);
}
delete showPhoneConnectedStatus;
showPhoneConnectedStatus = nullptr;
}
- if (showEarPhoneConnectedStatus != nullptr)
- {
- delete showEarPhoneConnectedStatus;
- showEarPhoneConnectedStatus = nullptr;
- }
if (showBluetoothConnectedStatus != nullptr)
{
delete showBluetoothConnectedStatus;
}
else if (strcmp(view.GetViewId(), "callingheadset") == 0)
{
- NativeAbility::GetInstance().EnterSlice(VIEW_BLUETOOTH_EARPHONE);
+ // NativeAbility::GetInstance().EnterSlice(VIEW_BLUETOOTH_EARPHONE);
}
// #endif
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bluetoothHeadsetLableButton new fail!!");\r
return false;\r
}\r
+ bluetoothHeadsetLableButton->SetVisible(false);\r
\r
return true;\r
}\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bluetoothHeadsetLabel new fail!!");\r
return false;\r
}\r
+ bluetoothHeadsetLabel->SetVisible(false);\r
/* ---------------------- bluetoothHeadsetConnectState ---------------------- */\r
labelConfig.top = 413;\r
labelConfig.fontSize = 23;\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bluetoothHeadsetConnectState new fail!!");\r
return false;\r
}\r
+ bluetoothHeadsetConnectState->SetVisible(false);\r
return true;\r
}\r
\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phoneImage LoadPlayerImage fail");\r
return false;\r
}\r
+ bluetoothHeadsetImage->SetVisible(false);\r
return true;\r
}\r
\r
return nullptr;\r
}\r
\r
- UpdateBluetoothHeadsetConnectLabel();\r
- UpdateBluetoothHeadSetViewIsVisible();\r
+ // UpdateBluetoothHeadsetConnectLabel();\r
+ // UpdateBluetoothHeadSetViewIsVisible();\r
/* ----------------------------------- Add ---------------------------------- */\r
\r
scrollView->Add(titleLabel);\r
MusicSourceLabelSetText(STR_WATCH_MUSIC); /*手表音乐*/\r
SetMusicPlayerButtonIsTouchable(false);\r
}\r
- if (musicPlayerSourceView)\r
- {\r
- musicPlayerSourceView->UpdateBluetoothHeadSetViewIsVisible();\r
- }\r
+ // if (musicPlayerSourceView)\r
+ // {\r
+ // musicPlayerSourceView->UpdateBluetoothHeadSetViewIsVisible();\r
+ // }\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UpdatePlayerView over!!");\r
}\r
\r
// 更新耳机连接状态
void SettingModel::UpdateEarPhoneConnectStatus(bool status)
{
+ /*屏蔽蓝牙耳机*/
+ #if 0
earphoneConnectStatus = status;
if (PullUpDownView::GetInstance() != nullptr)
{
{
MusicPlayerSourceView::GetInstance()->UpdateBluetoothHeadsetConnectLabel();
}
+ #endif
}
// 更新蓝牙连接状态