Commit Graph

1108 Commits

Author SHA1 Message Date
Lorenzo Colitti
4ea70b7743 Add address flags and scope to LinkAddress.
This is necessary so that the framework can know whether an IPv6
address is likely to be usable (i.e., if it's global scope and
preferred). Also, it will simplify the address notification
methods in INetworkManagementEventObserver, which currently take
the address, the flags, and the scope as separate arguments.

1. Add flags and scope to the class and update the unit test.
   Use the IFA_F_* and RT_SCOPE_* constants defined by libcore.
   Since most callers don't know about flags and scope, provide
   constructors that default the flags to zero and determine the
   scope from the address. Addresses notified by the kernel will
   have these properly set. Make multicast addresses invalid.
   Update the class documentation.
2. Provide an isSameAddressAs() method that compares only the
   address and prefix information between two LinkAddress
   objects. This is necessary because an interface can't have
   two addresses with the same address/prefix but different
   flags.
3. Update LinkProperties's addLinkAddress and removeLinkAddress
   to identify existing addresses to add/remove using
   isSameAddressAs instead of implicit equals(). Specifically:
   - If addLinkAddress is called with an address that is already
     present, the existing address's flags and scope are updated.
     This allows, for example, an address on an interface to go
     from preferred to deprecated when it expires, without it
     having to be removed and re-added.
   - If removeLinkAddress is called with an address that is
     present but with different flags, it deletes that address
     instead of failing to find a match.
4. Update the INetworkManagementEventObserver address
   notification methods to take just a LinkAddress instead of
   LinkAddress, flags, and scope. While I'm at it, change the
   order of the arguments for consistency with the other
   functions in the interface.

Change-Id: Id8fe0f09a7e8f6bee1ea3b52102178b689a9336e
2013-12-06 13:54:35 +09:00
Lorenzo Colitti
8fc3d9a2d9 Merge "Minor changes to LinkAddress." 2013-12-04 01:21:07 +00:00
Lorenzo Colitti
64eb7fdb64 Minor changes to LinkAddress.
1. Simplify the parceling code. Since the InetAddress inside a
   LinkAddress can never be null, we don't need to special-case
   the case where it is.
2. Add / update method documentation.
3. Write a unit test.

Change-Id: Iba0a8cecc683d55d736419965e72ee33dd66dc22
2013-12-03 19:46:36 +09:00
Lorenzo Colitti
3ac3fea4e7 Use LinkAddress in address notifications.
Currently address{Updated,Removed} pass in the address as a
string such as "fe80::1/64". Use LinkAddresses instead, since
that's what it is.

This makes the code more robust in the unlikely case that netd
passes in an invalid string. In the future we can move flags and
scope into the LinkAddress itself and simplify the code further.

Bug: 9180552
Change-Id: I66599f9529cf421caa7676fdd0141bb110b8589e
2013-11-26 21:55:15 +09:00
Lorenzo Colitti
ea5c0e2c48 Pass DNS server info notifications to observers.
These are sent if the device receives IPv6 Router Advertisements
with DNS server configuration options. Currently, nothing listens
to them; in a future change we will use them as IPv6 DNS servers.

[Cherry-pick of d3b7821c8f]

Bug: 9180552
Change-Id: I05000c0cd3867a68ab390102e8470b6912a9d3aa
2013-11-25 17:27:17 +09:00
Lorenzo Colitti
1f7e433a86 Minor cleanups to NetdCallbackReceiver.onEvent.
- Clean up identical error messages.
- Fix the array length check for InterfaceAddressChange.

[Cherry-pick of 4f85a08091]

Bug: 9180552
Change-Id: Id871f481445b530c3ad749725f1548df0e3a1228
2013-11-25 17:25:45 +09:00
The Android Open Source Project
b4c0ead90f Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD
Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
2013-11-22 11:18:57 -08:00
Robert Greenwalt
639aed7172 am 3d666581: Merge "Fix for the invalid Global Proxy Setting"
* commit '3d66658106600473851b8b868b20b8c11fad8c7d':
  Fix for the invalid Global Proxy Setting
2013-11-13 16:27:56 -08:00
Robert Greenwalt
3d66658106 Merge "Fix for the invalid Global Proxy Setting" 2013-11-14 00:23:04 +00:00
Robert Greenwalt
48eded0e8f am 18490abd: Merge "Fix NPE in ConnectivityService"
* commit '18490abd9bcb401f0d75a314056fb2a44dd61f07':
  Fix NPE in ConnectivityService
2013-11-13 10:25:30 -08:00
Ken Mixter
7caa36a51a Fix NPE in ConnectivityService
Could occur when requestRouteToHostAddress is called on a network
with no associated tracker.  Code later in the method handles
this case gracefully but code introduced in JB throws an exception.

