summaryrefslogtreecommitdiffstats
path: root/services/midi/java
diff options
context:
space:
mode:
authorFil Bergamo <fil.bergamo@riseup.net>2017-08-04 22:44:51 +0000
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-08-13 01:57:36 +0200
commit9971175ea84fdbaf2d4671e30460792385b28859 (patch)
tree32c923c0adb7f93a2d2d995e7040c9791d2cb56b /services/midi/java
parenta0ce80942766948d4cd1036b97e2ee721ed8ecce (diff)
downloadframeworks_base-9971175ea84fdbaf2d4671e30460792385b28859.tar.gz
frameworks_base-9971175ea84fdbaf2d4671e30460792385b28859.tar.bz2
frameworks_base-9971175ea84fdbaf2d4671e30460792385b28859.zip
Fix "RepWifi connection not correctly reported to userspace apps" Issue #1792.
When a WiFi connection is established using an external dongle via the RepWifi app, although it's perfectly working, the framework still presents the WiFi connection as disabled or disconnected to the user-space apps. This misleads apps that rely on this mechanism, so that they prevent the user from doing network-related tasks. This patch solves the issue by modifying getActiveNetworkInfo() method in ConnectivityService.java, adding a basic mechanism to check if the WiFi interface is connected. java.net.NetworkInterface.getByName() is used to look for either "wlan0" (RepWifi) or "rndis0"(Tethering). If any one of the two interfaces is present, getInetAddresses() is called on it, to see if it has any IP address. If the interface has an IP address in the "local" range (e.g. 192.168.x.x), then it is considered to be connected. So an instance of android.net.NetworkInfo is created, and its state is set as "Connected". Finally, that instance gets returned to the caller. The result should be so that user-space apps are now able to "see" the internet connection made via RepWifi or via reverse tethering. Signed-off-by: Fil Bergamo <fil.bergamo@riseup.net> Reviewed-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Diffstat (limited to 'services/midi/java')
0 files changed, 0 insertions, 0 deletions