Add an abstracted interface around android-specific handling

* This makes it easier to use the same kind of interface to manage other kinds
  of devices.
This commit is contained in:
baldurk
2019-07-31 17:51:13 +01:00
parent 06f2e61b8f
commit e2704fa2eb
34 changed files with 2340 additions and 1492 deletions
+5 -6
View File
@@ -93,6 +93,9 @@ public:
)");
void SetLastCapturePath(const rdcstr &path);
DOCUMENT(
"The :class:`DeviceProtocolController` for this host, or ``None`` if no protocol is in use");
IDeviceProtocolController *Protocol() const { return m_protocol; }
DOCUMENT(R"(
Returns the name to display for this host in the UI, either :meth:`FriendlyName` if it is valid, or
:meth:`Hostname` if not.
@@ -102,12 +105,6 @@ Returns the name to display for this host in the UI, either :meth:`FriendlyName`
rdcstr friendlyName = FriendlyName();
return !friendlyName.isEmpty() ? friendlyName : m_hostname;
}
DOCUMENT("Returns ``True`` if this host represents a connected ADB (Android) device.");
bool IsADB() const
{
return m_hostname.count() > 4 && m_hostname[0] == 'a' && m_hostname[1] == 'd' &&
m_hostname[2] == 'b' && m_hostname[3] == ':';
}
DOCUMENT("Returns ``True`` if this host represents the special localhost device.");
bool IsLocalhost() const { return m_hostname == "localhost"; }
DOCUMENT("Returns ``True`` if this host represents a valid remote host.");
@@ -117,6 +114,8 @@ private:
// are created with it
rdcstr m_hostname;
IDeviceProtocolController *m_protocol = NULL;
// self-deleting shared and locked data store
RemoteHostData *m_data = NULL;