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

Commit 98e6f4e7 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Deprecate the `unsafeAssertInNewMode` method to avod people using it." into main

parents 34c697f5 18cdf526
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ object RefactorFlagUtils {
     * }
     * ````
     */
    @Deprecated("Avoid crashing.", ReplaceWith("if (this.isUnexpectedlyInLegacyMode()) return"))
    inline fun unsafeAssertInNewMode(isEnabled: Boolean, flagName: Any) =
        check(isEnabled) { "New code path not supported when $flagName is disabled." }

+3 −1
Original line number Diff line number Diff line
@@ -42,7 +42,9 @@ object ModesUi {
     * Caution!! Using this check incorrectly will cause crashes in nextfood builds!
     */
    @JvmStatic
    inline fun unsafeAssertInNewMode() = RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, Flags.FLAG_MODES_UI)
    @Deprecated("Avoid crashing.", ReplaceWith("if (this.isUnexpectedlyInLegacyMode()) return"))
    inline fun unsafeAssertInNewMode() =
        RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, Flags.FLAG_MODES_UI)

    /**
     * Called to ensure code is only run when the flag is disabled. This will throw an exception if
+3 −1
Original line number Diff line number Diff line
@@ -81,7 +81,9 @@ object QsDetailedView {
     * Caution!! Using this check incorrectly will cause crashes in nextfood builds!
     */
    @JvmStatic
    inline fun unsafeAssertInNewMode() = RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, FLAG_NAME)
    @Deprecated("Avoid crashing.", ReplaceWith("if (this.isUnexpectedlyInLegacyMode()) return"))
    inline fun unsafeAssertInNewMode() =
        RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, FLAG_NAME)

    /** Returns a developer-readable string that describes the current requirement list. */
    @JvmStatic
+3 −1
Original line number Diff line number Diff line
@@ -83,7 +83,9 @@ object SceneContainerFlag {
     * testing.
     */
    @JvmStatic
    inline fun unsafeAssertInNewMode() = RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, DESCRIPTION)
    @Deprecated("Avoid crashing.", ReplaceWith("if (this.isUnexpectedlyInLegacyMode()) return"))
    inline fun unsafeAssertInNewMode() =
        RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, DESCRIPTION)

    /** Returns a developer-readable string that describes the current requirement list. */
    @JvmStatic
+3 −1
Original line number Diff line number Diff line
@@ -50,7 +50,9 @@ object ShadeExpandsOnStatusBarLongPress {
     * Caution!! Using this check incorrectly will cause crashes in nextfood builds!
     */
    @JvmStatic
    inline fun unsafeAssertInNewMode() = RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, FLAG_NAME)
    @Deprecated("Avoid crashing.", ReplaceWith("if (this.isUnexpectedlyInLegacyMode()) return"))
    inline fun unsafeAssertInNewMode() =
        RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, FLAG_NAME)

    /**
     * Called to ensure code is only run when the flag is disabled. This will throw an exception if
Loading