Commit Graph

624 Commits

Author SHA1 Message Date
Robert Greenwalt
c41962f220 Add has* utility functions to NetworkCapabilities
Change-Id: Icf735b778a3956812be522db39c29cf54c757a25
2014-05-12 18:32:22 -07:00
Lorenzo Colitti
6b4985d8fd Fix reboot loop.
The multinetwork branch is rebooting on startup with:

E/AndroidRuntime( 1024): *** FATAL EXCEPTION IN SYSTEM PROCESS: NetworkStats
[...]
E/AndroidRuntime( 1024): Caused by: java.lang.NullPointerException: Attempt to read from field 'long android.net.NetworkCapabilities.mNetworkCapabilities' on a null object reference
E/AndroidRuntime( 1024): 	at android.net.NetworkCapabilities.<init>(NetworkCapabilities.java:235)
E/AndroidRuntime( 1024): 	at android.net.BaseNetworkStateTracker.getNetworkCapabilities(BaseNetworkStateTracker.java:103)
E/AndroidRuntime( 1024): 	at com.android.server.ConnectivityService.getAllNetworkState(ConnectivityService.java:1134)
E/AndroidRuntime( 1024): 	at com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:877)
E/AndroidRuntime( 1024): 	at com.android.server.net.NetworkStatsService.updateIfaces(NetworkStatsService.java:849)
E/AndroidRuntime( 1024): 	at com.android.server.net.NetworkStatsService.access$600(NetworkStatsService.java:139)
E/AndroidRuntime( 1024): 	at com.android.server.net.NetworkStatsService$2.onReceive(NetworkStatsService.java:717)
E/AndroidRuntime( 1024): 	at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:766)
E/AndroidRuntime( 1024): 	... 4 more

This seems to be due to NetworkCapabilities' copy constructor
not null-checking its argument.  Unbreak things by ignoring null.

Change-Id: Iff3c38e6d72390fa86e51bfce534ebd42a262e19
2014-05-12 18:06:47 -07:00
Robert Greenwalt
d6ee688546 Add NetworkRequest to the multinetwork API
bug:13885501
Change-Id: I7b9a01aadf26b6ff104d088b6e283c838ec4dfac
2014-05-12 17:52:48 -07:00
Robert Greenwalt
3e0c794056 Replace LinkCapabilities with NetworkCapabilities
Also remove unused LinkSocket and LinkSocketNotifier.
bug:13885501

Change-Id: Id426e31b201fa4f29109b5fea485d8efb34519d3
2014-05-12 16:52:56 -07:00
Jason Monk
19c6561c50 Switch PacUrl storage from String to Uri
Since the interface for creating/accessing PAC URLs through a
ProxyInfo is Uri based, so should the internal storage and
references.

Change-Id: Ibf15c350f4cc526f81aba3ec463070f26af8f535
2014-05-12 15:44:32 -04:00
Robert Greenwalt
52cd9bfc48 Add NetworkCapabilities part of API.
Merging to master, adding @hide until we're ready to reveal the API change.

bug:13885501
Change-Id: Ib40e28092e092630bfec557bde77f58eec8ae1c8
2014-05-12 12:12:57 -07:00
Robert Greenwalt
42a0e1ee84 First pass on multinetwork framework
Starting to switch netd to use NetId.
Adding the Network identifying class

bug:13550136
Change-Id: Ie0db4fb17c9300bfafb63329adfa02339911b33d
2014-05-12 10:59:44 -07:00
Jason Monk
0adf31f4b8 Fix Docs breakage
Change-Id: Idaa57d16165203ad38143e493552ddf8a1ff56e5
2014-05-07 18:41:13 -04:00
Jason Monk
4d5e20f870 Make proxy API public
Also exposed proxy-related functions that were on the
ConnectivityManager.

