Only refresh DISABLED_NO_THUMBNAIL when thumbnail changes

- Avoid refreshing all overlay content which happens too frequently

Bug: 193125090
Test: atest NexusLauncherTests:com.android.quickstep.TaplTestsQuickstep#testOverviewActions
Change-Id: Idcfe19a518e621c55574baae3bbe1378b7f3d08f
This commit is contained in:
Alex Chau
2021-08-04 12:14:46 +01:00
parent 61cfa57ad8
commit 630562210e
2 changed files with 10 additions and 1 deletions
@@ -182,6 +182,13 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
}
}
/**
* Called when the current task's thumbnail has changed.
*/
public void refreshActionVisibility(ThumbnailData thumbnail) {
getActionsView().updateDisabledFlags(DISABLED_NO_THUMBNAIL, thumbnail == null);
}
/**
* End rendering live tile in Overview.
*
@@ -162,7 +162,9 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
mBitmapShader = new BitmapShader(bm, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
mPaint.setShader(mBitmapShader);
updateThumbnailMatrix();
refreshOverlay();
if (mOverlayEnabled) {
getTaskOverlay().refreshActionVisibility(mThumbnailData);
}
} else {
mBitmapShader = null;
mThumbnailData = null;