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

Commit 7422e881 authored by Toni Barzic's avatar Toni Barzic
Browse files

Handle PhoneStatusBarPolicy user switch callbacks on main thread

Said callbacks poke around StatusBarIconController, which lives on
main thread and is not thread safe.

BUG=27047911

Change-Id: I880d79a237b03c06d72b5dff3db24bd60c7b8839
parent 2eb31889
Loading
Loading
Loading
Loading
+20 −5
Original line number Diff line number Diff line
@@ -415,20 +415,35 @@ public class PhoneStatusBarPolicy implements Callback, RotationLockController.Ro
            new SynchronousUserSwitchObserver() {
                @Override
                public void onUserSwitching(int newUserId) throws RemoteException {
                    mHandler.post(new Runnable() {
                        @Override
                        public void run() {
                            mUserInfoController.reloadUserInfo();
                        }
                    });
                }

                @Override
                public void onUserSwitchComplete(int newUserId) throws RemoteException {
                    mHandler.post(new Runnable() {
                        @Override
                        public void run() {
                            profileChanged(newUserId);
                            updateQuietState();
                            updateManagedProfile();
                        }
                    });
                }

                @Override
                public void onForegroundProfileSwitch(int newProfileId) {
                    mHandler.post(new Runnable() {
                        @Override
                        public void run() {
                            profileChanged(newProfileId);
                        }
                    });
                }
            };

    private final HotspotController.Callback mHotspotCallback = new HotspotController.Callback() {