Change-Id: I9fb5f1bcc257a6198679ea1d56e18da2ec5a3b33
2014-05-07 14:23:53 -04:00
Elliott Hughes
d48bb67aac resolved conflicts for merge of e6ae3be8 to master
Change-Id: Id5c5997ad8f801b32e1dbd97413ea42e38c27210
2014-04-28 13:53:25 -07:00
Elliott Hughes
e6ae3be829 am 685a0a72: am bbd87eb9: Merge "Track libcore.os\' move to android.system."
* commit '685a0a72d445515167a2071330679cdf9b53a62d':
  Track libcore.os' move to android.system.
2014-04-28 18:36:53 +00:00
Elliott Hughes
8732b35f51 Track libcore.os' move to android.system.
(This is partial, but should cover everything in AOSP master except
for the zygote.)

Change-Id: I1042c99245765746a744c44e714095cb2c6cb75d
2014-04-28 11:11:32 -07:00
Jaewan Kim
273c161b68 Revert "Refactor IpConfiguration from WifiConfiguration"
This reverts commit e51d2c5ade.

Change-Id: Ibccea84e5dc44c1b8954779660e0721b27f762d4
2014-04-07 09:01:24 +00:00
Jaewan Kim
e51d2c5ade Refactor IpConfiguration from WifiConfiguration
Bug: 7606609, Bug: 8687763
Change-Id: I736eb3c73a8ffc8f137a04a5ea66ee564dc2b530
2014-04-07 11:35:35 +09:00
Ashish Sharma
29f7e0e8ca Include elapsed realtime (nanos) of the event in the radio state change notifications.
Bug: 13247811
Change-Id: I3454aa159a68b9087b4762df947b41965b5a3941
2014-03-18 21:42:02 +00:00
Chad Brubaker
7226f99898 am 1011960c: am decfd707: Merge "Add the calling package name to requestRouteToHost" into klp-dev
* commit '1011960c44a4f84d53d05199fe1ca09be9473822':
  Add the calling package name to requestRouteToHost
2014-03-13 18:18:36 +00:00
Chad Brubaker
edf0ac7298 Add the calling package name to requestRouteToHost
The calling package name will be used to check if an application is a
system application when deciding if a route should be exempt from VPN
routing rules.

Bug: 12937545
Change-Id: I2c09c875fe9bb9685871a0a801ddcbb32fc17405
2014-03-05 13:35:20 -08:00
Yuhao Zheng
dcac3aaf9f Merge "Return detailed reason of invalid proxy settings" 2014-03-04 17:43:47 +00:00
Yuhao Zheng
6b593934d3 Return detailed reason of invalid proxy settings
Make Proxy.validate() return valid/invalid int code, instead of throwing
exceptions. If invalid, detailed reason code is returned (currently for
Settings UI use).

bug: 13248097
Change-Id: Ic68d03f666f1cd63667afc311de7dc370d233901
2014-03-03 11:23:07 -08:00
Dianne Hackborn
5ac8816d55 Hold a wake lock while dispatching network activity events.
Also add new API for determining whether the current data network
is active, and thus better scheduling network operations.  This
API is designed to not be tied to a mobile network -- regardless
of the network, apps can use it to determine whether they should
initiate activity or wait.  On non-mobile networks, it simply always
reports as the network being active.

This changed involved reworking how the idle timers are done so
that we only register an idle timer with the current default
network.  This way, we can know whether we currently expect to
get callbacks about the network being active, or should just always
report that it is active.  (Ultimately we need to be getting this
radio active data from the radio itself.)

Change-Id: Iaf6cc91a960d7542a70b72f87a7db26d12c4ea8e
2014-02-28 15:19:39 -08:00
Chad Brubaker
71e8953171 Add the calling package name to requestRouteToHost
The calling package name will be used to check if an application is a
system application when deciding if a route should be exempt from VPN
routing rules.

Bug: 12937545
Change-Id: I2c09c875fe9bb9685871a0a801ddcbb32fc17405
2014-02-19 11:04:49 -08:00
Jake Hamby
4deacc2420 Add new RIL commands to read/write NV items and reset NV config.
Add new RIL commands and generic code cleanups.

