mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Remove various bits of code whose migration periods have passed.
This commit is contained in:
@@ -52,7 +52,6 @@ import static org.briarproject.bramble.api.lifecycle.LifecycleManager.StartResul
|
||||
import static org.briarproject.bramble.api.lifecycle.LifecycleManager.StartResult.SUCCESS;
|
||||
import static org.briarproject.bramble.util.AndroidUtils.isUiThread;
|
||||
import static org.briarproject.briar.android.BriarApplication.ENTRY_ACTIVITY;
|
||||
import static org.briarproject.briar.api.android.AndroidNotificationManager.FAILURE_CHANNEL_ID;
|
||||
import static org.briarproject.briar.api.android.AndroidNotificationManager.ONGOING_CHANNEL_ID;
|
||||
import static org.briarproject.briar.api.android.AndroidNotificationManager.ONGOING_CHANNEL_OLD_ID;
|
||||
import static org.briarproject.briar.api.android.AndroidNotificationManager.ONGOING_NOTIFICATION_ID;
|
||||
@@ -141,11 +140,6 @@ public class BriarService extends Service {
|
||||
ongoingChannel.setLockscreenVisibility(VISIBILITY_SECRET);
|
||||
ongoingChannel.setShowBadge(false);
|
||||
nm.createNotificationChannel(ongoingChannel);
|
||||
// Delete the unused channel previously used for startup
|
||||
// failure notifications
|
||||
// TODO: Remove this ID after a reasonable upgrade period
|
||||
// (added 2021-07-12)
|
||||
nm.deleteNotificationChannel(FAILURE_CHANNEL_ID);
|
||||
}
|
||||
Notification foregroundNotification =
|
||||
notificationManager.getForegroundNotification();
|
||||
|
||||
@@ -18,7 +18,6 @@ import static org.briarproject.bramble.api.plugin.TorConstants.DEFAULT_PREF_TOR_
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.DEFAULT_PREF_TOR_ONLY_WHEN_CHARGING;
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.PREF_TOR_MOBILE;
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.PREF_TOR_NETWORK;
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.PREF_TOR_NETWORK_NEVER;
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.PREF_TOR_ONLY_WHEN_CHARGING;
|
||||
import static org.briarproject.briar.android.settings.SettingsViewModel.BT_NAMESPACE;
|
||||
import static org.briarproject.briar.android.settings.SettingsViewModel.TOR_NAMESPACE;
|
||||
@@ -61,32 +60,18 @@ class ConnectionsManager {
|
||||
}
|
||||
|
||||
void updateTorSettings(Settings settings) {
|
||||
Settings torSettings = migrateTorSettings(settings);
|
||||
torEnabled.postValue(torSettings.getBoolean(PREF_PLUGIN_ENABLE,
|
||||
torEnabled.postValue(settings.getBoolean(PREF_PLUGIN_ENABLE,
|
||||
TorConstants.DEFAULT_PREF_PLUGIN_ENABLE));
|
||||
|
||||
int torNetworkSetting = torSettings.getInt(PREF_TOR_NETWORK,
|
||||
int torNetworkSetting = settings.getInt(PREF_TOR_NETWORK,
|
||||
DEFAULT_PREF_TOR_NETWORK);
|
||||
torNetwork.postValue(Integer.toString(torNetworkSetting));
|
||||
|
||||
torMobile.postValue(torSettings.getBoolean(PREF_TOR_MOBILE,
|
||||
torMobile.postValue(settings.getBoolean(PREF_TOR_MOBILE,
|
||||
DEFAULT_PREF_TOR_MOBILE));
|
||||
torCharging
|
||||
.postValue(torSettings.getBoolean(PREF_TOR_ONLY_WHEN_CHARGING,
|
||||
DEFAULT_PREF_TOR_ONLY_WHEN_CHARGING));
|
||||
}
|
||||
|
||||
// TODO: Remove after a reasonable migration period (added 2020-06-25)
|
||||
private Settings migrateTorSettings(Settings s) {
|
||||
int network = s.getInt(PREF_TOR_NETWORK, DEFAULT_PREF_TOR_NETWORK);
|
||||
if (network == PREF_TOR_NETWORK_NEVER) {
|
||||
s.putInt(PREF_TOR_NETWORK, DEFAULT_PREF_TOR_NETWORK);
|
||||
s.putBoolean(PREF_PLUGIN_ENABLE, false);
|
||||
// We don't need to save the migrated settings - the Tor plugin is
|
||||
// responsible for that. This code just handles the case where the
|
||||
// settings are loaded before the plugin migrates them.
|
||||
}
|
||||
return s;
|
||||
torCharging.postValue(settings.getBoolean(PREF_TOR_ONLY_WHEN_CHARGING,
|
||||
DEFAULT_PREF_TOR_ONLY_WHEN_CHARGING));
|
||||
}
|
||||
|
||||
LiveData<Boolean> btEnabled() {
|
||||
|
||||
@@ -24,7 +24,6 @@ public interface AndroidNotificationManager {
|
||||
|
||||
// Notification IDs
|
||||
int ONGOING_NOTIFICATION_ID = 1;
|
||||
int FAILURE_NOTIFICATION_ID = 2;
|
||||
int REMINDER_NOTIFICATION_ID = 3;
|
||||
int PRIVATE_MESSAGE_NOTIFICATION_ID = 4;
|
||||
int GROUP_MESSAGE_NOTIFICATION_ID = 5;
|
||||
@@ -47,10 +46,6 @@ public interface AndroidNotificationManager {
|
||||
String HOTSPOT_CHANNEL_ID = "zHotspot";
|
||||
String MAILBOX_PROBLEM_CHANNEL_ID = "zMailboxProblem";
|
||||
|
||||
// This channel is no longer used - keep the ID so we can remove the
|
||||
// channel from existing installations
|
||||
String FAILURE_CHANNEL_ID = "zStartupFailure";
|
||||
|
||||
// Actions for pending intents
|
||||
String ACTION_DISMISS_REMINDER = "dismissReminder";
|
||||
String ACTION_STOP_HOTSPOT = "stopHotspot";
|
||||
|
||||
Reference in New Issue
Block a user