mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +01:00
List of wifi configs can be null.
This commit is contained in:
@@ -15,6 +15,7 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
|||||||
|
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -49,8 +50,11 @@ class AndroidSecureRandomProvider extends LinuxSecureRandomProvider {
|
|||||||
Parcel parcel = Parcel.obtain();
|
Parcel parcel = Parcel.obtain();
|
||||||
WifiManager wm =
|
WifiManager wm =
|
||||||
(WifiManager) appContext.getSystemService(WIFI_SERVICE);
|
(WifiManager) appContext.getSystemService(WIFI_SERVICE);
|
||||||
for (WifiConfiguration config : wm.getConfiguredNetworks())
|
List<WifiConfiguration> configs = wm.getConfiguredNetworks();
|
||||||
parcel.writeParcelable(config, 0);
|
if (configs != null) {
|
||||||
|
for (WifiConfiguration config : configs)
|
||||||
|
parcel.writeParcelable(config, 0);
|
||||||
|
}
|
||||||
BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter();
|
BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter();
|
||||||
if (bt != null) {
|
if (bt != null) {
|
||||||
for (BluetoothDevice device : bt.getBondedDevices())
|
for (BluetoothDevice device : bt.getBondedDevices())
|
||||||
|
|||||||
Reference in New Issue
Block a user