summaryrefslogtreecommitdiffstats
path: root/adb/transport.h
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-04-18 11:22:34 -0700
committerYabin Cui <yabinc@google.com>2016-04-18 11:22:34 -0700
commit7f27490e7f386401dc38287a67dcb8826e2260c5 (patch)
treea340d1bd23b99d7094135993c1e0897b1386fced /adb/transport.h
parentc2241b9c5dbff5028558e658286c242c050594f8 (diff)
downloadcore-7f27490e7f386401dc38287a67dcb8826e2260c5.tar.gz
core-7f27490e7f386401dc38287a67dcb8826e2260c5.tar.bz2
core-7f27490e7f386401dc38287a67dcb8826e2260c5.zip
Fix kick_transport test.
Fix broken kick_transport test, and make it not access atransport internal variables. Bug: 25935458 Change-Id: I91b4d32a222b2f369f801bbe3903acac9c8ea4f7
Diffstat (limited to 'adb/transport.h')
-rw-r--r--adb/transport.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/adb/transport.h b/adb/transport.h
index 5857249db..35d7b505d 100644
--- a/adb/transport.h
+++ b/adb/transport.h
@@ -60,7 +60,13 @@ public:
int (*read_from_remote)(apacket* p, atransport* t) = nullptr;
int (*write_to_remote)(apacket* p, atransport* t) = nullptr;
void (*close)(atransport* t) = nullptr;
- void (*kick)(atransport* t) = nullptr;
+ void SetKickFunction(void (*kick_func)(atransport*)) {
+ kick_func_ = kick_func;
+ }
+ bool IsKicked() {
+ return kicked_;
+ }
+ void Kick();
int fd = -1;
int transport_socket = -1;
@@ -82,7 +88,6 @@ public:
char* device = nullptr;
char* devpath = nullptr;
int adb_port = -1; // Use for emulators (local transport)
- bool kicked = false;
void* key = nullptr;
unsigned char token[TOKEN_SIZE] = {};
@@ -123,6 +128,9 @@ public:
bool MatchesTarget(const std::string& target) const;
private:
+ bool kicked_ = false;
+ void (*kick_func_)(atransport*) = nullptr;
+
// A set of features transmitted in the banner with the initial connection.
// This is stored in the banner as 'features=feature0,feature1,etc'.
FeatureSet features_;