Change-Id: I6c8a0e313ecbcca120aeb5dd0802a72114749aa1
2013-11-12 22:17:46 -08:00
Raj Mamadgi
6bc5edab73 Fix for the invalid Global Proxy Setting
b/11598568

Adding validation for Global Proxy setting before it is
being set.

Proxy is validated at the boot time also to make sure
the value set is valid.

Change-Id: Ib93d24a80af1a329694f07c47bd81dfcc1e1b874
Signed-off-by: Raj Mamadgi <rmamadgi@sta.samsung.com>
2013-11-12 21:14:02 -05:00
Ed Heyl
15af1a1207 am e704c3c9: am 41e6e50c: merge in klp-release (no-op)
* commit 'e704c3c9ee6a9ed2b7fbf34a0fcf70b0062d0dfb': (27 commits)
  Fix dock rect calculation when nav is translucent.
  Fix registerListener and flush bugs.
  Guard against NPE when using existing process.
  Add missing locking when updating the accessibility node info cache.
  Fix issue #11113111: `dumpsys activity service` is broken
  Revert "Use a build-specific wifi country code"
  Fix CookieSyncManager for WebViewClassic
  Retain IME assignment if no windows accept input.
  KLP/KitKat is now API 19.
  Decouple construction of WebView, CookieSyncManager, WebViewDatabase
  Fix issue #10921903: CTS: android.os.cts.ParcelTest#testReadBundle...
  De-blue the add lock screen widget pressed state
  De-blue notification backgrounds
  Revert behavior to perform onResume.
  PackageManager#queryIntentServices breaks its contract.
  Choosing default paper size for the "Save to PDF" fake printer
  Adding hidden APIs for observing the print jobs state.
  Disallow range selection if the document has unknown page count.
  Missed signal in FusedPrintersLoader.
  Page range validation edge case handling.
  ...
2013-10-16 18:01:53 -07:00
The Android Automerger
caa5f0e86b merge in klp-release history after reset to klp-dev 2013-10-15 21:14:08 -07:00
Robert Greenwalt
680a35ba19 am ec4d5da6: am 1b7f99b9: Merge "Retry captiveportal check even if only one addr" into klp-dev
* commit 'ec4d5da6f99b70768ace085782cf5b24f8697025':
  Retry captiveportal check even if only one addr
2013-10-15 17:37:05 -07:00
Robert Greenwalt
6bfeaeb49b Retry captiveportal check even if only one addr
We're getting some false positive results on this check and
while it was coded to try 3 times given sufficient independent addrs
the default url resolves to a single address so we'd just try once.

Rework to try again even with fewer urls to try to reduce the false
positives.

Also adds a random query param to fool proxies into not caching.

bug:9972012
Change-Id: Ib719f40ec612065ca6bcd919549fc1164506d35a
2013-10-15 12:43:30 -07:00
The Android Automerger
75930bca78 merge in klp-release history after reset to klp-dev 2013-10-13 06:01:56 -07:00
Jason Monk
4c6caa5172 am 6b57033b: am 8b81a638: Merge "getProxy in ConnectivityService returns port w/PAC" into klp-dev
* commit '6b57033b022890242d6833b494040c360af691d0':
  getProxy in ConnectivityService returns port w/PAC
2013-10-10 16:05:48 -07:00
Jason Monk
445cea8371 getProxy in ConnectivityService returns port w/PAC
Changes the PacManager to report message back to ConnectivityService
to send a broadcast once the download has completed.  This allows the
ConnectivityService to store the correct proxy info for getProxy().

This made the problem arise that ProxyProperties was not handling port
while it had PAC.  Added small fix for equals() and parcelization.

The combination of these fixes seems to resolve Bug: 11028616.

Bug: 11168706
Change-Id: I92d1343a8e804391ab77596b8167a2ef8d76b378
2013-10-10 17:01:45 -04:00
Dianne Hackborn
5b18a40d3a Fix issue #11113111: dumpsys activity service is broken
Change-Id: Ie02d27b377c562085ef7eb5dea144ce2f382c11d
2013-10-09 14:34:04 -07:00
The Android Automerger
87921134ed merge in klp-release history after reset to klp-dev 2013-10-09 06:01:14 -07:00
Lorenzo Colitti
cf9596ddee am 18225508: am 49052093: Merge "Fix captive portal detection on IPv6 networks." into klp-dev
* commit '18225508dd8c9d833c1699ad17a6bba4e4a46c4f':
  Fix captive portal detection on IPv6 networks.
