SF: clean up casting around histogram reporting
Takes advantage of the new binder Uint64Vector send/receive
capabilites to clean up a messy cast in the display histogram
functionality.
Fixes: 120504999
Test: boot
Test: libgui_test --gtest_filter="DisplayedContent*"
Change-Id: Ie8fe724d4d81999777e6ce1e8a610f55e0070d37
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index f1fefcc..5cf05ae 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -675,23 +675,19 @@
return result;
}
- result = reply.readInt64Vector(
- reinterpret_cast<std::vector<int64_t>*>(&outStats->component_0_sample));
+ result = reply.readUint64Vector(&outStats->component_0_sample);
if (result != NO_ERROR) {
return result;
}
- result = reply.readInt64Vector(
- reinterpret_cast<std::vector<int64_t>*>(&outStats->component_1_sample));
+ result = reply.readUint64Vector(&outStats->component_1_sample);
if (result != NO_ERROR) {
return result;
}
- result = reply.readInt64Vector(
- reinterpret_cast<std::vector<int64_t>*>(&outStats->component_2_sample));
+ result = reply.readUint64Vector(&outStats->component_2_sample);
if (result != NO_ERROR) {
return result;
}
- result = reply.readInt64Vector(
- reinterpret_cast<std::vector<int64_t>*>(&outStats->component_3_sample));
+ result = reply.readUint64Vector(&outStats->component_3_sample);
return result;
}
};
@@ -1121,14 +1117,10 @@
result = getDisplayedContentSample(display, maxFrames, timestamp, &stats);
if (result == NO_ERROR) {
reply->writeUint64(stats.numFrames);
- reply->writeInt64Vector(
- *reinterpret_cast<std::vector<int64_t>*>(&stats.component_0_sample));
- reply->writeInt64Vector(
- *reinterpret_cast<std::vector<int64_t>*>(&stats.component_1_sample));
- reply->writeInt64Vector(
- *reinterpret_cast<std::vector<int64_t>*>(&stats.component_2_sample));
- reply->writeInt64Vector(
- *reinterpret_cast<std::vector<int64_t>*>(&stats.component_3_sample));
+ reply->writeUint64Vector(stats.component_0_sample);
+ reply->writeUint64Vector(stats.component_1_sample);
+ reply->writeUint64Vector(stats.component_2_sample);
+ reply->writeUint64Vector(stats.component_3_sample);
}
return result;
}