title: How to get encryption type of the current wifi connection without scanning all wifi networks?
body: <p>Is there a way to get wifi encryption type (like WSA, WSA2, WEP) programmatically on Android 6.0+ without using:</p>
  
  <pre><code>WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
  List&lt;ScanResult&gt; networkList = wifi.getScanResults();
  </code></pre>
  
  <p>because I don't want to have to ask user for access to location.</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
  </code></pre>
  
  <p>which appears to be a requirement when scanning wifi networks.  </p>
  
  <p>I am hoping there is a way to get this without having to scan all wifi networks like in the android.net.wifi.WifiInfo class.</p>