Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b32ce07 authored by Tony Wickham's avatar Tony Wickham Committed by Android (Google) Code Review
Browse files

Merge "Decrease TAPL All Apps scrolling flakiness" into tm-qpr-dev

parents de5d5720 ee0bc03d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -928,4 +928,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        mControllers.dumpLogs(prefix + "\t", pw);
        mDeviceProfile.dump(this, prefix, pw);
    }

    @VisibleForTesting
    public int getTaskbarAllAppsTopPadding() {
        return mControllers.taskbarAllAppsController.getTaskbarAllAppsTopPadding();
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.launcher3.taskbar.allapps;

import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;

import com.android.launcher3.R;
import com.android.launcher3.appprediction.PredictionRowView;
@@ -123,4 +124,11 @@ public final class TaskbarAllAppsController {
                .findFixedRowByType(PredictionRowView.class)
                .setPredictedApps(mPredictedApps);
    }


    @VisibleForTesting
    public int getTaskbarAllAppsTopPadding() {
        // Allow null-pointer since this should only be null if the apps view is not showing.
        return mAppsView.getActiveRecyclerView().getClipBounds().top;
    }
}
+20 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import com.android.quickstep.util.TISBindHelper;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.function.Consumer;
import java.util.function.Function;

public class QuickstepTestInformationHandler extends TestInformationHandler {

@@ -112,6 +113,13 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
                        resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size));
                return response;
            }

            case TestProtocol.REQUEST_TASKBAR_ALL_APPS_TOP_PADDING: {
                return getTISBinderUIProperty(Bundle::putInt, tisBinder ->
                        tisBinder.getTaskbarManager()
                                .getCurrentActivityContext()
                                .getTaskbarAllAppsTopPadding());
            }
        }

        return super.call(method, arg, extras);
@@ -159,4 +167,16 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
            throw new RuntimeException(e);
        }
    }

    private <T> Bundle getTISBinderUIProperty(
            BundleSetter<T> bundleSetter, Function<TouchInteractionService.TISBinder, T> provider) {
        Bundle response = new Bundle();

        runOnTISBinder(tisBinder -> bundleSetter.set(
                response,
                TestProtocol.TEST_INFO_RESPONSE_FIELD,
                provider.apply(tisBinder)));

        return response;
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -219,6 +219,11 @@ public class TestInformationHandler implements ResourceBasedOverride {
                return response;
            }

            case TestProtocol.REQUEST_ALL_APPS_TOP_PADDING: {
                return getLauncherUIProperty(Bundle::putInt,
                        l -> l.getAppsView().getActiveRecyclerView().getClipBounds().top);
            }

            default:
                return null;
        }
+3 −0
Original line number Diff line number Diff line
@@ -112,6 +112,9 @@ public final class TestProtocol {
            "get-activities-created-count";
    public static final String REQUEST_GET_ACTIVITIES = "get-activities";
    public static final String REQUEST_HAS_TIS = "has-touch-interaction-service";
    public static final String REQUEST_TASKBAR_ALL_APPS_TOP_PADDING =
            "taskbar-all-apps-top-padding";
    public static final String REQUEST_ALL_APPS_TOP_PADDING = "all-apps-top-padding";

    public static final String REQUEST_WORKSPACE_CELL_LAYOUT_SIZE = "workspace-cell-layout-size";
    public static final String REQUEST_WORKSPACE_CELL_CENTER = "workspace-cell-center";
Loading