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

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

Change-Id: I7468d30ed0e09341272c29c41eee2cc5a3a56fdd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Yasin Kilicdere
2023-04-06 12:41:34 +00:00
committed by Automerger Merge Worker

View File

@@ -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");
}
};