47 Commits

Author SHA1 Message Date
Robert Greenwalt
7e48e76cab Merge "Start using NetworkUtils.numericToInetAddress." 2011-03-02 12:10:51 -08:00
Robert Greenwalt
e590373ea7 Start using NetworkUtils.numericToInetAddress.
Generates InetAddresses without risking an accidental dns lookup.  For use with supposedly
numeric-only ip address strings.

Change-Id: I694f3976ce1c6382854706f6557ea88a289add3a
2011-03-02 11:37:32 -08:00
Mike Lockwood
c4308f01c9 Move USB framework support from android.hardware to android.hardware.usb package
Change-Id: I00fd4f0caaa4aebe48f71c576bb211b5f38bf88d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-01 08:07:20 -08:00
Robert Greenwalt
b979f79158 Remove more use of netmask
bug:2542681
Change-Id: Ifd75672739ee8262d4df22afd8173e4f3f67260d
2011-02-14 14:32:33 -08:00
Robert Greenwalt
ed12640932 Bind addr and prefixLength together in LinkAddress
bug:2542681
Change-Id: I90200446216d78c676498144946832afe75efdb8
2011-01-28 15:34:55 -08:00
Robert Greenwalt
fc8e55850b am 678c6a35: am d14239a2: Merge "Fix tethering when switching default connection" into honeycomb
* commit '678c6a358dc14beb7825b30346ab09df432ba1fe':
  Fix tethering when switching default connection
2011-01-25 10:34:53 -08:00
Robert Greenwalt
05d8936f27 Fix tethering when switching default connection
If the default connection is suitable use that rather than a random interface.
This permits us to deterministically switch back to wifi after hanging out on
DUN APN.

bug:3374236
Change-Id: Iee5137b9f09c358f262e7a62f20282e79f7d889f
2011-01-23 16:04:05 -08:00
Robert Greenwalt
547e4e757b Fix Tethering's handling of a system restart.
A crash of the system server leaves us out of sync with the kernel network setup.
Try to recover.

bug:3241213
Change-Id: I70c0daa0d54ecee6e203bcba2460e8d069305a89
2011-01-18 16:52:16 -08:00
Irfan Sheriff
29552095e1 Pick an upstream interface with valid IP config
As a work around for the issue of picking
the wrong interface, add a check for selecting
an upstream interface that has a valid IP configuration

Bug: 3362306
Change-Id: I01084517cff756c97660b2cfbfa8e9bf26673148
2011-01-17 13:50:48 -08:00
Robert Greenwalt
19b9ab46a9 Turn off DUN connection after tethering.
Use matching feature type when turning tethering off or the request is ignored.

Also, turn on DUN apn right away so that we don't fail aggressive test cases.

Also don't report connections for enabled apn's that we're no longer connected to.

bug:3332880
bug:3338033
Change-Id: I7db2dfd4879f03465bc9f6d39488c078570dcaf3
2011-01-12 15:52:10 -08:00
Robert Greenwalt
e32e812b11 Always file DUN requests for tethering.
A bit of a hack so that first trySetupData call uses the proper APN in
strange edge cases.  Made a new startUsingNetworkFeature string
that ConnectivityService knows means always pass the request to telephony
even if telephony connections are not currently available.

bug:3133178
Change-Id: I2559b9cbaed4b4ec02bdf7ea78e6003ee2be64f2
2011-01-04 11:15:19 -08:00
Robert Greenwalt
1039872f59 Reduce the spinning while tethering.
Doing too much stuff - don't retry when we know we shouldn't.

bug:3293460
Change-Id: Ic7b0b6486b39377d74df7a35572059ac60d03fa0
2010-12-23 17:13:57 -08:00
Mike Lockwood
b92df0f669 Clean up USB notifications:
Add support for separate USB connected and configuration events

Include both USB connected/disconnected and configuration state
in USB_STATE Intent

Remove redundant USB_CONNECTED and USB_DISCONNECTED Intents
Now we just have the sticky USB_STATE broadcast

Move USB disconnnect rebouncing from Tethering to UsbService

Change-Id: Id13eb0c5d51152d2a538985d680ba1db7d2241dc
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-12-14 18:32:59 -08:00
Robert Greenwalt
04808c2940 Fix some IpV4-only code.
InterfaceConfiguration changed to use InetAddress and stop with the string->int->string
conversions.

bug:2542681
Change-Id: I11c4954547333c43bb840fa0469ddde57b0d043b
2010-12-14 14:41:26 -08:00
Mike Lockwood
770126a678 Rename android.hardware.Usb to UsbManager and UsbObserver to UsbService
In preparation for an upcoming change that will make UsbService into a real system service

