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

Commit bf7d5d06 authored by Yasin Kilicdere's avatar Yasin Kilicdere Committed by Android (Google) Code Review
Browse files

Merge "Prevent app icons blinking after a user switch." into udc-dev

parents 411a4199 c9b7df97
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.function.Supplier;

@@ -448,6 +449,10 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            notifySystemUiStateFlags(mSysUiState.getFlags());

            notifyConnectionChanged();
            if (mLatchForOnUserChanging != null) {
                mLatchForOnUserChanging.countDown();
                mLatchForOnUserChanging = null;
            }
        }

        @Override
@@ -502,11 +507,14 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        }
    };

    private CountDownLatch mLatchForOnUserChanging;
    private final UserTracker.Callback mUserChangedCallback =
            new UserTracker.Callback() {
                @Override
                public void onUserChanged(int newUser, @NonNull Context userContext) {
                public void onUserChanging(int newUser, @NonNull Context userContext,
                        CountDownLatch latch) {
                    mConnectionBackoffAttempts = 0;
                    mLatchForOnUserChanging = latch;
                    internalConnectToCurrentUser("User changed");
                }
            };