Convert CancelationOptions::Mode to an enum class.
C++11 offers better type-safety, we should use it.
Test: compiles
Change-Id: Ied8edcabf2c2a0c9f52c7077e45228c72134e330
diff --git a/services/inputflinger/dispatcher/InputState.cpp b/services/inputflinger/dispatcher/InputState.cpp
index 047c628..563868d 100644
--- a/services/inputflinger/dispatcher/InputState.cpp
+++ b/services/inputflinger/dispatcher/InputState.cpp
@@ -500,10 +500,10 @@
}
switch (options.mode) {
- case CancelationOptions::CANCEL_ALL_EVENTS:
- case CancelationOptions::CANCEL_NON_POINTER_EVENTS:
+ case CancelationOptions::Mode::CANCEL_ALL_EVENTS:
+ case CancelationOptions::Mode::CANCEL_NON_POINTER_EVENTS:
return true;
- case CancelationOptions::CANCEL_FALLBACK_EVENTS:
+ case CancelationOptions::Mode::CANCEL_FALLBACK_EVENTS:
return memento.flags & AKEY_EVENT_FLAG_FALLBACK;
default:
return false;
@@ -521,11 +521,11 @@
}
switch (options.mode) {
- case CancelationOptions::CANCEL_ALL_EVENTS:
+ case CancelationOptions::Mode::CANCEL_ALL_EVENTS:
return true;
- case CancelationOptions::CANCEL_POINTER_EVENTS:
+ case CancelationOptions::Mode::CANCEL_POINTER_EVENTS:
return memento.source & AINPUT_SOURCE_CLASS_POINTER;
- case CancelationOptions::CANCEL_NON_POINTER_EVENTS:
+ case CancelationOptions::Mode::CANCEL_NON_POINTER_EVENTS:
return !(memento.source & AINPUT_SOURCE_CLASS_POINTER);
default:
return false;