Merge "Prevent app icons blinking after a user switch." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
bf7d5d06ce
@@ -114,6 +114,7 @@ import java.io.PrintWriter;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
@@ -448,6 +449,10 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
|
|||||||
notifySystemUiStateFlags(mSysUiState.getFlags());
|
notifySystemUiStateFlags(mSysUiState.getFlags());
|
||||||
|
|
||||||
notifyConnectionChanged();
|
notifyConnectionChanged();
|
||||||
|
if (mLatchForOnUserChanging != null) {
|
||||||
|
mLatchForOnUserChanging.countDown();
|
||||||
|
mLatchForOnUserChanging = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -502,11 +507,14 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private CountDownLatch mLatchForOnUserChanging;
|
||||||
private final UserTracker.Callback mUserChangedCallback =
|
private final UserTracker.Callback mUserChangedCallback =
|
||||||
new UserTracker.Callback() {
|
new UserTracker.Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void onUserChanged(int newUser, @NonNull Context userContext) {
|
public void onUserChanging(int newUser, @NonNull Context userContext,
|
||||||
|
CountDownLatch latch) {
|
||||||
mConnectionBackoffAttempts = 0;
|
mConnectionBackoffAttempts = 0;
|
||||||
|
mLatchForOnUserChanging = latch;
|
||||||
internalConnectToCurrentUser("User changed");
|
internalConnectToCurrentUser("User changed");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user