mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 20:59:54 +01:00
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:
@@ -10,8 +10,4 @@ public interface FeatureFlags {
|
|||||||
boolean shouldEnableProfilePictures();
|
boolean shouldEnableProfilePictures();
|
||||||
|
|
||||||
boolean shouldEnableDisappearingMessages();
|
boolean shouldEnableDisappearingMessages();
|
||||||
|
|
||||||
boolean shouldEnableTransferData();
|
|
||||||
|
|
||||||
boolean shouldEnableShareAppViaOfflineHotspot();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -262,8 +262,4 @@ class SettingsViewModel extends DbViewModel implements EventListener {
|
|||||||
return screenLockTimeout;
|
return screenLockTimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean shouldEnableShareAppViaOfflineHotspot() {
|
|
||||||
return featureFlags.shouldEnableShareAppViaOfflineHotspot();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user