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);
}
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;
}
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);
}
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;
}
}
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();
}
}
Aggregations