Disable alivemonitor for hostapd on windcharger.

Windcharger does not currently use waveguide, which generates important
events that keep the hostapd alive file updated. Without waveguide,
the other events that keep the alive file updated are generated externally
such as beacons and probes, and are less available in some installations
leading to hostapd getting killed when it is operating normally.

Also add an experiment to disable alivemonitor on hostapd.

see b/32376077

Change-Id: Ic1a4d593035a595fab6bc385fcb2ec0bb3f733e5
diff --git a/wifi/configs.py b/wifi/configs.py
index 97a27ce..a4f20b8 100644
--- a/wifi/configs.py
+++ b/wifi/configs.py
@@ -22,6 +22,7 @@
     'WifiHostapdDebug',
     'WifiShortAggTimeout',
     'WifiNoAggTimeout',
+    'WifiNoAliveMonitor',
 ]
 for _i in EXPERIMENTS:
   experiment.register(_i)
diff --git a/wifi/wifi.py b/wifi/wifi.py
index 34bb5e8..94c0577 100755
--- a/wifi/wifi.py
+++ b/wifi/wifi.py
@@ -61,6 +61,7 @@
 
 _FINGERPRINTS_DIRECTORY = '/tmp/wifi/fingerprints'
 _LOCKFILE = '/tmp/wifi/wifi'
+_PLATFORM_FILE = '/etc/platform'
 lockfile_taken = False
 
 
@@ -587,6 +588,18 @@
         return None
 
 
+def _is_wind_charger():
+  try:
+    etc_platform = open(_PLATFORM_FILE).read()
+    if etc_platform[:-1] == 'GFMN100':
+      return True
+    else:
+      return False
+  except IOError as e:
+    print('_is_wind_charger: cant open %s: %s' % (_PLATFORM_FILE, e.strerror))
+    return False
+
+
 def _start_hostapd(interface, config_filename, band, ssid):
   """Starts a babysat hostapd.
 
@@ -622,9 +635,15 @@
   alivemonitor_filename = utils.get_filename(
       'hostapd', utils.FILENAME_KIND.alive, interface, tmp=True)
 
+  # Don't use alivemonitor on Windcharger since no waveguide. b/32376077
+  if _is_wind_charger() or experiment.enabled('WifiNoAliveMonitor'):
+    alive_monitor = []
+  else:
+    alive_monitor = ['alivemonitor', alivemonitor_filename, '30', '2', '65']
+
   utils.log('Starting hostapd.')
-  utils.babysit(['alivemonitor', alivemonitor_filename, '30', '2', '65',
-                 'hostapd',
+  utils.babysit(alive_monitor +
+                ['hostapd',
                  '-A', alivemonitor_filename,
                  '-F', _FINGERPRINTS_DIRECTORY] +
                 bandsteering.hostapd_options(band, ssid) +