Change-Id: Id85d624cfc6b10b49a08105cfaaacc667a492c12
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-12-09 22:52:05 -08:00
Brad Fitzpatrick
385a753dea resolved conflicts for merge of 368fdba4 to master
Change-Id: I42b7b433c86a71a5da5db67109f056a280077c9d
2010-10-21 07:39:10 -07:00
Joe Onorato
431bb22695 Reduce logging.
Remember, the system and main logs are
    - Shared resources
    - Primarily for recording problems
    - To be used only for large grained events during normal operation

Bug: 3104855
Change-Id: I136fbd101917dcbc8ebc3f96f276426b48bde7b7
2010-10-19 15:08:05 -04:00
Robert Greenwalt
df255c2283 Stop using unauthorized dns
We were using somebody elses dns without permission - rude.  Switch to using
secondary google public dns.

bug:3045768
Change-Id: I042262bb96d3efed4c0265dc7ff6ac418e4d4f1e
2010-10-07 15:32:08 -07:00
Mike Lockwood
ba56dfce7c DO NOT MERGE Tethering: Delay 1000ms before processing USB disconnect events
This change is already in master

On some devices, switching the USB configuration to enable RNDIS can
result in multiple USB disconnect/reconnect events being generated.

Change-Id: I14b02aaca11bb708f6b3334e41a2f4d4fa7b7296
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-19 14:04:38 -04:00
Jaikumar Ganesh
707952ecd4 Rework Bluetooth tethering networking configuration.
Limit it to 5 for now, and store the iface.

Change-Id: Ia6044b8e8f886dcd587ab0bb57273e0c11b6cd74
2010-09-14 15:25:14 -07:00
Mike Lockwood
6eef5c6876 Tethering: Delay 1000ms before processing USB disconnect events
On some devices, switching the USB configuration to enable RNDIS can
result in multiple USB disconnect/reconnect events being generated.

Change-Id: Id0bfe54293bd51211f84976be2d72f8b1ad0100d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-08-23 14:50:49 -04:00
Danica Chang
6fdd0c6274 bluetooth tethering
Change-Id: Id6d5fb1922facc7013abc29214d3e1141995b767
2010-08-18 15:07:50 -07:00
Mike Lockwood
d8aad91d8c am d5786b98: am c40d714c: Merge "Tethering: Use new ACTION_USB_STATE broadcast to monitor USB connected state" into gingerbread
Merge commit 'd5786b982c90632a4b35fd2d984c4edc4bbdfb0b'

* commit 'd5786b982c90632a4b35fd2d984c4edc4bbdfb0b':
  Tethering: Use new ACTION_USB_STATE broadcast to monitor USB connected state
2010-07-28 04:18:10 -07:00
Mike Lockwood
ac051ae7ac Tethering: Use new ACTION_USB_STATE broadcast to monitor USB connected state
Replaces use of battery status, which will not work on devices that do not
charge over USB.

Change-Id: I1e123bb534d46b890461ddfdee24f81da5798756
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-06-28 16:38:33 -04:00
Robert Greenwalt
924cc94caa Reduce Tethering Logging.
bug:2581886
Change-Id: Ib6243a413c22d80216d83c02dbc9ff4e3bb38db9
2010-06-28 10:27:12 -07:00
Robert Greenwalt
77b32ddbbe Make the DUN apn data secure.
Rather than come out of the user-modifiable APN DB, the DUN APN data will
come first from a built-in resource and then potentially overriden by a secure
setting (which is gservices upgradable).

Also made the "require-dun" setting secure-setting overridable.
bug:2736390

Change-Id: I1e4644c3839f06c977b83797641f3948785146a2
2010-06-04 11:13:34 -07:00
Robert Greenwalt
7eae25021d Move Tethering off the ServerThread.
An ANR has been reported because somebody else was hogging the Netd
link.  We can't pause the server thread for that, so make a new thread.

bug:2609904
Change-Id: I0430a08621da1cda0a0010ce15826cceee59a529
2010-04-20 15:51:20 -07:00
Robert Greenwalt
b37f0c6513 Fix Tethering of multiple downstream ifaces.
We weren't notifying the second tethered iface of it's upstream iface name so its traffic
was not getting routed correctly.
We also weren't clearing out our connected iface name when we untethered, so the route rules
weren't getting flushed when the last tether came down.

Change-Id: I34e5d672ea882c89c8f582d69d6dc421cb52d4b4
2010-03-25 15:29:57 -07:00
Robert Greenwalt
bfb7bfa538 Update Framework to support multiple dhpc ranges
Previously we only supported a single range - this was inadequate for
multiple interfaces.  Adding a second range so we can support
both usb and wifi tethering.

Also moving out of the zero-conf range as our dhcp client won't
accept ip addrs in that range (no nexus to nexus wifi action).

