Skip to content

Commit f1111e1

Browse files
author
shuide chen
committed
Fix AIBinder_setMinSchedulerPolicy failed to set sched policy
b/318477176 the first param of: AIBinder_setMinSchedulerPolicy(mAidlComposerCallback->asBinder().get(), SCHED_FIFO, 2); constructs a temprary SpAIBinder object, it destructed after this function called. and destroyed the `BBinder` object. got this log printted: 01-03 06:04:25.884 3774 3774 W surfaceflinger: Binder 0xf3b821dc destroyed after setMinSchedulerPolicy before being parceled. This CL can fix this issue, and the scheduler works as expected. Change-Id: I8fcfb0103d1faa773132d8ac4cba04428055fb85 Signed-off-by: shuide chen <shuide.chen@amlogic.com>
1 parent 325c1e1 commit f1111e1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,9 @@ void AidlComposer::registerCallback(HWC2::ComposerCallback& callback) {
325325
}
326326

327327
mAidlComposerCallback = ndk::SharedRefBase::make<AidlIComposerCallbackWrapper>(callback);
328-
AIBinder_setMinSchedulerPolicy(mAidlComposerCallback->asBinder().get(), SCHED_FIFO, 2);
328+
329+
ndk::SpAIBinder binder = mAidlComposerCallback->asBinder();
330+
AIBinder_setMinSchedulerPolicy(binder.get(), SCHED_FIFO, 2);
329331

330332
const auto status = mAidlComposerClient->registerCallback(mAidlComposerCallback);
331333
if (!status.isOk()) {

0 commit comments

Comments
 (0)