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

Commit 5e8f0e9a authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Add null check to work around async unregistration of receiver" into...

Merge "Add null check to work around async unregistration of receiver" into sc-v2-dev am: f9a8735e am: a972d712

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15317993

Change-Id: Ifcae6e8a13fbed2aa7853f1f2e423a6de5f92508
parents 54bc50bb a972d712
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1643,10 +1643,8 @@ public class NavigationBar implements View.OnAttachStateChangeListener,
    private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            // This receiver is unregistered when the view is detached, but on devices with multiple
            // displays, it can sometimes still receive an ACTION_SCREEN_ON/ACTION_SCREEN_OFF on
            // display switch, after it was detached, so this null check ensures no crash in that
            // scenario.
            // TODO(193941146): Currently unregistering a receiver through BroadcastDispatcher is
            // async, but we've already cleared the fields. Just return early in this case.
            if (mNavigationBarView == null) {
                return;
            }