[AChoreographer] Add const qualifiers for getFd().
Per API feedback the AChoreographer argument should be const.
Bug: 148954590
Test: builds
Change-Id: Ie95481992534b3f5f5c664709bff80b1c21f7d50
diff --git a/libs/gui/DisplayEventDispatcher.cpp b/libs/gui/DisplayEventDispatcher.cpp
index 8af1a1c..15f966d 100644
--- a/libs/gui/DisplayEventDispatcher.cpp
+++ b/libs/gui/DisplayEventDispatcher.cpp
@@ -104,7 +104,7 @@
mConfigChangeFlag = configChangeFlag;
}
-int DisplayEventDispatcher::getFd() {
+int DisplayEventDispatcher::getFd() const {
return mReceiver.getFd();
}
diff --git a/libs/gui/include/gui/DisplayEventDispatcher.h b/libs/gui/include/gui/DisplayEventDispatcher.h
index 679d572..fcdf6bf 100644
--- a/libs/gui/include/gui/DisplayEventDispatcher.h
+++ b/libs/gui/include/gui/DisplayEventDispatcher.h
@@ -32,7 +32,7 @@
void dispose();
status_t scheduleVsync();
void toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag);
- int getFd();
+ int getFd() const;
virtual int handleEvent(int receiveFd, int events, void* data);
protected:
diff --git a/libs/nativedisplay/AChoreographer.cpp b/libs/nativedisplay/AChoreographer.cpp
index 58fff8f..0f7e2fb 100644
--- a/libs/nativedisplay/AChoreographer.cpp
+++ b/libs/nativedisplay/AChoreographer.cpp
@@ -264,6 +264,11 @@
return reinterpret_cast<Choreographer*>(choreographer);
}
+static inline const Choreographer* AChoreographer_to_Choreographer(
+ const AChoreographer* choreographer) {
+ return reinterpret_cast<const Choreographer*>(choreographer);
+}
+
static inline AChoreographer* Choreographer_to_AChoreographer(Choreographer* choreographer) {
return reinterpret_cast<AChoreographer*>(choreographer);
}
@@ -321,7 +326,7 @@
delete AChoreographer_to_Choreographer(choreographer);
}
-int AChoreographer_getFd(AChoreographer* choreographer) {
+int AChoreographer_getFd(const AChoreographer* choreographer) {
return AChoreographer_to_Choreographer(choreographer)->getFd();
}
diff --git a/libs/nativedisplay/include/apex/choreographer.h b/libs/nativedisplay/include/apex/choreographer.h
index b17b497..683abc4 100644
--- a/libs/nativedisplay/include/apex/choreographer.h
+++ b/libs/nativedisplay/include/apex/choreographer.h
@@ -43,7 +43,7 @@
* events. One such way is registering the file descriptor to a Looper instance,
* although this is not a requirement.
*/
-int AChoreographer_getFd(AChoreographer* choreographer);
+int AChoreographer_getFd(const AChoreographer* choreographer);
/**
* Provides a callback to handle all pending events emitted by this