summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Julia Tuttle <juliatuttle@google.com> 2022-01-25 15:39:42 -0500
committer Julia Tuttle <juliatuttle@google.com> 2022-01-25 16:11:03 -0500
commiteb7d677acbd0f72262bd79ceb8cfb3927d52ebdf (patch)
treeae77bf9f7f1e6779046f91e6ea142a8402c6a276
parent75da5071e50836a7d869fc493048c56f90ed3442 (diff)
New Pipeline: improve "old pipeline running" handling
Currently, we show a toast and log a message with a stacktrace when old pipeline code is running while the new pipeline is enabled. With this change, we show a toast *only on debug builds*, and we either log a message *or throw a RuntimeException* depending on the state of a new System UI flag. Bug: 216092204 Test: manual Change-Id: I6e4d27704e4806a3ea4dc0c20c4f727b1a41ac63
-rw-r--r--packages/SystemUI/src/com/android/systemui/flags/Flags.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt13
2 files changed, 14 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.java b/packages/SystemUI/src/com/android/systemui/flags/Flags.java
index e24df30bfe34..490f7c1134c1 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/Flags.java
+++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.java
@@ -55,6 +55,9 @@ public class Flags {
public static final BooleanFlag NSSL_DEBUG_REMOVE_ANIMATION =
new BooleanFlag(106, false);
+ public static final BooleanFlag NEW_PIPELINE_CRASH_ON_CALL_TO_OLD_PIPELINE =
+ new BooleanFlag(107, false);
+
/***************************************/
// 200 - keyguard/lockscreen
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt
index 1432f788a6fa..f6a55e6b75c6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt
@@ -21,6 +21,7 @@ import android.util.Log
import android.widget.Toast
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
+import com.android.systemui.util.Compile
import javax.inject.Inject
class NotifPipelineFlags @Inject constructor(
@@ -31,8 +32,16 @@ class NotifPipelineFlags @Inject constructor(
if (!isNewPipelineEnabled()) {
return true
}
- Log.d("NotifPipeline", "Old pipeline code running w/ new pipeline enabled", Exception())
- Toast.makeText(context, "Old pipeline code running!", Toast.LENGTH_SHORT).show()
+
+ if (Compile.IS_DEBUG) {
+ Toast.makeText(context, "Old pipeline code running!", Toast.LENGTH_SHORT).show()
+ }
+ if (featureFlags.isEnabled(Flags.NEW_PIPELINE_CRASH_ON_CALL_TO_OLD_PIPELINE)) {
+ throw RuntimeException("Old pipeline code running with new pipeline enabled")
+ } else {
+ Log.d("NotifPipeline", "Old pipeline code running with new pipeline enabled",
+ Exception())
+ }
return false
}