Skip to content

Commit

Permalink
Only store remote values for flags in a whitelist.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Feb 11, 2020
1 parent d9c5907 commit c041614
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,8 @@ private static CharSequence buildFlags() {
Map<String, Boolean> disk = FeatureFlags.getDiskValues();
Map<String, Boolean> forced = FeatureFlags.getForcedValues();
int remoteLength = Stream.of(memory.keySet()).map(String::length).max(Integer::compareTo).orElse(0);
int forcedLength = Stream.of(disk.keySet()).map(String::length).max(Integer::compareTo).orElse(0);
int diskLength = Stream.of(disk.keySet()).map(String::length).max(Integer::compareTo).orElse(0);
int forcedLength = Stream.of(forced.keySet()).map(String::length).max(Integer::compareTo).orElse(0);

out.append("-- Memory\n");
for (Map.Entry<String, Boolean> entry : memory.entrySet()) {
Expand All @@ -643,7 +644,7 @@ private static CharSequence buildFlags() {

out.append("-- Disk\n");
for (Map.Entry<String, Boolean> entry : disk.entrySet()) {
out.append(Util.rightPad(entry.getKey(), forcedLength)).append(": ").append(entry.getValue()).append("\n");
out.append(Util.rightPad(entry.getKey(), diskLength)).append(": ").append(entry.getValue()).append("\n");
}
out.append("\n");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public final class FeatureFlags {
* We will only store remote values for flags in this set. If you want a flag to be controllable
* remotely, place it in here.
*/

private static final Set<String> REMOTE_CAPABLE = Sets.newHashSet(
PINS_FOR_ALL,
PINS_MEGAPHONE_KILL_SWITCH
Expand Down

0 comments on commit c041614

Please sign in to comment.