Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65ddb154 authored by John Reck's avatar John Reck
Browse files

Fix FrameMetricsObserver crash

Bug: 30587465

Someday maybe the technology will exist to
allow sharing a simple constant between
Java and C++, but today is not that day.

Change-Id: I17694746cb8712058133cd5ea10c47b9909f740b
parent c1b853eb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ public final class FrameMetrics {
        int SWAP_BUFFERS = 12;
        int FRAME_COMPLETED = 13;

        int FRAME_STATS_COUNT = 14; // must always be last
        int FRAME_STATS_COUNT = 16; // must always be last
    }

    /*
+3 −0
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ static_assert((sizeof(FrameInfoNames)/sizeof(FrameInfoNames[0]))
        == static_cast<int>(FrameInfoIndex::NumIndexes),
        "size mismatch: FrameInfoNames doesn't match the enum!");

static_assert(static_cast<int>(FrameInfoIndex::NumIndexes) == 16,
        "Must update value in FrameMetrics.java#FRAME_STATS_COUNT (and here)");

void FrameInfo::importUiThreadInfo(int64_t* info) {
    memcpy(mFrameInfo, info, UI_THREAD_FRAME_INFO_SIZE * sizeof(int64_t));
}
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ enum class FrameInfoIndex {
    QueueBufferDuration,

    // Must be the last value!
    // Also must be kept in sync with FrameMetrics.java#FRAME_STATS_COUNT
    NumIndexes
};