2013-10-08 19:18:51 -07:00
Lorenzo Colitti
490520930e Merge "Fix captive portal detection on IPv6 networks." into klp-dev 2013-10-09 02:14:43 +00:00
Ed Heyl
3ac333722e am 4951ebb9: am f372ba45: merge in KQS81M
* commit '4951ebb9659c8118051d873310754bb161614503': (78 commits)
  wappush: Use valid index for pdu including garbages
  ImageReader: fix the 0 crop rect size issue
  Hide Experimental WebView from dev settings DO NOT MERGE
  Clear names from externally supplied WorkSources to WifiManager (b/10733757)
  Only show launcher for the bottom activity in a task
  Fix issue #10310128: CTS: android.security.cts.ServicePermissionsTest
  Ensures that CompatibilityInfo is always set in Resources
  Put soundpooled sounds in the right place.
  Fix a regression in pausing activity immediately on sleep
  TextureView/GLES20Canvas: Support synchronous GLConsumers
  Debug for b/10689184.
  Increasing visibility of pressed feedback for default ui widget assets
  Use a separate thread for services that do NTP lookup
  Also catch one more tablet layout NPE.
  Fix tablet layout and resources.
  New sounds for K.
  Do not assign InputMethod to non-input windows.
  Fix parenthetical error.
  Fix media stress test.
  Update the Connectivity Manager test suit to use InstrumentationTestCase.
  ...
