Verified Commit 0266da99 authored by Torsten Grote's avatar Torsten Grote
Browse files

Reset plugin assignments when starting AddNearbyContactIntroFragment

parent 4c11f93e
Pipeline #6464 skipped with stage
......@@ -95,6 +95,9 @@ public class AddNearbyContactIntroFragment extends BaseFragment {
// Permissions may have been granted manually while we were stopped
// Reset plugins in case they were assigned when we weren't signed-in
// Scroll down in case the screen is small, so the button is visible -> scrollView.fullScroll(FOCUS_DOWN));
......@@ -148,8 +148,8 @@ class AddNearbyContactViewModel extends AndroidViewModel
private final BluetoothAdapter bt;
private final Plugin wifiPlugin, bluetoothPlugin;
@Nullable // UiThread
private Plugin wifiPlugin, bluetoothPlugin;
// UiThread
private BluetoothDecision bluetoothDecision = BluetoothDecision.UNKNOWN;
......@@ -210,6 +210,17 @@ class AddNearbyContactViewModel extends AndroidViewModel
* When this activity gets killed and re-created while the user is not
* signed-in (can happen when a permission is denied which terminates app),
* the plugins will be null, so we need to re-assign them after sign-in.
void resetPlugins() {
wifiPlugin = pluginManager.getPlugin(LanTcpConstants.ID);
bluetoothPlugin = pluginManager.getPlugin(BluetoothConstants.ID);
void onContinueClicked() {
if (bluetoothDecision == REFUSED) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment