Loading packages/SystemUI/src/com/android/systemui/flags/RefactorFlagUtils.kt +1 −0 Original line number Diff line number Diff line Loading @@ -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." } Loading packages/SystemUI/src/com/android/systemui/modes/shared/ModesUi.kt +3 −1 Original line number Diff line number Diff line Loading @@ -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 Loading packages/SystemUI/src/com/android/systemui/qs/flags/QsDetailedView.kt +3 −1 Original line number Diff line number Diff line Loading @@ -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 Loading packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlag.kt +3 −1 Original line number Diff line number Diff line Loading @@ -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 Loading packages/SystemUI/src/com/android/systemui/shade/ShadeExpandsOnStatusBarLongPress.kt +3 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
packages/SystemUI/src/com/android/systemui/flags/RefactorFlagUtils.kt +1 −0 Original line number Diff line number Diff line Loading @@ -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." } Loading
packages/SystemUI/src/com/android/systemui/modes/shared/ModesUi.kt +3 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
packages/SystemUI/src/com/android/systemui/qs/flags/QsDetailedView.kt +3 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlag.kt +3 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeExpandsOnStatusBarLongPress.kt +3 −1 Original line number Diff line number Diff line Loading @@ -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