forked from SmartisanTech/Wrench
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadbnotificationthread.hpp
More file actions
38 lines (32 loc) · 917 Bytes
/
Copy pathadbnotificationthread.hpp
File metadata and controls
38 lines (32 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _ADBNOTIFICATIONTHREAD_H_
#define _ADBNOTIFICATIONTHREAD_H_
#include <QtCore/QThread>
#include <QTcpSocket>
#include <QTimer>
#include "adbclient.h"
class AdbNotificationThread : public QThread
{
Q_OBJECT
public:
AdbNotificationThread(QObject *parent = 0);
~AdbNotificationThread();
public slots:
void onAdbNotificationClicked(const QString&);
private slots:
void timeOut();
void onDisconnected();
void onNewNotification();
private:
QTimer *mConnectTimer;
QTcpSocket *notificationSocket;
QByteArray mLastJsonStr;
qint64 mLastTime;
signals:
void adbNotificationArrived(const QString& key, const QString& pkg,
const QString& title, const QString& text,
const QString& ticker);
void adbNotificationState(const QString&);
protected:
void run();
};
#endif /* _ADBNOTIFICATIONTHREAD_H_ */