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

Commit d1a28fe0 authored by Anushree Ganjam's avatar Anushree Ganjam
Browse files

Add Launcher aconfig.

Use `enable_expanding_pause_work_button` as an example.

See go/trunk-stable-launcher for implementation details

Bug: 294913042

Test: adb shell device_config put launcher com.google.android.platform.launcher.aconfig.flags.enable_expanding_pause_work_button true

Flag: enable_expanding_pause_work_button
Change-Id: I732722c8b219c023adf5bf31f132ce9da72fc4d5
parent 6a5f5bb9
Loading
Loading
Loading
Loading
+43 −3
Original line number Diff line number Diff line
@@ -136,6 +136,24 @@ java_library {
    min_sdk_version: min_launcher3_sdk_version,
}

aconfig_declarations {
    name: "launcher_flags",
    package: "com.google.android.platform.launcher.aconfig.flags",
    srcs: ["launcher.aconfig"],
}

java_aconfig_library {
    name: "launcher_flags_lib",
    aconfig_declarations: "launcher_flags",
}

java_aconfig_library {
    name: "launcher_flags_lib_test",
    aconfig_declarations: "launcher_flags",
    test: true
}


// Library with all the dependencies for building Launcher3
android_library {
    name: "Launcher3ResLib",
@@ -167,8 +185,8 @@ android_library {
//
// Build rule for Launcher3 dependencies lib.
//
android_library {
    name: "Launcher3CommonDepsLib",
java_defaults {
    name: "Launcher3CommonDepsDefault",
    srcs: ["src_build_config/**/*.java"],
    static_libs: [
        "Launcher3ResLib",
@@ -183,6 +201,28 @@ android_library {
    },
}

//
// Build rule for Launcher3 dependencies lib.
//
android_library {
    name: "Launcher3CommonDepsLib",
    defaults: ["Launcher3CommonDepsDefault"],
    static_libs: [
        "launcher_flags_lib",
    ],
}

//
// Build rule for Launcher3 dependencies lib for test and debug.
//
android_library {
    name: "Launcher3CommonDepsLibDebug",
    defaults: ["Launcher3CommonDepsDefault"],
    static_libs: [
        "launcher_flags_lib_test",
    ],
}

//
// Build rule for Launcher3 app.
//
@@ -190,7 +230,7 @@ android_app {
    name: "Launcher3",

    static_libs: [
        "Launcher3CommonDepsLib",
        "Launcher3CommonDepsLibDebug",
    ],
    srcs: [
        ":launcher-src",

launcher.aconfig

0 → 100644
+8 −0
Original line number Diff line number Diff line
package: "com.google.android.platform.launcher.aconfig.flags"

flag {
    name: "enable_expanding_pause_work_button"
    namespace: "launcher"
    description: "Expand and collapse pause work button while scrolling."
    bug: "270390779"
}
+4 −1
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.ScrollableLayoutManager.PREDICTIVE_BACK_MIN_SCALE;

import static com.google.android.platform.launcher.aconfig.flags.Flags.enableExpandingPauseWorkButton;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
@@ -561,7 +563,8 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
            mAH.get(AdapterHolder.MAIN).setup(mainRecyclerView, mPersonalMatcher);
            mAH.get(AdapterHolder.WORK).setup(workRecyclerView, mWorkManager.getMatcher());
            workRecyclerView.setId(R.id.apps_list_view_work);
            if (FeatureFlags.ENABLE_EXPANDING_PAUSE_WORK_BUTTON.get()) {
            if (enableExpandingPauseWorkButton()
                    || FeatureFlags.ENABLE_EXPANDING_PAUSE_WORK_BUTTON.get()) {
                mAH.get(AdapterHolder.WORK).mRecyclerView.addOnScrollListener(
                        mWorkManager.newScrollListener());
            }
+1 −0
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ public final class FeatureFlags {
    public static final BooleanFlag ENABLE_HIDE_HEADER = getReleaseFlag(270390930,
            "ENABLE_HIDE_HEADER", ENABLED, "Hide header on keyboard before typing in all apps");

    // Aconfig migration complete for ENABLE_EXPANDING_PAUSE_WORK_BUTTON.
    public static final BooleanFlag ENABLE_EXPANDING_PAUSE_WORK_BUTTON = getDebugFlag(270390779,
            "ENABLE_EXPANDING_PAUSE_WORK_BUTTON", DISABLED,
            "Expand and collapse pause work button while scrolling");
+6 −1
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ android_library {
    asset_dirs: ["assets"],
    resource_dirs: ["res"],
    static_libs: [
        "flag-junit-base",
        "launcher-aosp-tapl",
        "androidx.test.core",
        "androidx.test.runner",
@@ -87,6 +88,7 @@ android_library {
        "truth-prebuilt",
        "platform-test-rules",
        "testables",
        "launcher_flags_lib_test",
    ],
    manifest: "AndroidManifest-common.xml",
    platform_apis: true,
@@ -103,7 +105,10 @@ android_test {
        ":launcher-tests-src",
        ":launcher-non-quickstep-tests-src",
    ],
    static_libs: ["Launcher3TestLib"],
    static_libs: [
        "Launcher3TestLib",
        "launcher_flags_lib_test",
    ],
    libs: [
        "android.test.base",
        "android.test.runner",
Loading