frameworks/base: make the ANativeWindow query() method const
query() does not modify the object's data, so it needs to be a const method
Change-Id: I67c40a3c865461e6f1cc2193fd2d74286ff6ac8f
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index 44d9b4b..812bd6a 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -536,9 +536,9 @@
return self->queueBuffer(buffer);
}
-int Surface::query(ANativeWindow* window,
+int Surface::query(const ANativeWindow* window,
int what, int* value) {
- Surface* self = getSelf(window);
+ const Surface* self = getSelf(window);
return self->query(what, value);
}
@@ -697,7 +697,7 @@
return err;
}
-int Surface::query(int what, int* value)
+int Surface::query(int what, int* value) const
{
switch (what) {
case NATIVE_WINDOW_WIDTH: