Merge branch 'feature-flags-for-hotspot-and-removable-drives' into 'master'

Enable removable drives and sharing app offline in release builds

See merge request briar/briar!1542
This commit is contained in:
Torsten Grote
2021-11-02 12:09:36 +00:00
7 changed files with 3 additions and 43 deletions

View File

@@ -10,8 +10,4 @@ public interface FeatureFlags {
boolean shouldEnableProfilePictures(); boolean shouldEnableProfilePictures();
boolean shouldEnableDisappearingMessages(); boolean shouldEnableDisappearingMessages();
boolean shouldEnableTransferData();
boolean shouldEnableShareAppViaOfflineHotspot();
} }

View File

@@ -24,16 +24,6 @@ public class TestFeatureFlagModule {
public boolean shouldEnableDisappearingMessages() { public boolean shouldEnableDisappearingMessages() {
return true; return true;
} }
@Override
public boolean shouldEnableTransferData() {
return true;
}
@Override
public boolean shouldEnableShareAppViaOfflineHotspot() {
return true;
}
}; };
} }
} }

View File

@@ -76,7 +76,6 @@ import static java.util.Collections.singletonList;
import static java.util.Collections.singletonMap; import static java.util.Collections.singletonMap;
import static org.briarproject.bramble.api.reporting.ReportingConstants.DEV_ONION_ADDRESS; import static org.briarproject.bramble.api.reporting.ReportingConstants.DEV_ONION_ADDRESS;
import static org.briarproject.bramble.api.reporting.ReportingConstants.DEV_PUBLIC_KEY_HEX; import static org.briarproject.bramble.api.reporting.ReportingConstants.DEV_PUBLIC_KEY_HEX;
import static org.briarproject.briar.android.TestingConstants.IS_DEBUG_BUILD;
@Module(includes = { @Module(includes = {
SetupModule.class, SetupModule.class,
@@ -171,11 +170,8 @@ public class AppModule {
@Override @Override
public Collection<SimplexPluginFactory> getSimplexFactories() { public Collection<SimplexPluginFactory> getSimplexFactories() {
if (SDK_INT >= 19 && featureFlags.shouldEnableTransferData()) { if (SDK_INT >= 19) return singletonList(drive);
return singletonList(drive); else return emptyList();
} else {
return emptyList();
}
} }
@Override @Override
@@ -312,16 +308,6 @@ public class AppModule {
public boolean shouldEnableDisappearingMessages() { public boolean shouldEnableDisappearingMessages() {
return true; return true;
} }
@Override
public boolean shouldEnableTransferData() {
return IS_DEBUG_BUILD;
}
@Override
public boolean shouldEnableShareAppViaOfflineHotspot() {
return IS_DEBUG_BUILD;
}
}; };
} }
} }

View File

@@ -380,7 +380,7 @@ public class ConversationActivity extends BriarActivity
} }
}); });
// Transfer Data feature only supported on API 19+ // Transfer Data feature only supported on API 19+
if (SDK_INT >= 19 && featureFlags.shouldEnableTransferData()) { if (SDK_INT >= 19) {
menu.findItem(R.id.action_transfer_data).setVisible(true); menu.findItem(R.id.action_transfer_data).setVisible(true);
} }
// enable alias and bluetooth action once available // enable alias and bluetooth action once available

View File

@@ -86,12 +86,6 @@ public class SettingsFragment extends PreferenceFragmentCompat {
PreferenceGroup dev = requireNonNull(findPreference(PREF_KEY_DEV)); PreferenceGroup dev = requireNonNull(findPreference(PREF_KEY_DEV));
dev.setVisible(false); dev.setVisible(false);
} }
if (!viewModel.shouldEnableShareAppViaOfflineHotspot()) {
Preference shareApp =
requireNonNull(findPreference(PREF_KEY_SHARE_APP));
shareApp.setVisible(false);
}
} }
@Override @Override

View File

@@ -262,8 +262,4 @@ class SettingsViewModel extends DbViewModel implements EventListener {
return screenLockTimeout; return screenLockTimeout;
} }
boolean shouldEnableShareAppViaOfflineHotspot() {
return featureFlags.shouldEnableShareAppViaOfflineHotspot();
}
} }

View File

@@ -95,7 +95,5 @@ internal class HeadlessModule(private val appDir: File) {
override fun shouldEnableImageAttachments() = false override fun shouldEnableImageAttachments() = false
override fun shouldEnableProfilePictures() = false override fun shouldEnableProfilePictures() = false
override fun shouldEnableDisappearingMessages() = false override fun shouldEnableDisappearingMessages() = false
override fun shouldEnableTransferData() = false
override fun shouldEnableShareAppViaOfflineHotspot() = false
} }
} }