how does surfaceflinger in Android 13 handle Refresh and Invalidate events without the mEventQueue
Asked
Active
Viewed 86 times
0
-
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Oct 21 '22 at 23:03
1 Answers
0
I just met the same question, so I checked the code. I found the mEventQueue is replaced by the mScheduler.
As you can see, the Scheduler now extends from MessageQueue:
Scheduler::Scheduler(ICompositor& compositor, ISchedulerCallback& callback, FeatureFlags features)
: impl::MessageQueue(compositor), mFeatures(features), mSchedulerCallback(callback) {}
Therefore, the Scheduler can do the same thing. For example, The function SurfaceFlinger::run()
which will be executed when SurfaceFlinger create has changed to be:
// AOSP 13
void SurfaceFlinger::run() {
mScheduler->run();
}
void Scheduler::run() {
while (true) {
waitMessage();
}
}
// before
void SurfaceFlinger::run() {
while (true) {
mEventQueue->waitMessage();
}
}