statusbar.cc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. #pragma once
  2. #include "uart/ProtocolSender.h"
  3. #include "utils/TimeHelper.h"
  4. #include "net/NetManager.h"
  5. #include "net/DhcpClient.h"
  6. #include "manager/LanguageManager.h"
  7. #include "core/utilities.h"
  8. #include "core/sip_config.h"
  9. #include "edge/call_log.h"
  10. #include "edge/popup_service.h"
  11. #include "base/base.hpp"
  12. #include "service/BusinessConfig.h"
  13. #include "net/tcp_client.h"
  14. #include <sys/reboot.h>
  15. #include <net/NetUtils.h>
  16. /*
  17. *此文件由GUI工具生成
  18. *文件功能:用于处理用户的逻辑相应代码
  19. *功能说明:
  20. *========================onButtonClick_XXXX
  21. 当页面中的按键按下后系统会调用对应的函数,XXX代表GUI工具里面的[标识]名称,
  22. 如Button1,当返回值为false的时候系统将不再处理这个按键,返回true的时候系统将会继续处理此按键。比如SYS_BACK.
  23. *========================onSlideWindowItemClick_XXXX(int index)
  24. 当页面中存在滑动窗口并且用户点击了滑动窗口的图标后系统会调用此函数,XXX代表GUI工具里面的[标识]名称,
  25. 如slideWindow1;index 代表按下图标的偏移值
  26. *========================onSeekBarChange_XXXX(int progress)
  27. 当页面中存在滑动条并且用户改变了进度后系统会调用此函数,XXX代表GUI工具里面的[标识]名称,
  28. 如SeekBar1;progress 代表当前的进度值
  29. *========================ogetListItemCount_XXXX()
  30. 当页面中存在滑动列表的时候,更新的时候系统会调用此接口获取列表的总数目,XXX代表GUI工具里面的[标识]名称,
  31. 如List1;返回值为当前列表的总条数
  32. *========================oobtainListItemData_XXXX(ZKListView::ZKListItem *pListItem, int index)
  33. 当页面中存在滑动列表的时候,更新的时候系统会调用此接口获取列表当前条目下的内容信息,XXX代表GUI工具里面的[标识]名称,
  34. 如List1;pListItem 是贴图中的单条目对象,index是列表总目的偏移量。具体见函数说明
  35. *========================常用接口===============
  36. *LOGD(...) 打印调试信息的接口
  37. *mTextXXX->setText("****") 在控件TextXXX上显示文字****
  38. *mButton1->setSelected(true); 将控件mButton1设置为选中模式,图片会切换成选中图片,按钮文字会切换为选中后的颜色
  39. *mSeekBar->setProgress(12) 在控件mSeekBar上将进度调整到12
  40. *mListView1->refreshListView() 让mListView1 重新刷新,当列表数据变化后调用
  41. *mDashbroadView1->setTargetAngle(120) 在控件mDashbroadView1上指针显示角度调整到120度
  42. */
  43. static bool networkConnect = false;
  44. static bool networkNowConnect = false;
  45. static bool tcpConnect = false;
  46. static bool tcpNowConnect = false;
  47. static bool sipConnect = true;
  48. static bool sipNowConnect = false;
  49. void statusLight() {
  50. if (!networkConnect) {
  51. lightControl("CALLLED", "200F");
  52. }
  53. else {
  54. if (!tcpConnect) {
  55. lightControl("CALLLED", "110F");
  56. }
  57. else {
  58. if (!sipConnect) {
  59. lightControl("CALLLED", "220F");
  60. }
  61. else {
  62. lightControl("CALLLED", "020F");
  63. }
  64. }
  65. }
  66. }
  67. #define ETHERNETMANAGER NETMANAGER->getEthernetManager()
  68. #define WIFIMANAGER NETMANAGER->getWifiManager()
  69. static net::DhcpClient _s_wifi_dhcp_client;
  70. static net::DhcpClient _s_eth_dhcp_client;
  71. static bool _start_wifi_dhcp_client() {
  72. // 静态ip模式不做处理
  73. if (!WIFIMANAGER->isAutoMode()) {
  74. return false;
  75. }
  76. if (!WIFIMANAGER->isConnected()) {
  77. return false;
  78. }
  79. char ip[32], gw[32];
  80. if (!WIFIMANAGER->getConfigureInfo(ip, NULL, gw, NULL, NULL)) {
  81. return false;
  82. }
  83. return _s_wifi_dhcp_client.start(ip, WIFIMANAGER->getMacAddr(), gw);
  84. }
  85. static void _stop_wifi_dhcp_client() {
  86. _s_wifi_dhcp_client.stop();
  87. }
  88. static bool _start_eth_dhcp_client() {
  89. // 静态ip模式不做处理
  90. if (!ETHERNETMANAGER->isAutoMode()) {
  91. LOGD("以太网静态");
  92. return false;
  93. }
  94. if (!ETHERNETMANAGER->isConnected()) {
  95. LOGD("以太网连接状态");
  96. return false;
  97. }
  98. char ip[32], gw[32];
  99. if (!ETHERNETMANAGER->getConfigureInfo(ip, NULL, gw, NULL, NULL)) {
  100. return false;
  101. }
  102. LOGD("正在重新请求dhcp");
  103. return _s_eth_dhcp_client.start(ip, ETHERNETMANAGER->getMacAddr(), gw);
  104. }
  105. static void _stop_eth_dhcp_client() {
  106. _s_eth_dhcp_client.stop();
  107. }
  108. static void _dhcp_lease_cb(dhcp_lease_type_e type, void *data) {
  109. LOGD("_dhcp_lease_cb type %d\n", type);
  110. switch (type) {
  111. case E_DHCP_LEASE_TYPE_SUCCESS:
  112. LOGD("DHCP连接成功");
  113. break;
  114. case E_DHCP_LEASE_TYPE_FAIL:
  115. LOGD("DHCP连接失败,重连");
  116. _start_eth_dhcp_client();
  117. break;
  118. case E_DHCP_LEASE_TYPE_TIMEOUT:
  119. // 续租超时,可以断开再重连尝试
  120. LOGD("DHCP连接超时,断开重连");
  121. _stop_eth_dhcp_client();
  122. _start_eth_dhcp_client();
  123. break;
  124. }
  125. }
  126. void NavibarSetPartName(const std::string& partName){
  127. mPartNamePtr->setText(partName);
  128. }
  129. static int netOffCount = 0; //断网计数,每秒+1
  130. static int netOffMax = 300; //断网300秒,则重启
  131. static bool isDataRefresh = false;
  132. static bool isRestartTime = false;
  133. static bool isServerTime = false;
  134. static bool isStorageTime = false;
  135. static void updateNetState(){
  136. if (netOffCount == 0) {
  137. mRestartTimeTextViewPtr->setText("");
  138. }
  139. else {
  140. int restartTime = netOffMax - netOffCount;
  141. string restartTimeStr = LANGUAGEMANAGER->getValue("RestartTime") + to_string(restartTime);
  142. mRestartTimeTextViewPtr->setText(restartTimeStr);
  143. }
  144. if (ETHERNETMANAGER->isConnected() || WIFIMANAGER->isConnected()){
  145. netOffCount = 0;
  146. if (isDataRefresh) {
  147. dataRefresh();
  148. isDataRefresh = false;
  149. }
  150. } else {
  151. if (isRestartTime) {
  152. netOffCount++;
  153. isDataRefresh = true;
  154. //5分钟仍然断网,则重启
  155. if (netOffCount > netOffMax){
  156. netOffCount = 0;
  157. // //重启
  158. // sync();
  159. // reboot(RB_AUTOBOOT);
  160. systemRestart();
  161. }
  162. }
  163. }
  164. ENetChannel channel = NETMANAGER->getConnChannel();
  165. switch (channel) {
  166. case E_NET_CHANNEL_ETHERNET:
  167. if (ETHERNETMANAGER->isConnected()) {
  168. mPainter1Ptr->setBackgroundColor(0xFF37C127);
  169. networkConnect = true;
  170. if (networkNowConnect != networkConnect) {
  171. networkNowConnect = networkConnect;
  172. statusLight();
  173. }
  174. }
  175. else {
  176. mPainter1Ptr->setBackgroundColor(0xFF949494);
  177. networkConnect = false;
  178. if (networkNowConnect != networkConnect) {
  179. networkNowConnect = networkConnect;
  180. statusLight();
  181. }
  182. }
  183. break;
  184. case E_NET_CHANNEL_WIFI:
  185. if (WIFIMANAGER->isConnected()) {
  186. mPainter1Ptr->setBackgroundColor(0xFF37C127);
  187. networkConnect = true;
  188. if (networkNowConnect != networkConnect) {
  189. networkNowConnect = networkConnect;
  190. statusLight();
  191. }
  192. }
  193. else {
  194. mPainter1Ptr->setBackgroundColor(0xFF949494);
  195. networkConnect = false;
  196. if (networkNowConnect != networkConnect) {
  197. networkNowConnect = networkConnect;
  198. statusLight();
  199. }
  200. }
  201. break;
  202. default:
  203. mPainter1Ptr->setBackgroundColor(0xFF949494);
  204. networkConnect = false;
  205. if (networkNowConnect != networkConnect) {
  206. networkNowConnect = networkConnect;
  207. statusLight();
  208. }
  209. break;
  210. }
  211. // EEthConnState connState = ETHERNETMANAGER->getConnState();
  212. // switch (connState){
  213. // case E_ETH_DISCONNECTED: // 以太网断开
  214. // mPainter1Ptr->setBackgroundColor(0xFF949494);
  215. // setRestartTimerRegistered(true);
  216. // break;
  217. // case E_ETH_CONNECTING: // 以太网连接中
  218. // mPainter1Ptr->setBackgroundColor(0xFF2F9DF1);
  219. // break;
  220. // case E_ETH_CONNECTED: // 以太网连接
  221. // mPainter1Ptr->setBackgroundColor(0xFF37C127);
  222. // setRestartTimerRegistered(false);
  223. // break;
  224. // case E_ETH_DISCONNECTING: // 以太网断开连接中
  225. // mPainter1Ptr->setBackgroundColor(0xFF949494);
  226. // setRestartTimerRegistered(true);
  227. // break;
  228. // case E_ETH_CONN_UNKNOWN: // 以太网未知
  229. // mPainter1Ptr->setBackgroundColor(0xFF949494);
  230. // setRestartTimerRegistered(true);
  231. // break;
  232. // }
  233. }
  234. void OnRegisterStateChanged(voip::Telephone* telephone, int code){
  235. code = GetTelephone()->GetRegistrationStatusCode();
  236. LOGD("SIP STATUS : %d", code);
  237. if (code == voip::SIP_STATUS_CODE_PROGRESS){
  238. //mTextViewRegPtr->setText("CONNECTING");
  239. mTextViewRegPtr->setBackgroundColor(0xFF2F9DF1);
  240. sipConnect = false;
  241. if (sipNowConnect != sipConnect) {
  242. sipNowConnect = sipConnect;
  243. statusLight();
  244. }
  245. }
  246. else if (code == voip::SIP_STATUS_CODE_OK){
  247. mTextViewRegPtr->setBackgroundColor(0xFF37C127);
  248. sipConnect = true;
  249. if (sipNowConnect != sipConnect) {
  250. sipNowConnect = sipConnect;
  251. statusLight();
  252. }
  253. }
  254. else {
  255. mTextViewRegPtr->setBackgroundColor(0xFF949494);
  256. sipConnect = false;
  257. if (sipNowConnect != sipConnect) {
  258. sipNowConnect = sipConnect;
  259. statusLight();
  260. }
  261. }
  262. }
  263. void tcpStatus(){
  264. if (TcpClient::instance()->connected()){
  265. mTextViewTCPPtr->setBackgroundColor(0xFF37C127);
  266. tcpConnect = true;
  267. if (tcpNowConnect != tcpConnect) {
  268. tcpNowConnect = tcpConnect;
  269. statusLight();
  270. }
  271. } else {
  272. mTextViewTCPPtr->setBackgroundColor(0xFF949494);
  273. tcpConnect = false;
  274. if (tcpNowConnect != tcpConnect) {
  275. tcpNowConnect = tcpConnect;
  276. statusLight();
  277. }
  278. }
  279. }
  280. int pingCount = 0;
  281. class PingThread: public Thread {
  282. public:
  283. /**
  284. * 线程创建成功后会调用该函数,可以在该函数中做一些初始化操作
  285. * return true 继续线程
  286. * false 退出线程
  287. */
  288. virtual bool readyToRun() {
  289. LOGD("Ping Thread 已经创建完成");
  290. return true;
  291. }
  292. /**
  293. * 线程循环函数
  294. *
  295. * return true 继续线程循环
  296. * false 推出线程
  297. */
  298. virtual bool threadLoop() {
  299. //为了方便观察,这里添加休眠500ms
  300. usleep(1 * 60 * 1000 * 1000);
  301. //检查是否有退出线程的请求,如果有,则返回false,立即退出线程
  302. if (exitPending()) {
  303. return false;
  304. }
  305. LOGD("Ping 线程循环函数");
  306. if (ETHERNETMANAGER->isAutoMode()) {
  307. string serverIp = StoragePreferences::getString(STORE_GATEWAY, serverIP);
  308. LOGD("===================> ping %s", serverIp.c_str());
  309. string pingStr = "ping " + serverIp + " -c 3";
  310. int result = system(pingStr.c_str());
  311. LOGD("===================> ping 服务器返回的结果: %d", result);
  312. if (result != 0) { // 如果不是0,就代表ping不通,需要重新请求dhcp
  313. LOGD("无法ping通服务器地址:%s", serverIp.c_str());
  314. pingCount += 1;
  315. LOGD("pingCount计数 == %d", pingCount);
  316. if (pingCount == 3) {
  317. NetUtils::dhcpExit();
  318. usleep(20 * 1000);
  319. NetUtils::enableIfc("eth0", false);
  320. usleep(100 * 1000);
  321. NetUtils::enableIfc("eth0", true);
  322. pingCount = 0;
  323. }
  324. }
  325. else {
  326. pingCount = 0;
  327. }
  328. }
  329. //返回真,继续下次线程循环
  330. return true;
  331. }
  332. };
  333. static PingThread ping_thread;
  334. void pingThreadExitPending() {
  335. bool result = ping_thread.isRunning();
  336. if (result) {
  337. ping_thread.requestExitAndWait();
  338. LOGD("ping_thread已关闭");
  339. }
  340. }
  341. bool getServerTime() {
  342. return isServerTime;
  343. }
  344. void setServerTime(bool _serverTime) {
  345. isServerTime = _serverTime;
  346. }
  347. int getTime(char* timeStr) {
  348. int hour, minute, second;// 定义时间的各个int临时变量。
  349. sscanf(timeStr, "%d:%d:%d", &hour, &minute, &second);
  350. int time = hour * 60 * 60 + minute * 60 + second;
  351. return time;
  352. }
  353. void isTimeScale(char* timeStr) {
  354. std::string dayTime = StoragePreferences::getString(STORE_DAY_START, "07:00:00");
  355. std::string nightTime = StoragePreferences::getString(STORE_NIGHT_START, "18:00:00");
  356. int day = getTime((char*) dayTime.data());
  357. int night = getTime((char*) nightTime.data());
  358. int now = getTime(timeStr);
  359. // bool isSleepTime = getSleepTimerRegistered();
  360. // if (day <= night) { // 在白天时间小于晚上时间的时候
  361. // if (day <= now && now <= night) { // 这个时候,时间处于白天
  362. // if (isSleepTime) { // isSleepTime就是定时任务开启,需要关闭
  363. // setSleepTimerRegistered(false); // 关闭息屏功能
  364. // LOGD("白天开始时间小于晚上开始时间,切换至白天");
  365. // }
  366. // }
  367. // else { // 这个时间处于晚上
  368. // if (!isSleepTime) { // isSleepTime就是定时任务关闭,需要开启
  369. // setSleepTimerRegistered(true); // 开启息屏功能
  370. // LOGD("白天开始时间小于晚上开始时间,切换至晚上");
  371. // }
  372. // }
  373. //
  374. // } else { // 这里是day > night时间的时候
  375. // if (night <= now && now < day) { // 这个其实是晚上时间
  376. // if (!isSleepTime) { // isSleepTime就是定时任务关闭,需要开启
  377. // setSleepTimerRegistered(true); // 开启息屏功能
  378. // LOGD("白天开始时间大于晚上开始时间,切换至晚上");
  379. // }
  380. // } else {
  381. // if (isSleepTime) { // isSleepTime就是定时任务开启,需要关闭
  382. // setSleepTimerRegistered(false); // 关闭息屏功能
  383. // LOGD("白天开始时间大于晚上开始时间,切换至白天");
  384. // }
  385. // }
  386. // }
  387. string restartTimeFront = "00:00:00";
  388. string restartTimeAfter = "07:00:00";
  389. int front = getTime((char*) restartTimeFront.data());
  390. int after = getTime((char*) restartTimeAfter.data());
  391. if (front <= now && now <= after) {
  392. isRestartTime = true;
  393. }
  394. else {
  395. isRestartTime = false;
  396. }
  397. }
  398. void setPartNameAndDateColor(uint32_t color) {
  399. mPartNamePtr->setTextColor(color);
  400. mDateViewPtr->setTextColor(color);
  401. }
  402. namespace {
  403. // 以太网状态监听
  404. class EthernetConnStateListener : public EthernetManager::IEthernetConnStateListener {
  405. public:
  406. virtual void handleEthernetConnState(EEthConnState state) {
  407. LOGD("[net] handleEthernetConnState state: %d\n", state);
  408. switch (state) {
  409. case E_ETH_CONNECTED:
  410. LOGD("以太网连接");
  411. _start_eth_dhcp_client();
  412. break;
  413. case E_ETH_DISCONNECTED:
  414. LOGD("以太网断开");
  415. _stop_eth_dhcp_client();
  416. break;
  417. default:
  418. break;
  419. }
  420. }
  421. };
  422. // wifi状态监听
  423. class WifiListener: public WifiManager::IWifiListener {
  424. public:
  425. virtual void handleWifiConnect(E_WIFI_CONNECT event, int args) {
  426. LOGD("[net] handleWifiConnect event: %d\n", event);
  427. switch (event) {
  428. case E_WIFI_CONNECT_CONNECTED:
  429. _start_wifi_dhcp_client();
  430. break;
  431. case E_WIFI_CONNECT_DISCONNECT:
  432. _stop_wifi_dhcp_client();
  433. break;
  434. default:
  435. break;
  436. }
  437. }
  438. };
  439. }
  440. /**
  441. * 注册定时器
  442. * 填充数组用于注册定时器
  443. * 注意:id不能重复
  444. */
  445. static S_ACTIVITY_TIMEER REGISTER_ACTIVITY_TIMER_TAB[] = {
  446. {1, 1000},
  447. {2, 5000}
  448. };
  449. static void updateUI_time() {
  450. if (!isStorageTime && !isServerTime) {
  451. int _serverTime = StoragePreferences::getInt(STORE_SERVER_TIME, 0);
  452. time_t timet = stoi(to_string(_serverTime));
  453. struct tm *t = gmtime(&timet);
  454. char pDate[25];
  455. sprintf(pDate,"%d-%02d-%02d %02d:%02d:%02d",
  456. 1900 + t->tm_year, 1+ t->tm_mon, t->tm_mday,
  457. t->tm_hour + 8,t->tm_min,t->tm_sec);
  458. LOGD("storage time : %s", pDate);
  459. TimeHelper::setDateTime(pDate);
  460. isStorageTime = true;
  461. }
  462. struct tm *t = TimeHelper::getDateTime();
  463. char timeStr[50];
  464. string day[] = {
  465. LANGUAGEMANAGER->getValue("Sunday"),
  466. LANGUAGEMANAGER->getValue("Monday"),
  467. LANGUAGEMANAGER->getValue("Tuesday"),
  468. LANGUAGEMANAGER->getValue("Wednesday"),
  469. LANGUAGEMANAGER->getValue("Thursday"),
  470. LANGUAGEMANAGER->getValue("Friday"),
  471. LANGUAGEMANAGER->getValue("Saturday")};
  472. string formatStr = "%s %d"+LANGUAGEMANAGER->getValue("Year")+"%02d"+LANGUAGEMANAGER->getValue("Month")+"%02d"+LANGUAGEMANAGER->getValue("Day")+" %02d:%02d:%02d";
  473. //string formatStr = "%s %d-%02d-%02d %02d:%02d:%02d";
  474. sprintf(timeStr, formatStr.c_str(), day[t->tm_wday].c_str(),1900 + t->tm_year, t->tm_mon + 1, t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
  475. mDateViewPtr->setText(timeStr); // 注意修改控件名称
  476. char timeStr2[50];
  477. string formatStr2 = "%02d:%02d:%02d";
  478. sprintf(timeStr2, formatStr2.c_str(), t->tm_hour,t->tm_min,t->tm_sec);
  479. isTimeScale(timeStr2);
  480. }
  481. static EthernetConnStateListener _s_eth_state_listener;
  482. static WifiListener _s_wifi_listener;
  483. /**
  484. * 当界面构造时触发
  485. */
  486. static void onUI_init(){
  487. //SIP
  488. GetTelephone()->AddRegisteredStateListener(OnRegisterStateChanged);
  489. mPartNamePtr->setText(StoragePreferences::getString(STORE_PARTNAME,""));
  490. updateUI_time();
  491. //网络判断
  492. updateNetState();
  493. tcpStatus();
  494. //Tips :添加 UI初始化的显示代码到这里,如:mText1Ptr->setText("123");
  495. ETHERNETMANAGER->addEthernetConnStateListener(&_s_eth_state_listener);
  496. WIFIMANAGER->addWifiListener(&_s_wifi_listener);
  497. _s_wifi_dhcp_client.set_lease_cb(_dhcp_lease_cb);
  498. _s_eth_dhcp_client.set_lease_cb(_dhcp_lease_cb);
  499. // 这里也检测网络是否连接上 (有可能启动前网络已经连接触发不到回调),启动dhcp租赁检测,之后都是根据网络的连接断开执行相应的操作
  500. _start_wifi_dhcp_client();
  501. _start_eth_dhcp_client();
  502. ping_thread.run("ping");
  503. }
  504. /*
  505. * 当界面完全退出时触发
  506. */
  507. static void onUI_quit() {
  508. GetTelephone()->RemoveRegisteredStateListener(OnRegisterStateChanged);
  509. }
  510. /**
  511. * 串口数据回调接口
  512. */
  513. static void onProtocolDataUpdate(const SProtocolData &data) {
  514. //串口数据回调接口
  515. }
  516. /**
  517. * 定时器触发函数
  518. * 不建议在此函数中写耗时操作,否则将影响UI刷新
  519. * 参数: id
  520. * 当前所触发定时器的id,与注册时的id相同
  521. * 返回值: true
  522. * 继续运行当前定时器
  523. * false
  524. * 停止运行当前定时器
  525. */
  526. static bool onUI_Timer(int id){
  527. switch (id) {
  528. case 1:
  529. updateUI_time();
  530. updateNetState();
  531. break;
  532. case 2:
  533. tcpStatus();
  534. break;
  535. default:
  536. break;
  537. }
  538. return true;
  539. }
  540. /**
  541. * 有新的触摸事件时触发
  542. * 参数:ev
  543. * 新的触摸事件
  544. * 返回值:true
  545. * 表示该触摸事件在此被拦截,系统不再将此触摸事件传递到控件上
  546. * false
  547. * 触摸事件将继续传递到控件上
  548. */
  549. static bool onstatusbarActivityTouchEvent(const MotionEvent &ev) {
  550. switch (ev.mActionStatus) {
  551. case MotionEvent::E_ACTION_DOWN://触摸按下
  552. //LOGD("时刻 = %ld 坐标 x = %d, y = %d", ev.mEventTime, ev.mX, ev.mY);
  553. break;
  554. case MotionEvent::E_ACTION_MOVE://触摸滑动
  555. break;
  556. case MotionEvent::E_ACTION_UP: //触摸抬起
  557. break;
  558. default:
  559. break;
  560. }
  561. return false;
  562. }