The only changes required for OMA DM support are the
addition of five new methods in ITelephony.aidl for
reading/writing NV items and performing NV config and
radio resets (requires MODIFY_PHONE_STATE), along with
the new RIL request IDs in RILConstants.java.

Bug: 12864208
Change-Id: I958d2571580d98a49936ef2e6822e5ac086acbe2
2014-02-03 15:52:18 -08:00
Hui Lu
451691e2d2 am 3cab7fc1: Merge "Add proxy as another network." into klp-modular-dev
* commit '3cab7fc1b8f06166df3a58cf10d4a0db36bde788':
  Add proxy as another network.
2014-01-31 08:11:57 +00:00
Hui Lu
865b70dfcf Add proxy as another network.
Change-Id: I70cb6ac5604c4f0d6a752a291c40de2445ae98bb
2014-01-30 17:26:18 -05:00
Lorenzo Colitti
86c4687a66 am 263c4788: am 4d60936e: am 24a32d08: Merge "Add address flags and scope to LinkAddress."
* commit '263c4788dcf45f104f8668fd6621d1a7c39689b9':
  Add address flags and scope to LinkAddress.
2013-12-09 18:34:44 +00:00
Lorenzo Colitti
24a32d083f Merge "Add address flags and scope to LinkAddress." 2013-12-07 02:43:04 +00:00
Lorenzo Colitti
61b6582970 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
The Android Open Source Project
943ac81ddf Merge commit 'bac61807d3bcfff957b358cb9ad77850bd373689' into HEAD
Change-Id: I29374270c8e0c2f2859efaf1d55af9f73da0f8d7
2013-12-05 13:10:46 -08:00
Lorenzo Colitti
839363d0ad am 13d9dfb4: am 7dcabe75: am 5a7c768e: Merge "Minor changes to LinkAddress."
* commit '13d9dfb495db1431623c712b36cac1fe2f3c2fc0':
  Minor changes to LinkAddress.
2013-12-04 01:35:11 +00:00
Lorenzo Colitti
7dcabe75aa am 5a7c768e: Merge "Minor changes to LinkAddress."
* commit '5a7c768e799f1af16643a4941353219abace2b56':
  Minor changes to LinkAddress.
2013-12-03 17:26:06 -08:00
Lorenzo Colitti
ee3f442711 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
The Android Open Source Project
6e35df34c9 Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD
Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
2013-11-22 11:18:57 -08:00
John Spurlock
c1455d3014 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Robert Greenwalt
3cfa4fad96 am 61efbf7f: am 4c514f2a: am 594eeb08: Merge "Fix for the invalid Global Proxy Setting" into klp-dev
* commit '61efbf7f38292980ec5a2211d8341c1dfb07dfcc':
  Fix for the invalid Global Proxy Setting
2013-11-13 18:47:57 -08:00
Robert Greenwalt
94a718f80b am a3c50d75: Merge "Fix for the invalid Global Proxy Setting"
* commit 'a3c50d75ace37eb07c3fe9dc7756a9c56a4922ff':
  Fix for the invalid Global Proxy Setting
2013-11-13 16:27:56 -08:00
Raj Mamadgi
f3df16221a Fix for the invalid Global Proxy Setting
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.

Signed-off-by: Raj Mamadgi <rmamadgi@sta.samsung.com>
bug:11598568

Change-Id: Idff5ae81119d8143da096b5291ecbfbc5875cbd4
2013-11-14 00:08:21 +00:00
Raj Mamadgi
97eba6ba41 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
Narayan Kamath
ab03543323 Remove captive portal code that has no effect.
Note that this CL does not change any behaviour.

At the center of this change is
CaptivePortalTracker#detectCaptivePortal(), which does nothing
except call back into ConnectivityService. Removing it allows us to
simplify code in ConnectivityService. It also allows us to remove
ConnectivityService#captivePortalCheckComplete which was only ever
called in response to this method.