2013-10-08 15:54:03 -07:00
Ed Heyl
f372ba4500 merge in KQS81M 2013-10-08 15:40:08 -07:00
Lorenzo Colitti
e25513dccc Fix captive portal detection on IPv6 networks.
Currently the captive portal check URL is generated by
concatenating scheme, "://", IP address, and port. This breaks
for IPv6 because IPv6 addresses in URLs must be enclosed in
square brackets (e.g., http://2001:db8::1/generate_204 is
invalid; should he http://[2001:db8::1]/generate_204 instead).
The resulting MalformedURLException causes isMobileOk to report
that there is no captive portal, even if there is one.

Fortunately the three-arg URL constructor already knows how to
construct URLs with IPv6 addresses. Use that instead of
generating the URL ourselves.

Bug: 10801896
Change-Id: I02605ef62f493a34f25bb405ef02b111543a76fd
2013-10-08 14:15:14 +09:00
The Android Automerger
3e90601b96 merge in klp-release history after reset to klp-dev 2013-10-07 06:00:38 -07:00
Robert Greenwalt
50a520b2e8 am 81d1af26: am 7922764b: am 81371b98: (-s ours) am 64e02e64: am 5a1519f8: DO NOT MERGE Un-deprecate getDhcpInfo
* commit '81d1af2605f43a8f6722371a8d3f2d0f81a8d5f2':
  DO NOT MERGE Un-deprecate getDhcpInfo
2013-10-06 18:19:12 -07:00
Robert Greenwalt
5d772b6f98 am 8070ffcc: am 319323d7: am 8fbc8797: (-s ours) am 202965ca: am 5b41b261: (-s ours) DO NOT MERGE Un-deprecate getDhcpInfo
* commit '8070ffccbbb55721edd4ac014d6a675439a9926e':
  DO NOT MERGE Un-deprecate getDhcpInfo
2013-10-06 18:19:09 -07:00
Robert Greenwalt
7922764bb5 am 81371b98: (-s ours) am 64e02e64: am 5a1519f8: DO NOT MERGE Un-deprecate getDhcpInfo
* commit '81371b981e192f1848d355338c376a6bcd4ff532':
  DO NOT MERGE Un-deprecate getDhcpInfo
2013-10-06 17:11:00 -07:00
Robert Greenwalt
319323d7b0 am 8fbc8797: (-s ours) am 202965ca: am 5b41b261: (-s ours) DO NOT MERGE Un-deprecate getDhcpInfo
* commit '8fbc879773a7163fc2f97d6a6612dfb3167ad7f0':
  DO NOT MERGE Un-deprecate getDhcpInfo
2013-10-06 17:10:57 -07:00
Robert Greenwalt
81371b981e am 64e02e64: am 5a1519f8: DO NOT MERGE Un-deprecate getDhcpInfo
* commit '64e02e64341d33edda1d0ec28d5394c8d0d6509e':
  DO NOT MERGE Un-deprecate getDhcpInfo
2013-10-06 17:03:59 -07:00
Robert Greenwalt
8fbc879773 am 202965ca: am 5b41b261: (-s ours) DO NOT MERGE Un-deprecate getDhcpInfo
* commit '202965ca2a6cd02840581813f2b60660c71baf60':
  DO NOT MERGE Un-deprecate getDhcpInfo
2013-10-06 17:03:56 -07:00
The Android Automerger
d054fdbf47 merge in klp-release history after reset to klp-dev 2013-10-06 06:01:24 -07:00
Robert Greenwalt
64e02e6434 am 5a1519f8: DO NOT MERGE Un-deprecate getDhcpInfo
* commit '5a1519f8d1ff7e9623a347ca138ca925e07844cd':
  DO NOT MERGE Un-deprecate getDhcpInfo
2013-10-04 14:17:18 -07:00
Robert Greenwalt
202965ca2a am 5b41b261: (-s ours) DO NOT MERGE Un-deprecate getDhcpInfo
* commit '5b41b261dbef993bab7a68f61088274a977f345e':
  DO NOT MERGE Un-deprecate getDhcpInfo
2013-10-04 14:15:52 -07:00
Robert Greenwalt
51ff2b0d9e am 2e23484e: am 990c224f: Merge "Un-deprecate getDhcpInfo" into klp-dev
* commit '2e23484eec2321537e843168f76cba4c18b56f95':
  Un-deprecate getDhcpInfo
2013-10-04 13:34:08 -07:00
Robert Greenwalt
978c8728f5 am 32c9cd84: am 939def7d: Merge "Don\'t redirect dns to an iface without dns servers" into klp-dev
* commit '32c9cd84034512f54fe05c66fd73279c8f1ca596':
  Don't redirect dns to an iface without dns servers
2013-10-04 13:34:05 -07:00
Robert Greenwalt
5b41b261db DO NOT MERGE Un-deprecate getDhcpInfo
Replacement api isn't available.

bug:10003785
Change-Id: I0c91716d9aae61dc1db4d015a78b729157ea99a9
2013-10-04 18:43:29 +00:00
Robert Greenwalt
990c224ffa Merge "Un-deprecate getDhcpInfo" into klp-dev 2013-10-04 18:07:34 +00:00
Robert Greenwalt
939def7d91 Merge "Don't redirect dns to an iface without dns servers" into klp-dev 2013-10-04 18:06:13 +00:00
Robert Greenwalt
50df961cca Un-deprecate getDhcpInfo
Replacement api isn't available.

bug:10003785
Change-Id: Ibe981ae90e1c6c2f1b65fa225443ae4cc92c2a3a
2013-10-04 09:53:39 -07:00
Robert Greenwalt
5a1519f8d1 DO NOT MERGE Un-deprecate getDhcpInfo
Replacement api isn't available.

bug:10003785
Change-Id: I0c91716d9aae61dc1db4d015a78b729157ea99a9
2013-10-04 08:19:37 -07:00
Wink Saville
6ed7bfda87 am fe587dba: am a48ccdd6: Merge "Use networkType to display wifi and mobile notification separately." into klp-dev
* commit 'fe587dba3a70c658140eac1b13996b7d8e6eeda2':
  Use networkType to display  wifi and mobile notification separately.
2013-10-03 21:30:29 -07:00
Wink Saville
a65f473111 Use networkType to display wifi and mobile notification separately.
There are two bugs one is I was clearing the notification in
CaptivePortalTracker when entering the ActivateState. (double check
according to bug 5021626 we should be calling enter)

Second is we could have the need to display both icons but can't
because we only allow one.

The solution I'm proposing here is to allow two notifications and
have then controlled separately.

Bug: 10886908
Change-Id: I30e7130bc542535492d175640a4990c592f32806
2013-10-03 08:34:46 -07:00
Robert Greenwalt
68534c89f7 Don't redirect dns to an iface without dns servers
bug:10115444
Change-Id: Ide42072bb3aae21f8e99c11c2de263e9a765b911
2013-09-25 16:58:45 -07:00
The Android Automerger
9d6d1a1ace merge in klp-release history after reset to klp-dev 2013-09-16 06:01:18 -07:00
Wink Saville
f5c393eb7e Tighten condition for calling checkMobileProvisioning.
Add the condition that the connected network needs to be TYPE_MOBILE.
This eliminates checking on connecting to secondary networks like
FOTA, MMS, SUPL ...

This reduces unnecessary attempts to bring up multiple connections at
the same time. Especially in the light of the trouble we're having with HFA
on Sprint, where we don't want to connect to any other network until HFA
has completed.

Bug: 10758001
Change-Id: Id294536b70304a51de4752bc1a4ffac734f10f1a
2013-09-14 14:01:03 -07:00
Wink Saville
3418e65e81 am 78d0cf79: Merge "Tighten condition for calling checkMobileProvisioning." into klp-dev
* commit '78d0cf7958dfde7951ed1a2c0317e04d6b41f4f3':
  Tighten condition for calling checkMobileProvisioning.
2013-09-14 11:21:07 -07:00
Wink Saville
ab773a7b89 Tighten condition for calling checkMobileProvisioning.
Add the condition that the connected network needs to be TYPE_MOBILE.
This eliminates checking on connecting to secondary networks like
FOTA, MMS, SUPL ...

This reduces unnecessary attempts to bring up multiple connections at
the same time. Especially in the light of the trouble we're having with HFA
on Sprint, where we don't want to connect to any other network until HFA
has completed.

Bug: 10758001
Change-Id: Id294536b70304a51de4752bc1a4ffac734f10f1a
2013-09-14 09:04:53 -07:00