bug: 2537963
bug: 2533491
bug: 2538303
Change-Id: I600b421343c28c2f9839ed2076122ae3d0ff5d3d
2010-03-25 14:46:13 -07:00
Robert Greenwalt
77e638dee8 Fix Tethering when DUN is required but wifi is ok
If the phone is configured to require a DUN connection when on mobile but also accepts
wifi upstream connections, there was a bug in the logic and you'd be left with no
upstream connection.

bug:2533914
Change-Id: I30d44764f578be4cf2c29ee90d39e8563dda06fb
2010-03-22 15:28:09 -07:00
Wink Saville
951749ba2e Use the new HSM capability that allows transitionTo in enter methods.
Change-Id: If87a30257111d4a2b0506428c75eae81a7ccf77b
2010-03-19 09:09:12 -07:00
Robert Greenwalt
db3fe9edd4 Fix Tethering Notifications for multiple ifaces
Used to see multiple notifications if usb tethering and wifi tethering were both used.

bug:2527862
Change-Id: Idc6299c0a70564dd7c8d8d7fe13bde83723134ae
2010-03-19 08:59:20 -07:00
Robert Greenwalt
6a1967c908 Make Tethering not disconnect on every net change.
Tethering will now persist to on (until turned off) through upstream net drops,
tunnels, switches to wifi or 2G, mms sends, etc.  It will also strive to use
the most natural connection and only go to HiPri/Dun APNs when needed.

bug:2519915
bug:2501837
Change-Id: Iedf6647daad8df507d7c87d1130b204b0a0acc7b
2010-03-17 22:06:43 -07:00
Robert Greenwalt
bb51d9feea Fix UMS broadcasts in Tethering.
Now Tethering gets notified of UMS changes.  Turns out UMS Broadcasts
have attached data with a file scheme and the filter had to be set
correctly.

bug:2504908
Change-Id: I67d979000196c90068fe59846b4fa2bbf6ea00d8
2010-03-12 11:42:09 -08:00
Robert Greenwalt
dfadaeac08 Stop creating threads for tethering.
Use the passed in looper and save threads.

Change-Id: I6db04ef64e339a5fb2b71e9fb1da32e2d600447c
2010-03-11 15:39:30 -08:00
Robert Greenwalt
030f5e18df Disable USB Tethering when UMS is active
Make the tethering module aware of UMS.

bug:2469818
Change-Id: I29995812db41bf01a17c303f31fd1707a8d55328
2010-03-10 16:51:35 -08:00
Robert Greenwalt
a599fe7c0d Re-add tethered notification to framework.
Add new artwork and string.

Change-Id: I9c4b2b4bdbd10ee9355c3a7ca81b29fba3b5830c
2010-03-09 11:20:13 -08:00
Robert Greenwalt
e7085e909d Update framework tethering UI
Getting rid of notification dialog - maybe the entire TetherActivity.
Also getting rid of toasts - to ephemeral.
2010-03-04 18:20:58 -08:00
Robert Greenwalt
5a73506cdd Add error reporting for Tethering.
Also make the usb interface configuration more robust so retries are possible.

Makes all Tethering errors recoverable - no harm letting them try again anyway.  Worst case
is they need to reboot.
2010-03-03 15:14:29 -08:00
Robert Greenwalt
c9d5fb7c95 Add build options for tethering.
Dun-required bool and list of allowed upstream ifaces.
2010-02-26 17:48:09 -08:00
Mike Lockwood
1cb3cb1a94 Tethering: Use battery changed broadcast instead of UMS broadcast to determine
when USB is connected and disconnected.

This is needed because the UMS broadcasts will not be sent when UMSis disabled.

Change-Id: I4488fee2c19ac9c901596d1430ea371df97e4325
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-26 18:00:58 -05:00
Robert Greenwalt
d70a3d4e2d Tethering improvements.
Changes due to comments.
Fixing Tether teardown.

bug:2422545
2010-02-24 18:03:40 -08:00
Robert Greenwalt
6142a0b68f Fix build.
clicked "submit" on I65ae29bd when I shouldn't have.

Fixing according to comments and a build error change.
2010-02-23 18:15:29 -08:00
Robert Greenwalt
65ae29bd85 Add USB RNDIS enable/disable control
Also adding interface configuration to the tethering machine.
Also fixing netd bug that didn't send up/down portion of iface config command.
2010-02-23 16:04:41 -08:00
Mike Lockwood
a4437fc93a Fix null pointer exception in connectivity service broadcast receiver.
Change-Id: I80c7175ffd1a323a02201395ff6092e2ab0fdd1c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-17 07:40:50 -05:00
Robert Greenwalt
2a091d7aa0 Update Tethering.
Adds telephony support, async model, multiple tethered iface suport,
better notifications, device config.

bug:2413855
2010-02-16 16:56:09 -08:00
Robert Greenwalt
d0e18ffb82 First pass at USB Tethering.
bug:2281900
2010-02-04 09:15:06 -08:00