Use new "gettetherstats" netd command to retrieve statistics for
active tethering connections. Keep tethering poll events separate
from UID poll, even though they end up same historical structures.
Bug: 5244846
Change-Id: Ia0c5165f6712c12b51586f86c331a2aad4ad6afb
As init now uses SIGKILL to stop daemons, performing graceful shutdown
becomes impossible. Here we implement our own solution by asking daemons
to monitor the control socket and terminate when it is closed.
Change-Id: I07a28807173a81b7f95e70f4193e974317acf88a
Currently legacy VPN only works on IPv4, and it should always
turn down when the addresses are changed. It assumed that the
interface will be brought down and up, so the event can be
detected via interfaceStatusChanged(). However, the assumption
was incorrect and the event is actually driver-dependent. To
fix this issue, ConnectivityService now tells VPN that the
interface is down when resetting IPv4 addresses.
Change-Id: I76d15e56552d86635c5b274ca980be5da905a6fb
Well, actually they do go out, but they won't try to start anybody now
until after boot.
bug:5088272
Change-Id: Iaaf7a1e4b300e0afc3901ecfd225a77084bd0954
The kernel sends an interface down event for usb0 when RNDIS is enabled.
Ignore this and only remove USB interfaces when we receive the
interface removed event.
Change-Id: I1458f259b96c9fab4d3a69a5692e630123fad136
Signed-off-by: Mike Lockwood <lockwood@android.com>
The set config will only update hostapd config file right now and we need to restart after that happens.
Also, softap interface is changed to be the regular interface
Bug: 5069108
Change-Id: Ibe80129b58e5339f06f186870bcd8f37569c6db3
The previous approach no longer works with the new USB drivers, since the usb0
interface is no longer enabled by default.
This introduced a chicken & egg problem - usb0 will not be enabled until the
user tries to start tethering, but Settings will not enable the checkbox unless
usb0 is enabled.
To fix this we add an explicit call to start USB tethering in the connectivity manager.
This will enable RNDIS if necessary and then bring up tethering once usb0 is enabled.
Change-Id: Iae1f733366aa6b0dafa66d4c97207794173ef54b
Signed-off-by: Mike Lockwood <lockwood@android.com>
Some VPN needs more time than others in order to create the secure tunnel.
For example, L2TP/IPSec PSK on average needs 15 seconds on WiFi. On mobile
connection, variation gets larger, and it sometimes needs more than 30
seconds. This change increases timeout period from 30 to 60 seconds.
Change-Id: I6006fd254a7bc91c22f63d2f3f20ea79ee9b05e2
This is a 1st pass at receiving events that indicate
some quota has been reached e.g. warning quota, data collection quota,
cutoff quota,...
It needs:
- new kernel with quota2 logging support
- new net:bandwidthcontroller that supports
. quota2,
. setting alerts.
- new NetlinkEvent/NetlinkManager/NetlinkHandler to process
NETLINK NFLOG messages.
Change-Id: Ibfbb13512c5350cdee0e544ec14caa6f59812409
1. No more End-Of-Arguments.
2. Daemons close the control socket after they are initialized.
3. No more system properties.
4. ip-up-vpn now creates state to pass the configuration.
5. JNI methods are split again for legacy VPN.
Change-Id: I02fafdf01d425c965345ef712b2bd5fdee3a0cab
The new link-status netlink monitor is a bit chatty and we were getting race conditions.
The wl0.1 soft-ap interface was getting created, but in the off state. We would report
it available (link-added always reports it) causing wifi to start tethering, but then
we'd sometimes get a link-status-down notification and a link-status-up, causing wifi
to freak out with these two requests.
The simple fix was to not listen to the new link-status notifications. This should be
redesigned in the future.
bug:4983942
Change-Id: Ica4f34d8bf2a07fc19b35a1e15283a7f8022165e
When someone tries to revoke packageA, it is possible that packageA is
already revoked by packageB. In this case packageB should not be revoked,
and the new prepare() can help solve this problem.
Change-Id: Iee056a191dd99467b8ad1b5379a17b02d404bad1
After unreverting the linkstate change patch, hook up notification handlers
that didn't exist when the first patch was created, like
EthernetDataTracker.java and Vpn.java.
For the observers that handle interfaceStatusChanged(), I made
interfaceLinkStatusChanged() call it so they both do the same thing.
Change-Id: I0077e5e5f48f3932ba98f5bf363243892f2de6cc
Signed-off-by: Mike J. Chen <mjchen@google.com>
This reverts commit 1a7e67190228a8ff3b92e7e5496a8db8ff306cca.
Bring back the changes from Stan Chesnutt regarding link-status-change
notifications. The comment from the original patch was:
Propagate new link-status-change message to any NetworkManagementService
observers. Also fix the syntax of the "interface-status-change" message. Add
a null handler in the ThrottleService and Tethering classes (plus fix names).
Change-Id: I42cbed692024de32275cad234f42ff23ab7e9d8d
Signed-off-by: Mike J. Chen <mjchen@google.com>
Due to the property trigger on persist.sys.usb.config,
setting the default function also sets the current function.
Now we combine both of these methods into setCurrentFunction, which has
a "makeDefault" option to make the new function the default.
This change should eliminate some problems with setting properties due to
multiple property triggers happening at the same time.
Change-Id: I9851299e9c2ee20475eada1a8104c0d50bf5a9e1
Signed-off-by: Mike Lockwood <lockwood@android.com>
Used to use iface names, but on mobile ifaces are multipurpose.
Refined to use ConnectivityService types.
bug:4530116
Change-Id: Iaa632d5f540d27ffff683bd7d94f8004bf422e71
Remove obsolete RNDIS support from NetworkManagementService
This change fixes USB tethering, which broke after the new USB gadget driver
changes went in.
Change-Id: Idd987fb2c39c40e81ebc92e6d8dae9fe77ed4ddc
Signed-off-by: Mike Lockwood <lockwood@android.com>
This might not be the best place for the glue code, but it is
known that choosing VpnBuilder will introduce a dependency
cycle of VpnBuilder, ConnectivityService, and the Vpn class.
Change-Id: I3f03617d1fe1a0b8fb3705c23265676fff51a75c
Note that VpnConfig is for internal use only.
Also remove hidden methods from ConnectivityManager.
Change-Id: Ic298c4dc9a2c6c452bd8f4be6fa84e7ac489c0c4
This removes the dependency of android_util_Binder.h.
This change also removes some redundant zeroing.
Change-Id: Ie9fedd471dfa198f9a3261e03651f945cefbbf61