Move some Tethering code to SettingsLib to share

Change-Id: I43a356f2a14af4a15d1827919c39bbd1a04d3a94
This commit is contained in:
Jason Monk
2015-02-11 13:30:41 -05:00
parent b8331548d1
commit 4896c01729
5 changed files with 65 additions and 135 deletions

View File

@@ -6,6 +6,8 @@ import android.content.Context;
import android.content.Intent;
import android.net.wifi.WifiManager;
import com.android.settingslib.TetherUtil;
/**
* This receiver catches when quick settings turns off the hotspot, so we can
* cancel the alarm in that case. All other cancels are handled in tethersettings.
@@ -18,7 +20,7 @@ public class HotspotOffReceiver extends BroadcastReceiver {
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
if (wifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_DISABLED) {
// The hotspot has been turned off, we don't need to recheck tethering.
TetherService.cancelRecheckAlarmIfNecessary(context, TetherSettings.WIFI_TETHERING);
TetherService.cancelRecheckAlarmIfNecessary(context, TetherUtil.TETHERING_WIFI);
}
}
}