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

Commit 72922c8a authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Add null check to work around async unregistration of receiver" into sc-dev

parents 861ba140 f9fdfa97
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1620,6 +1620,11 @@ public class NavigationBar implements View.OnAttachStateChangeListener,
    private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            // 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;
            }
            String action = intent.getAction();
            if (Intent.ACTION_SCREEN_OFF.equals(action)
                    || Intent.ACTION_SCREEN_ON.equals(action)) {