Clear DNS cache on network changes

Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey Vilas 2022-01-19 16:34:09 +01:00
parent 648c104cd9
commit 7299b598d4
No known key found for this signature in database
GPG key ID: 2585783189A62105

View file

@ -30,6 +30,7 @@ import android.content.IntentFilter;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.device.PowerManagementService;
import com.nextcloud.client.network.ConnectivityService;
import com.nextcloud.common.DNSCache;
import com.owncloud.android.MainApp;
import com.owncloud.android.datamodel.UploadsStorageManager;
@ -55,6 +56,7 @@ public final class ReceiversHelper {
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
DNSCache.clear();
if (connectivityService.getConnectivity().isConnected()) {
FilesSyncHelper.restartJobsIfNeeded(uploadsStorageManager,
accountManager,