While this does not change any behaviour, it preserves existing
bad behaviour, i.e, that the CAPTIVE_PORTAL_CHECK NetworkInfo
state does not correspond to actual captive portal detection.
We transition into that state and immediately (and unconditionally)
out of it and into CONNECTED.

Change-Id: Ib3797f956d2db5e3cacaaa53e899d81aa8e958af
2013-10-16 08:10:55 +00:00
Narayan Kamath
b82bc07c9d Fix minor thread corectness issue in NetworkInfo
Hold the right lock while copying info from another
NetworkInfo object to prevent changes being made to it
while the copy is in progress.

Change-Id: I1aa2c29e81e045b0359f957352c438e79e692823
2013-10-14 09:07:40 +00:00
Jason Monk
a69f1b06de 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
Robert Greenwalt
5b1ce8a835 Un-deprecate getDhcpInfo
Replacement api isn't available.

bug:10003785
Change-Id: Ibe981ae90e1c6c2f1b65fa225443ae4cc92c2a3a
2013-10-04 09:53:39 -07:00
Jason Monk
fddacc6045 Merge "Guarantee that PAC Local Proxy owns Port" into klp-dev 2013-09-13 20:31:54 +00:00
Jason Monk
0a9cc50662 Guarantee that PAC Local Proxy owns Port
This changes the PAC support to not broadcast the Proxy information until
the Local Proxy has started up and successfully bound to a port so that
the local proxy information can be guaranteed to be owned by the proxy.

Bug: 10459877
Change-Id: I175cd3388c758c55e341115e4a8241884b90d633
2013-09-13 09:53:26 -04:00
Jeff Sharkey
6cb013235d Merge changes Ib1274847,I2eb2a1bf into klp-dev
* changes:
  Fix SDK build.
  Request all tethering interfaces, fix corruption.
2013-09-11 20:16:59 +00:00
Jeff Sharkey
168cd72f76 Request all tethering interfaces, fix corruption.
netd now tracks statistics for tethered interfaces across tethering
sessions, so switch to asking for all tethering stats.  (Currently
we're double-counting all tethering data, ever since it started
tracking across sessions.)

Also catch OOME to handle corrupt stats files, which we then dump to
DropBox and then start over.

Bug: 5868832, 9796109
Change-Id: I2eb2a1bf01b993dd198597d770fe0e022466c6b9
2013-09-10 21:03:30 -07:00
Yuhao Zheng
b77f15d90b Add a hidden API to toggle airplane mode.
Added a hidden API under ConnectivityManager to toggle airplane mode.
This may be a temp solution for b/10653570.
bug:10653570

Change-Id: I0b2b42230073289eb8dc6891317d62b84e26c133
2013-09-10 09:57:12 -07:00
Ying Wang
cb5620b2c4 Fix docs build.
Change-Id: I6fd0d711b2cc7726fdaa9119ee467ed6fab82de1
2013-09-06 22:53:16 -07:00
Robert Greenwalt
39dd04c648 Fix the build.
Change-Id: Ia5d29de9db7ea8fd467b3bde551a8cfb95877b41
2013-09-06 16:49:37 -07:00
sy.yun
4aa73924fd Setting MTU size for specific network.
Able to config network specific MTU size. Normally, the default size of MTU is 1500.
 US - ATT 1410, TMUS 1440, SPRINT 1422
 KR - SKT 1440, KT 1450, LGU+ 1428
 JP - KDDI 1420, SoftBank 1340
 CA - RGS 1430, FIDO 1430, MTS 1430, BELL 1358, SaskTel 1358
 AU - TEL 1400

Bug: 10195070
Change-Id: Ie18650b37a3d44af944f2dae4aa97c04fb12cd5e
2013-09-06 15:26:19 -07:00
Wink Saville
1256d3e505 am 55c4f2aa: am 50f86448: am 59a9884b: Merge "Do not change NetworkInfo.DetailedState." into jb-mr2-dev
* commit '55c4f2aa7a0c6d765cf33e5e403365bc138fc025':
  Do not change NetworkInfo.DetailedState.
2013-09-06 09:19:40 -07:00