-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
temp: Add kill switch for conditional components support
- Loading branch information
1 parent
3c58f73
commit 9a8dab6
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
patches/0180-temporary-config-disable-conditional-component-if-de.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: fgei <[email protected]> | ||
Date: Thu, 20 Jun 2024 08:39:51 +0000 | ||
Subject: [PATCH] temporary: config: disable conditional component if declared | ||
such in config holder app | ||
|
||
--- | ||
.../vanadium/config/VanadiumConfConditionals.java | 13 +++++++++++++ | ||
1 file changed, 13 insertions(+) | ||
|
||
diff --git a/vanadium/android_config/proto/java/src/app/vanadium/config/VanadiumConfConditionals.java b/vanadium/android_config/proto/java/src/app/vanadium/config/VanadiumConfConditionals.java | ||
index 39d8de8b26056..267346485195a 100644 | ||
--- a/vanadium/android_config/proto/java/src/app/vanadium/config/VanadiumConfConditionals.java | ||
+++ b/vanadium/android_config/proto/java/src/app/vanadium/config/VanadiumConfConditionals.java | ||
@@ -2,6 +2,7 @@ package app.vanadium.config; | ||
|
||
import android.util.Log; | ||
|
||
+import app.vanadium.config.proto.VanadiumConfigProto; | ||
import app.vanadium.config.proto.VanadiumConfigProto.Component.ComponentCondition; | ||
|
||
public final class VanadiumConfConditionals { | ||
@@ -15,6 +16,12 @@ public final class VanadiumConfConditionals { | ||
private static volatile ConditionSupplier conditionSupplier; | ||
|
||
private static ConditionSupplier getConditionSupplier() { | ||
+ if (VanadiumConfParser.isInitialized()) { | ||
+ if (VanadiumConfParser.getFlagsFor(VanadiumConfigProto.Flag.FlagType.DISABLED_FEATURE) | ||
+ .containsKey("VanadiumConfCondtionalsSupport")) { | ||
+ return null; | ||
+ } | ||
+ } | ||
return VanadiumConfConditionals.conditionSupplier; | ||
} | ||
|
||
@@ -37,6 +44,12 @@ public final class VanadiumConfConditionals { | ||
} | ||
|
||
public static void setBrowserConditionals(ConditionSupplier conditionSupplier) { | ||
+ if (VanadiumConfParser.isInitialized()) { | ||
+ if (VanadiumConfParser.getFlagsFor(VanadiumConfigProto.Flag.FlagType.DISABLED_FEATURE) | ||
+ .containsKey("VanadiumConfCondtionalsSupport")) { | ||
+ return; | ||
+ } | ||
+ } | ||
VanadiumConfConditionals.conditionSupplier = conditionSupplier; | ||
} | ||
} |