Use a feature flag to hide connect via Bluetooth option

This commit is contained in:
Torsten Grote
2021-04-19 11:36:35 -03:00
parent c736bf7c06
commit 688bac77a8
6 changed files with 17 additions and 0 deletions

View File

@@ -10,4 +10,6 @@ public interface FeatureFlags {
boolean shouldEnableProfilePictures();
boolean shouldEnableDisappearingMessages();
boolean shouldEnableConnectViewBluetooth();
}

View File

@@ -38,6 +38,11 @@ public class BrambleCoreIntegrationTestModule {
public boolean shouldEnableDisappearingMessages() {
return true;
}
@Override
public boolean shouldEnableConnectViewBluetooth() {
return true;
}
};
}
}

View File

@@ -298,6 +298,11 @@ public class AppModule {
public boolean shouldEnableDisappearingMessages() {
return IS_DEBUG_BUILD;
}
@Override
public boolean shouldEnableConnectViewBluetooth() {
return IS_DEBUG_BUILD;
}
};
}
}

View File

@@ -371,6 +371,9 @@ public class ConversationActivity extends BriarActivity
this::showIntroductionOnboarding);
}
});
if (!featureFlags.shouldEnableConnectViewBluetooth()) {
menu.findItem(R.id.action_connect_via_bluetooth).setVisible(false);
}
// enable alias and bluetooth action once available
observeOnce(viewModel.getContactItem(), this, contact -> {
menu.findItem(R.id.action_set_alias).setEnabled(true);

View File

@@ -94,5 +94,6 @@ internal class HeadlessModule(private val appDir: File) {
override fun shouldEnableImageAttachments() = false
override fun shouldEnableProfilePictures() = false
override fun shouldEnableDisappearingMessages() = false
override fun shouldEnableConnectViewBluetooth() = false
}
}

View File

@@ -82,6 +82,7 @@ internal class HeadlessTestModule(private val appDir: File) {
override fun shouldEnableImageAttachments() = false
override fun shouldEnableProfilePictures() = false
override fun shouldEnableDisappearingMessages() = false
override fun shouldEnableConnectViewBluetooth() = false
}
@Provides