summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2022-10-28 15:00:01 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-10-28 15:00:01 +0000
commitbb26732f6fe79100bcf648461d9104a97967666f (patch)
tree5a00b88738b136a424ca95134c4c44548be16ac0 /include
parente9af9d01692fcbc4f00f5d4b02fa3e44cde2c7a0 (diff)
parentb54ffb2a4b2504a39f333b683f83262a70206953 (diff)
Merge changes from topics "input-device-bluetooth-address", "notify-stylus-presence"
* changes: InputReader: Get Bluetooth address from InputDeviceIdentifier Determine the bluetooth address of an input device from its uniqueId Notify the policy when a stylus gesture starts
Diffstat (limited to 'include')
-rw-r--r--include/input/InputDevice.h3
-rw-r--r--include/input/PrintTools.h10
2 files changed, 10 insertions, 3 deletions
diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h
index ac9c5a5a6f..e911734407 100644
--- a/include/input/InputDevice.h
+++ b/include/input/InputDevice.h
@@ -58,6 +58,9 @@ struct InputDeviceIdentifier {
// reuse values that are not associated with an input anymore.
uint16_t nonce;
+ // The bluetooth address of the device, if known.
+ std::optional<std::string> bluetoothAddress;
+
/**
* Return InputDeviceIdentifier.name that has been adjusted as follows:
* - all characters besides alphanumerics, dash,
diff --git a/include/input/PrintTools.h b/include/input/PrintTools.h
index 55f730b287..e24344b3f1 100644
--- a/include/input/PrintTools.h
+++ b/include/input/PrintTools.h
@@ -24,16 +24,20 @@
namespace android {
template <typename T>
-std::string constToString(const T& v) {
+inline std::string constToString(const T& v) {
return std::to_string(v);
}
+inline std::string constToString(const std::string& s) {
+ return s;
+}
+
/**
* Convert an optional type to string.
*/
template <typename T>
-std::string toString(const std::optional<T>& optional,
- std::string (*toString)(const T&) = constToString) {
+inline std::string toString(const std::optional<T>& optional,
+ std::string (*toString)(const T&) = constToString) {
return optional ? toString(*optional) : "<not set>";
}