title: Disable captive portal checking on Android 9
body: <p>How does one completely disable captive portal checking on Android 9 (on a Moto G7 Play in my case)?</p>
  
  <p>Answers to similar questions, here and on other sites, suggest to change settings through the ADB shell.</p>
  
  <p>What I have set so far with <code>adb shell</code>:<br>
  <code>settings put global captive_portal_mode 0</code><br>
  <code>settings put global captive_portal_server 127.0.0.1</code><br>
  <code>settings put global captive_portal_http_url localhost</code><br>
  <code>settings put global captive_portal_https_url localhost</code><br>
  <code>settings put global captive_portal_fallback_url localhost</code><br>
  <code>settings put global captive_portal_detection_enabled 0</code>  </p>
  
  <p>Some of these settings should be redundant and I think the last one is for older Android versions, but I set all of them anyway to find one that would do the trick.</p>
  
  <p>I restarted the phone and verified the settings with <code>adb settings get</code>. It still continues to contact connectivitycheck.gstatic.com, about 200 times a day.</p>