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

Commit 8203d985 authored by Ady Abraham's avatar Ady Abraham Committed by Android (Google) Code Review
Browse files

Merge "SF: remove misc2 flag as it is not used " into main

parents f6fe81ab 370bae95
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -108,7 +108,6 @@ void FlagManager::dump(std::string& result) const {
    DUMP_SERVER_FLAG(use_skia_tracing);

    /// Trunk stable server flags ///
    DUMP_SERVER_FLAG(late_boot_misc2);
    DUMP_SERVER_FLAG(dont_skip_on_early);
    DUMP_SERVER_FLAG(refresh_rate_overlay_on_external_display);

@@ -212,7 +211,6 @@ FLAG_MANAGER_READ_ONLY_FLAG(renderable_buffer_usage, "")
FLAG_MANAGER_READ_ONLY_FLAG(restore_blur_step, "debug.renderengine.restore_blur_step")

/// Trunk stable server flags ///
FLAG_MANAGER_SERVER_FLAG(late_boot_misc2, "")
FLAG_MANAGER_SERVER_FLAG(refresh_rate_overlay_on_external_display, "")

/// Exceptions ///
+0 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ public:
    bool use_skia_tracing() const;

    /// Trunk stable server flags ///
    bool late_boot_misc2() const;
    bool dont_skip_on_early() const;
    bool refresh_rate_overlay_on_external_display() const;

+0 −7
Original line number Diff line number Diff line
@@ -17,13 +17,6 @@ flag {
  is_fixed_read_only: true
}

flag{
  name: "late_boot_misc2"
  namespace: "core_graphics"
  description: "This flag controls minor miscellaneous SurfaceFlinger changes. Cannot be read before boot finished!"
  bug: "297389311"
}

flag {
  name: "vrr_config"
  namespace: "core_graphics"
+19 −20
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@

namespace android {

using namespace com::android::graphics::surfaceflinger;
using testing::Return;

class TestableFlagManager : public FlagManager {
@@ -86,26 +87,26 @@ TEST_F(FlagManagerTest, legacyReturnsValue) {

TEST_F(FlagManagerTest, creashesIfQueriedBeforeBoot) {
    mFlagManager.markBootIncomplete();
    EXPECT_DEATH(FlagManager::getInstance().late_boot_misc2(), "");
    EXPECT_DEATH(FlagManager::getInstance()
        .refresh_rate_overlay_on_external_display(), "");
}

TEST_F(FlagManagerTest, returnsOverrideTrue) {
    mFlagManager.markBootCompleted();

    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::late_boot_misc2, false);
    SET_FLAG_FOR_TEST(flags::refresh_rate_overlay_on_external_display, false);

    // This is stored in a static variable, so this test depends on the fact
    // that this flag has not been read in this process.
    EXPECT_CALL(mFlagManager, getBoolProperty).WillOnce(Return(true));
    EXPECT_TRUE(mFlagManager.late_boot_misc2());
    EXPECT_TRUE(mFlagManager.refresh_rate_overlay_on_external_display());

    // Further calls will not result in further calls to getBoolProperty.
    EXPECT_TRUE(mFlagManager.late_boot_misc2());
    EXPECT_TRUE(mFlagManager.refresh_rate_overlay_on_external_display());
}

TEST_F(FlagManagerTest, returnsOverrideReadonly) {
    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::add_sf_skipped_frames_to_trace,
                      false);
    SET_FLAG_FOR_TEST(flags::add_sf_skipped_frames_to_trace, false);

    // This is stored in a static variable, so this test depends on the fact
    // that this flag has not been read in this process.
@@ -116,9 +117,7 @@ TEST_F(FlagManagerTest, returnsOverrideReadonly) {
TEST_F(FlagManagerTest, returnsOverrideFalse) {
    mFlagManager.markBootCompleted();

    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::
                              refresh_rate_overlay_on_external_display,
                      true);
    SET_FLAG_FOR_TEST(flags::refresh_rate_overlay_on_external_display, true);

    // This is stored in a static variable, so this test depends on the fact
    // that this flag has not been read in this process.
@@ -129,7 +128,7 @@ TEST_F(FlagManagerTest, returnsOverrideFalse) {
TEST_F(FlagManagerTest, ignoresOverrideInUnitTestMode) {
    mFlagManager.setUnitTestMode();

    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::multithreaded_present, true);
    SET_FLAG_FOR_TEST(flags::multithreaded_present, true);

    // If this has not been called in this process, it will be called.
    // Regardless, the result is ignored.
@@ -144,13 +143,13 @@ TEST_F(FlagManagerTest, returnsValue) {
    EXPECT_CALL(mFlagManager, getBoolProperty).WillRepeatedly(Return(std::nullopt));

    {
        SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::late_boot_misc2, true);
        EXPECT_EQ(true, mFlagManager.late_boot_misc2());
        SET_FLAG_FOR_TEST(flags::refresh_rate_overlay_on_external_display, true);
        EXPECT_EQ(true, mFlagManager.refresh_rate_overlay_on_external_display());
    }

    {
        SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::late_boot_misc2, false);
        EXPECT_EQ(false, mFlagManager.late_boot_misc2());
        SET_FLAG_FOR_TEST(flags::refresh_rate_overlay_on_external_display, false);
        EXPECT_EQ(false, mFlagManager.refresh_rate_overlay_on_external_display());
    }
}

@@ -160,12 +159,12 @@ TEST_F(FlagManagerTest, readonlyReturnsValue) {
    EXPECT_CALL(mFlagManager, getBoolProperty).WillRepeatedly(Return(std::nullopt));

    {
        SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::misc1, true);
        SET_FLAG_FOR_TEST(flags::misc1, true);
        EXPECT_EQ(true, mFlagManager.misc1());
    }

    {
        SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::misc1, false);
        SET_FLAG_FOR_TEST(flags::misc1, false);
        EXPECT_EQ(false, mFlagManager.misc1());
    }
}
@@ -173,15 +172,15 @@ TEST_F(FlagManagerTest, readonlyReturnsValue) {
TEST_F(FlagManagerTest, dontSkipOnEarlyIsNotCached) {
    EXPECT_CALL(mFlagManager, getBoolProperty).WillRepeatedly(Return(std::nullopt));

    const auto initialValue = com::android::graphics::surfaceflinger::flags::dont_skip_on_early();
    const auto initialValue = flags::dont_skip_on_early();

    com::android::graphics::surfaceflinger::flags::dont_skip_on_early(true);
    flags::dont_skip_on_early(true);
    EXPECT_EQ(true, mFlagManager.dont_skip_on_early());

    com::android::graphics::surfaceflinger::flags::dont_skip_on_early(false);
    flags::dont_skip_on_early(false);
    EXPECT_EQ(false, mFlagManager.dont_skip_on_early());

    com::android::graphics::surfaceflinger::flags::dont_skip_on_early(initialValue);
    flags::dont_skip_on_early(initialValue);
}

} // namespace android