Manage connectivity on no connection

This commit is contained in:
M66B
2019-06-14 22:03:56 +02:00
parent 31480d8713
commit 0e0386aa49
6 changed files with 49 additions and 47 deletions

View File

@@ -5,7 +5,6 @@ import android.accounts.AccountManager;
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.Network;
@@ -305,15 +304,4 @@ public class ConnectionHelper {
return Settings.System.getInt(context.getContentResolver(),
Settings.Global.AIRPLANE_MODE_ON, 0) != 0;
}
static Intent getSettingsIntent(Context context) {
Intent intent;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
else
intent = new Intent(Settings.Panel.ACTION_INTERNET_CONNECTIVITY);
if (intent.resolveActivity(context.getPackageManager()) == null)
return null;
return intent;
}
}