android
android copied to clipboard
Sensor for Private DNS function on Android
Is your feature request related to a problem? Please describe.
When i forget to re enable private DNS function in Android, i'd like homeassistant to know, so I can send a notification.
Describe the solution you'd like
Expose, if possible, an optional sensor to HA having as value the state of the private DNS function on my android device. (on/off/private)
Describe alternatives you've considered, if any
NA Additional context
I think this is possible using 'getPrivateDnsServerName' api 28+
For our app its usually best if we can find a method that works all the way down to API level 21 (if possible). Taking a brief look we may be able to leverage
https://developer.android.com/reference/android/net/NetworkCapabilities#TRANSPORT_VPN
This post may give a clue to the implementation :) https://stackoverflow.com/a/55609059 Looks like may be API minimum 23 if we go this route
the API listed in the comment above could probably be used as an attribute for the sensor as I would imagine TRANSPORT_VPN
will always be there whether or not its a private VPN?
Looking into this sensor to expose the transport type being used, hopefully it will work for your use case
Disregard my comments, for some reason I confused DNS for VPN 🤦