Feature flag for using hardware optimization for folder animations
Bug: 144338174 Change-Id: I92cc399da077c4c4da8264c20136302ede25ed01
This commit is contained in:
@@ -143,6 +143,11 @@ public final class FeatureFlags {
|
||||
"ENABLE_LSQ_VELOCITY_PROVIDER", false,
|
||||
"Use Least Square algorithm for motion pause detection.");
|
||||
|
||||
public static final BooleanFlag ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS =
|
||||
getDebugFlag(
|
||||
"ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS", false,
|
||||
"Always use hardware optimization for folder animations.");
|
||||
|
||||
public static void initialize(Context context) {
|
||||
synchronized (sDebugFlags) {
|
||||
for (DebugFlag flag : sDebugFlags) {
|
||||
|
||||
@@ -26,6 +26,7 @@ import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP
|
||||
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
|
||||
import static com.android.launcher3.config.FeatureFlags.ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS;
|
||||
import static com.android.launcher3.userevent.LauncherLogProto.Target.FromFolderLabelState.FROM_CUSTOM;
|
||||
import static com.android.launcher3.userevent.LauncherLogProto.Target.FromFolderLabelState.FROM_EMPTY;
|
||||
import static com.android.launcher3.userevent.LauncherLogProto.Target.FromFolderLabelState.FROM_FOLDER_LABEL_STATE_UNSPECIFIED;
|
||||
@@ -546,6 +547,8 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
|
||||
}
|
||||
|
||||
private boolean shouldUseHardwareLayerForAnimation(CellLayout currentCellLayout) {
|
||||
if (ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS.get()) return true;
|
||||
|
||||
int folderCount = 0;
|
||||
final ShortcutAndWidgetContainer container = currentCellLayout.getShortcutsAndWidgets();
|
||||
for (int i = container.getChildCount() - 1; i >= 0; --i) {
|
||||
|
||||
Reference in New Issue
Block a user