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

Skip to content
Commit 3756b091 authored by Satoshi Sanno's avatar Satoshi Sanno Committed by Amin Shaikh
Browse files

Unregister BroadcastReceiver of SystemUIDialog when it is dismissed

Symptom:
The number of registered BroadcastReceiver increases each time
SystemUIDialog is shown.
This is a leak of BroadcastReceiver.

Root cause:
SystemUIDialog#registerDismissListener(Dialog dialog) registers
a BroadcastReceiver.
But it never unregisters the BroadcastReceiver.
It had been unregistered when the dialog was dismissed previously.
But the unregistration process seems to have been erased by mistake
at refactoring.

Solution:
The unregistration process is added to registerDismissListener() again.
It sets the dialog's OnDismissListener to unregister the
BroadcastReceiver when the dialog is dismissed.

And, SystemUIDialog unregisters the BroadcastReceiver without using
registerDismissListener() to make its setOnDismissListener() available
to clients.

Bug: 134916873
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/SystemUIDialogTest.java
Change-Id: Ic41ac46997362ce585819e660c398b47e6685eaf
parent fcd34bb8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment