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

Commit ba48d67c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add dev option override flag to connected display cursor flag" into main

parents b61e79d3 68ef9a17
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -22,7 +22,21 @@ class InputFlags {
public:
    /**
     * Check if connected displays feature is enabled, either via the feature flag or settings
     * override.
     * override. Developer setting override allows enabling all the "desktop experiences" features
     * including input related connected_displays_cursor flag.
     *
     * The developer settings override is prioritised over aconfig flags. Any tests that require
     * applicable aconfig flags to be disabled with SCOPED_FLAG_OVERRIDE also need this developer
     * option to be reset locally.
     *
     * Also note the developer setting override is only applicable to the desktop experiences
     * related features.
     *
     * To enable only the input flag run:
     *      adb shell aflags enable com.android.input.flags.connected_displays_cursor
     * To override this flag and enable all "desktop experiences" features run:
     *      adb shell aflags enable com.android.window.flags.enable_desktop_mode_through_dev_option
     *      adb shell setprop persist.wm.debug.desktop_experience_devopts 1
     */
    static bool connectedDisplaysCursorEnabled();

+1 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ cc_library {

    shared_libs: [
        "android.companion.virtualdevice.flags-aconfig-cc",
        "com.android.window.flags.window-aconfig_flags_c_lib",
        "libPlatformProperties",
        "libaconfig_storage_read_api_cc",
        "libbase",
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include <android-base/logging.h>
#include <com_android_input_flags.h>
#include <com_android_window_flags.h>
#include <cutils/properties.h>

#include <string>
@@ -25,6 +26,9 @@
namespace android {

bool InputFlags::connectedDisplaysCursorEnabled() {
    if (!com::android::window::flags::enable_desktop_mode_through_dev_option()) {
        return com::android::input::flags::connected_displays_cursor();
    }
    static std::optional<bool> cachedDevOption;
    if (!cachedDevOption.has_value()) {
        char value[PROPERTY_VALUE_MAX];