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

Commit de5cc511 authored by Josh Tsuji's avatar Josh Tsuji
Browse files

Don't crash trying to unregister a receiver twice.

Fixes: 190597198
Test: atest SystemUITests
Change-Id: I04c8cca24f9823bab5244126052d31d1b3549c5f
parent 71f911e7
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -101,7 +101,12 @@ abstract public class SafetyWarningDialog extends SystemUIDialog

    @Override
    public void onDismiss(DialogInterface unused) {
        try {
            mContext.unregisterReceiver(mReceiver);
        } catch (IllegalArgumentException e) {
            // Don't crash if the receiver has already been unregistered.
            e.printStackTrace();
        }
        cleanUp();
    }