Pause the prediction update until the app launch transition ends.
b/319162661 issue is similar to hotseat updates on app click : b/148800229 and ag/10235572 So we will pause the prediction updates until the app launch transition is complete. See https://b.corp.google.com/issues/319162661#comment9 and https://b.corp.google.com/issues/319162661#comment10 for bug report analysis. Before fix: https://b.corp.google.com/issues/319162661#comment11 After fix: https://b.corp.google.com/issues/319162661#comment12 Bug: 319162661 Test: Manual Flag: NA Change-Id: I797ce982569c7950628368b854fb3b6766f0fc28
This commit is contained in:
1 parent
e66ed03992
commit
b3bf0276e4
2 files changed
+23
-2
No files matched your search
@@ -72,6 +72,8 @@ public class PredictionRowView<T extends Context & ActivityContext>
|
||||
|
||||
private boolean mPredictionsEnabled = false;
|
||||
|
||||
private boolean mPredictionUiUpdatePaused = false;
|
||||
|
||||
public PredictionRowView(@NonNull Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
@@ -193,7 +195,18 @@ public class PredictionRowView<T extends Context & ActivityContext>
|
||||
applyPredictionApps();
|
||||
}
|
||||
|
||||
/** Pause the prediction row UI update */
|
||||
public void setPredictionUiUpdatePaused(boolean predictionUiUpdatePaused) {
|
||||
mPredictionUiUpdatePaused = predictionUiUpdatePaused;
|
||||
if (!mPredictionUiUpdatePaused) {
|
||||
applyPredictionApps();
|
||||
}
|
||||
}
|
||||
|
||||
private void applyPredictionApps() {
|
||||
if (mPredictionUiUpdatePaused) {
|
||||
return;
|
||||
}
|
||||
if (getChildCount() != mNumPredictedAppsPerRow) {
|
||||
while (getChildCount() > mNumPredictedAppsPerRow) {
|
||||
removeViewAt(0);
|
||||
|
||||
Reference in new issue
Block a user