Add missing hotspot nullability annotations

This commit is contained in:
Torsten Grote
2021-05-26 09:57:49 -03:00
parent 673f530c14
commit aabba3a6c8
3 changed files with 8 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import android.content.Intent;
import android.net.wifi.WifiManager; import android.net.wifi.WifiManager;
import android.provider.Settings; import android.provider.Settings;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.R; import org.briarproject.briar.R;
import androidx.activity.result.ActivityResult; import androidx.activity.result.ActivityResult;
@@ -29,6 +30,7 @@ import static org.briarproject.briar.android.util.UiUtils.getGoToSettingsListene
* As soon as {@link #checkAndRequestConditions()} returns true, * As soon as {@link #checkAndRequestConditions()} returns true,
* all conditions are fulfilled. * all conditions are fulfilled.
*/ */
@NotNullByDefault
class ConditionManager { class ConditionManager {
private enum Permission { private enum Permission {

View File

@@ -2,8 +2,11 @@ package org.briarproject.briar.android.hotspot;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@NotNullByDefault
abstract class HotspotState { abstract class HotspotState {
static class StartingHotspot extends HotspotState { static class StartingHotspot extends HotspotState {

View File

@@ -31,6 +31,7 @@ import androidx.annotation.UiThread;
import androidx.lifecycle.LiveData; import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.MutableLiveData;
import static java.util.Objects.requireNonNull;
import static java.util.logging.Logger.getLogger; import static java.util.logging.Logger.getLogger;
@NotNullByDefault @NotNullByDefault
@@ -136,7 +137,8 @@ class HotspotViewModel extends DbViewModel
@Override @Override
@IoExecutor @IoExecutor
public void onWebServerStarted(WebsiteConfig websiteConfig) { public void onWebServerStarted(WebsiteConfig websiteConfig) {
state.postValue(new HotspotStarted(networkConfig, websiteConfig)); NetworkConfig nc = requireNonNull(networkConfig);
state.postValue(new HotspotStarted(nc, websiteConfig));
networkConfig = null; networkConfig = null;
} }