Search in sources :

Example 6 with WifiManager

use of android.net.wifi.WifiManager in project platform_frameworks_base by android.

the class WifiNetworkAdapter method doIconQuery.

public void doIconQuery(long bssid, String fileName) {
    WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
    Log.d("ZXZ", String.format("Icon query for %012x '%s'", bssid, fileName));
    wifiManager.queryPasspointIcon(bssid, fileName);
}
Also used : WifiManager(android.net.wifi.WifiManager)

Example 7 with WifiManager

use of android.net.wifi.WifiManager in project platform_frameworks_base by android.

the class WifiNetworkAdapter method addSP.

public HomeSP addSP(MOTree instanceTree) throws IOException, SAXException {
    WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
    String xml = instanceTree.toXml();
    // TODO(b/32883320): use the new API for adding Passpoint configuration.
    return null;
}
Also used : WifiManager(android.net.wifi.WifiManager)

Example 8 with WifiManager

use of android.net.wifi.WifiManager in project platform_frameworks_base by android.

the class WifiNetworkAdapter method deleteNetwork.

public void deleteNetwork(int id) {
    WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
    wifiManager.disableNetwork(id);
    wifiManager.forget(id, null);
}
Also used : WifiManager(android.net.wifi.WifiManager)

Example 9 with WifiManager

use of android.net.wifi.WifiManager in project platform_frameworks_base by android.

the class Tethering method setWifiTethering.

private int setWifiTethering(final boolean enable) {
    synchronized (mPublicSync) {
        mWifiTetherRequested = enable;
        final WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
        if (wifiManager.setWifiApEnabled(null, /* use existing wifi config */
        enable)) {
            return ConnectivityManager.TETHER_ERROR_NO_ERROR;
        }
        return ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
    }
}
Also used : WifiManager(android.net.wifi.WifiManager)

Example 10 with WifiManager

use of android.net.wifi.WifiManager in project iosched by google.

the class WiFiUtils method installConferenceWiFi.

public static void installConferenceWiFi(final Context context) {
    // Create conferenceWifiConfig
    WifiConfiguration conferenceWifiConfig = getConferenceWifiConfig();
    // Store conferenceWifiConfig.
    final WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
    int netId = wifiManager.addNetwork(conferenceWifiConfig);
    if (netId != -1) {
        wifiManager.enableNetwork(netId, false);
        boolean result = wifiManager.saveConfiguration();
        if (!result) {
            Log.e(TAG, "Unknown error while calling WiFiManager.saveConfiguration()");
            Toast.makeText(context, context.getResources().getString(R.string.wifi_install_error_message), Toast.LENGTH_SHORT).show();
        }
    } else {
        Log.e(TAG, "Unknown error while calling WiFiManager.addNetwork()");
        Toast.makeText(context, context.getResources().getString(R.string.wifi_install_error_message), Toast.LENGTH_SHORT).show();
    }
}
Also used : WifiManager(android.net.wifi.WifiManager) WifiConfiguration(android.net.wifi.WifiConfiguration)

Aggregations

WifiManager (android.net.wifi.WifiManager)169 WifiInfo (android.net.wifi.WifiInfo)53 WifiConfiguration (android.net.wifi.WifiConfiguration)42 IOException (java.io.IOException)24 IntentFilter (android.content.IntentFilter)13 WifiEnterpriseConfig (android.net.wifi.WifiEnterpriseConfig)10 Context (android.content.Context)9 ConnectivityManager (android.net.ConnectivityManager)8 NetworkInfo (android.net.NetworkInfo)8 Test (org.junit.Test)8 Intent (android.content.Intent)7 File (java.io.File)6 SAXException (org.xml.sax.SAXException)6 SharedPreferences (android.content.SharedPreferences)5 PowerManager (android.os.PowerManager)5 TelephonyManager (android.telephony.TelephonyManager)5 X509Certificate (java.security.cert.X509Certificate)5 BufferedReader (java.io.BufferedReader)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 FileReader (java.io.FileReader)4