Commit Graph

1683 Commits

Author SHA1 Message Date
Robert Greenwalt
879bd9484d Merge "Report new network scores back to factories." 2014-06-04 18:48:44 +00:00
Lorenzo Colitti
33920d2516 am 7a3077a9: Merge "Make requests for restricted networks not require unrestricted access." into lmp-preview-dev
* commit '7a3077a9a7405048b9cd28452efbc28a857acb25':
  Make requests for restricted networks not require unrestricted access.
2014-06-04 18:46:31 +00:00
Robert Greenwalt
b5a1be98de am cffe6d73: Merge "Fix legacy APIs." into lmp-preview-dev
* commit 'cffe6d7315bc364d913e6a7daf1b62b7d173bfb7':
  Fix legacy APIs.
2014-06-04 18:44:59 +00:00
Robert Greenwalt
85230629df Report new network scores back to factories.
This is a first order approx of what we want - should probably be good enough in most cases.

bug:15277751

Change-Id: I10e3b25f6ad5c7e022ba966ed514d4e6a999180d
2014-06-04 18:38:01 +00:00
Robert Greenwalt
6f82b6b568 am e8f910c6: Fix Legacy NetworkInfo API
* commit 'e8f910c635710e4b2d7f299ba33f6205cc4371e3':
  Fix Legacy NetworkInfo API
2014-06-04 17:03:25 +00:00
Robert Greenwalt
903141778b am ead9aa35: Merge "Refactor NetworkFactory." into lmp-preview-dev
* commit 'ead9aa35d4f5b94d9d602247826ba97afe2b6791':
  Refactor NetworkFactory.
2014-06-04 17:01:56 +00:00
Robert Greenwalt
7beba3f55c am 5fc756c3: (-s ours) Merge "Rewrite startUsingNetworkFeature for new API" into lmp-preview-dev
* commit '5fc756c3f4b7203d53834b9750332325ebf4e92d':
  Rewrite startUsingNetworkFeature for new API
2014-06-04 16:45:02 +00:00
Lorenzo Colitti
2606df8790 Call a network restricted only if all capabilities are restricted
When guessing whether a network is restricted or not (e.g., when
constructing a NetworkCapabilities object from an APN type, or
when constructing a request using startUsingNetworkFeature),
only assume the network is restricted if all the capabilities it
provides are typically provided by restricted networks (e.g.,
IMS, FOTA, etc.).

Previous code would conclude a network was restricted even if it
supported one "restricted" capability, so for example an APN
that provides both Internet connectivity and FOTA was marked as
restricted. This caused it to become ineligible to provide the
default Internet connection, because that must be unrestricted.

Also expand the list of restricted APN types a bit.

Bug: 15417453
Change-Id: I8c385f2cc83c695449dc8cf943d918321716fe58
2014-06-04 20:04:38 +09:00
Lorenzo Colitti
21c178d0a6 Make requests for restricted networks not require unrestricted access.
Currently, calling startUsingNetworkFeature for a restricted APN
type (e.g., IMS or FOTA) will create a request that requires
NET_CAPABILITY_NOT_RESTRICTED. Because these APNs are restricted,
when we bring them up we conclude that it does not match the
unrestricted requirement, and we tear them down.

1. Clear the NET_CAPABILITY_NOT_RESTRICTED capability when
   creating requests in startUsingNetworkFeature.
2. Refactor the code to a common function so this cannot happen
   again.

Bug: 15191336
Change-Id: Id1ec79c58ff79b1a83457ffaecc57d50b61ed4e4
2014-06-04 12:20:06 +09:00
Robert Greenwalt
ae5370cab5 Fix legacy APIs.
Two fixes.  First make sure we mark the request as handled by the network handling it.
Second, convert ensureRouteToHostForAddress to use the new legacyNetworkForType.

bug:14993207
Change-Id: I230968938ca0ed91f834b36a2af60caff2eab682
2014-06-03 17:22:11 -07:00
Robert Greenwalt
802c11080e Fix Legacy NetworkInfo API
Make the connectivity changed broadcasts send correct NetworkInfos.
Also update the results of getNetwork.

bug:15290306
bug:15191336
bug:14993207
Change-Id: Ie99ad25f3ebb90d18348e7013761b139e7481866
(cherry picked from commit 16fe1c18289de200d2249e51db8c0986619f487b)
2014-06-03 14:00:56 +00:00
Robert Greenwalt
03f23bfe91 Fix Legacy NetworkInfo API
Make the connectivity changed broadcasts send correct NetworkInfos.
Also update the results of getNetwork.

bug:15290306
bug:15191336
bug:14993207
Change-Id: Ie99ad25f3ebb90d18348e7013761b139e7481866
2014-06-03 19:58:54 +09:00
Robert Greenwalt
06c734e52e Refactor NetworkFactory.
Make NetworkFactory a concrete class and divide responsibilites between it and NetworkAgent.
Factory will track requests and by default give a single connect/disconnect api for ease
of use.  Then NetworkAgent is created and destroyed as needed with very simple logic.

Change-Id: I401c14a6e5466f2fc63b04219b97ff85bb9af291
(cherry picked from commit 9a17b9c5a256cb4bb14821c5ee89b03b99c045e8)
2014-06-03 01:26:48 +00:00
Robert Greenwalt
3dc73e576b Rewrite startUsingNetworkFeature for new API
bug:14993207
Change-Id: I041a80faa07bf3094af13a6c606f3b15aa03f789
(cherry picked from commit 09fe5e618b09965183cf53fba87c39025a19e8d1)
2014-06-02 23:29:20 +00:00
Robert Greenwalt
70cf11649e Refactor NetworkFactory.
Make NetworkFactory a concrete class and divide responsibilites between it and NetworkAgent.
Factory will track requests and by default give a single connect/disconnect api for ease
of use.  Then NetworkAgent is created and destroyed as needed with very simple logic.

Change-Id: I401c14a6e5466f2fc63b04219b97ff85bb9af291
2014-06-02 16:19:08 -07:00
Robert Greenwalt
857436debf Merge "Rewrite startUsingNetworkFeature for new API" 2014-06-02 23:12:29 +00:00
Sreeram Ramachandran
36a3584cc6 am 5a734bd7: Merge "Support legacy routes added by apps via ensureRouteToHost()." into lmp-preview-dev
* commit '5a734bd78e83afeee5833b56f04ac99113b97542':
  Support legacy routes added by apps via ensureRouteToHost().
2014-05-30 21:39:09 +00:00
Sreeram Ramachandran
9052fa125a Support legacy routes added by apps via ensureRouteToHost().
Change-Id: I0ee1ca89fdc859d75a89021ca8c1902811b1e4a9
(cherry picked from commit fb17b32550de624b7f476b70b7a2fc77f31dde7d)
2014-05-30 18:21:34 +00:00
Sreeram Ramachandran
898d27e7c3 Merge "Support legacy routes added by apps via ensureRouteToHost()." 2014-05-30 03:29:39 +00:00
Sreeram Ramachandran
1e459f2365 Support legacy routes added by apps via ensureRouteToHost().
Change-Id: I0ee1ca89fdc859d75a89021ca8c1902811b1e4a9
2014-05-29 19:00:37 -07:00
Paul Jensen
d4fbd78bb0 am 4477d6aa: Merge "Adjust Network\'s SocketFactory to restrict host name resolution to that Network" into lmp-preview-dev
* commit '4477d6aaadcdf583420b706065cc0753fb91cf3c':
  Adjust Network's SocketFactory to restrict host name resolution to that Network
2014-05-30 01:49:49 +00:00
Paul Jensen
78af47b1a8 am 7df1decc: (-s ours) Merge "Implement bind-to-network functionality of android.net.Network." into lmp-preview-dev
* commit '7df1deccfee0a98234960fa76bd0357f84a614c4':
  Implement bind-to-network functionality of android.net.Network.
2014-05-29 19:23:20 +00:00
Paul Jensen
c3c5babcb1 Adjust Network's SocketFactory to restrict host name resolution to that Network
bug: 13885501

Change-Id: Iab9a5a2e060fe261f4be9ba974c1a55fb6b9c98b
(cherry picked from commit 92064edf55ee11967d9cc7529125236ee8e469b2)
2014-05-29 19:17:06 +00:00
Paul Jensen
80504dbd74 Implement bind-to-network functionality of android.net.Network.
This is implemented by calling through to netd_client.
Included are functions to bind-to-network-for-process strictly for DNS to
facilitate startUsingNetworkFeature() reimplementation.

bug: 13885501

Change-Id: Ib22c7d02ea81d251bdfeeb0f64a47ce32eefcb1b
(cherry picked from commit dbf76f898f1f57eb74722358087c926d2f529bda)
2014-05-29 18:53:57 +00:00
Robert Greenwalt
cff4966327 am 67cf4bad: Merge "Don\'t break things if a network goes back to CONNECTED." into lmp-preview-dev
* commit '67cf4bad7bad05ff0a3a0704305c9eed4c92a338':
  Don't break things if a network goes back to CONNECTED.
2014-05-29 15:20:50 +00:00
Lorenzo Colitti
47f597dfbf Don't break things if a network goes back to CONNECTED.
Currently, if a network goes from CONNECTED to some other "live"
state (e.g., CONNECTING, because it's VERIFYING_POOR_LINK) and
back, ConnectivityService treats it as if a new network had
connected.  This causes it to attempt to create the network
(which fails, since a network with that netid already exists), to
trigger verification, and if the verification succeeds, to tear
down the network because the request it's satisfying is already
satisfied by the network itself.

Instead, if creating the network fails, assume it's because the
network had already been created, and bail out.

Also, when validation completes, ignore NetworkRequests that were
being served by the same NetworkAgent as before.

Bug: 15244052

(cherry picked from commit cfff026ec47afc7e31f60f80e3deea7f4e2f9be5)

Change-Id: I52c2220e8f1d98fca765880be3040593e92722ed
2014-05-29 21:36:07 +09:00
Lorenzo Colitti
9cfd04b64a Merge "Don't break things if a network goes back to CONNECTED." 2014-05-29 12:25:46 +00:00
Lorenzo Colitti
f28fd3d850 Don't break things if a network goes back to CONNECTED.
Currently, if a network goes from CONNECTED to some other "live"
state (e.g., CONNECTING, because it's VERIFYING_POOR_LINK) and
back, ConnectivityService treats it as if a new network had
connected.  This causes it to attempt to create the network
(which fails, since a network with that netid already exists), to
trigger verification, and if the verification succeeds, to tear
down the network because the request it's satisfying is already
satisfied by the network itself.

Instead, if creating the network fails, assume it's because the
network had already been created, and bail out.

Also, when validation completes, ignore NetworkRequests that were
being served by the same NetworkAgent as before.

Bug: 15244052
Change-Id: Ifd73558e5be452d9ef88c64cca429d5f302bf354
2014-05-29 19:19:54 +09:00
Lorenzo Colitti
2bd5d2d8f1 am d925573a: (-s ours) Merge "DO NOT MERGE - Support disconnecting while trying to connect." into lmp-preview-dev
* commit 'd925573af1ceab0d4a447e738f1d8830e552edd1':
  DO NOT MERGE - Support disconnecting while trying to connect.
2014-05-28 21:44:50 +00:00
Paul Jensen
34648fc64d Merge "Adjust Network's SocketFactory to restrict host name resolution to that Network" 2014-05-28 18:26:29 +00:00
Lorenzo Colitti
892331dc08 DO NOT MERGE - Support disconnecting while trying to connect.
Currently, once a NetworkAgent has decided to connect, there's
no way to disconnect without first connecting and having
ConnectivityService tear down the connection. This is suboptimal
because it causes the transport to keep retrying even if it knows
that it will not be able to connect.

Instead, allow the transport to abort a connection request that's
in progress, as long as the agent is not yet registered with
ConnectivityService.

Also add locking to evalScores. evalScores should already have
been taking a lock, because it accesses member variables that are
also accessed by the send*methods.

Bug: 15295359
Change-Id: I913c341bdfc50be9c23b632399f53168e754c1c0
(cherry picked from commit 081e99c3ac341734467b65458f94adc160f50d6c)
2014-05-28 09:29:07 +00:00
Lorenzo Colitti
57a0aba819 Merge "Support disconnecting while trying to connect." 2014-05-28 07:40:50 +00:00
Lorenzo Colitti
0640cdd9fa Support disconnecting while trying to connect.
Currently, once a NetworkAgent has decided to connect, there's
no way to disconnect without first connecting and having
ConnectivityService tear down the connection. This is suboptimal
because it causes the transport to keep retrying even if it knows
that it will not be able to connect.

Instead, allow the transport to abort a connection request that's
in progress, as long as the agent is not yet registered with
ConnectivityService.

Also add locking to evalScores. evalScores should already have
been taking a lock, because it accesses member variables that are
also accessed by the send*methods.

Bug: 15295359
Change-Id: I913c341bdfc50be9c23b632399f53168e754c1c0
2014-05-28 07:35:24 +00:00
Dave Langemak
b1adc41e9a am 4a6a8e5e: Merge "Move dis/enable of mobile data to Telephony" into lmp-preview-dev
* commit '4a6a8e5e3cce491064d6836b59c23fd076de56f2':
  Move dis/enable of mobile data to Telephony
2014-05-27 22:24:21 +00:00
Robert Greenwalt
0c150c0082 Move dis/enable of mobile data to Telephony
ConnectivityService doesn't do this anymore.

bug:15077247
Change-Id: I3208c91b2c0369b594987f39ca29da7478435513
(cherry picked from commit 53013c87496980b534e447e717a32698fbd4bca0)
2014-05-27 20:28:50 +00:00
Robert Greenwalt
25ef738d75 Rewrite startUsingNetworkFeature for new API
bug:14993207
Change-Id: I041a80faa07bf3094af13a6c606f3b15aa03f789
2014-05-27 13:24:14 -07:00
Paul Jensen
e11b6734e7 Adjust Network's SocketFactory to restrict host name resolution to that Network
Change-Id: Iab9a5a2e060fe261f4be9ba974c1a55fb6b9c98b
2014-05-27 10:49:34 -04:00
Dianne Hackborn
78515faff0 am deca2a04: (-s ours) Merge "(DO NOT MERGE) Battery monitoring fixes:" into lmp-preview-dev
* commit 'deca2a041d13846158b0db92781b352ab473d9bc':
  (DO NOT MERGE) Battery monitoring fixes:
2014-05-23 00:11:11 +00:00
The Android Automerger
44efeb3486 am 0c82c484: merge in master-release history after reset to 244e25ef817ddf48727845f14d08b2b787e1ff89
* commit '0c82c484c475422aedf17a8fee5ce3fb1b4290a8': (121 commits)
  am 82ec8c58: am ab3d85ab: am 838b1e22: Merge "Fix NPE in PackageManagerService."
  Fixing bugs due to the new custom accessibility action APIs.
  Should not be closing system dialogs when Recents is hidden. (Bug 15109551)
  Fix a runtime break caused by merge conflict
  Fix typo causing immersive mode transition flickering.
  Fix 64 bit long pointer size for media scanning
  fix argument order in call to SkBlurDrawLooper constructor
  Fix recording of wake_lock_in.
  Fix not being able to pull down status bar.
  Add net.dns system properties
  Battery stats more wake history, power save mode.
  Disable texture atlas
  Fix reboot loop due to NPE.
  Quick fix to ensure mipmap doesn't get stripped by AAPT
  Comment out some new netd calls to fix networking.
  Revert "If PackageUsage information is missing, treat as first boot and compile everything"
  Add api for getting the parent of a profile.
  If PackageUsage information is missing, treat as first boot and compile everything
  Allow setting password restrictions from a managed profile.
  Fix badness from proxy refactoring.
  ...
2014-05-23 00:11:04 +00:00
Dianne Hackborn
3508963dcf (DO NOT MERGE) Battery monitoring fixes:
- Improve monitoring of level changes to not be confused
  when it goes up while draining or down while charging.
- Put back in connectivity service code to tell battery
  stats about the interfaces.
- Turn back on reporting of mobile radio active state
  from the RIL.
- Fix bug in marshalling/unmarshalling that would cause
  the UI to show bad data.

Change-Id: I733ef52702894cca81a0813eccdfc1023e546fce
2014-05-22 16:43:17 -07:00
Dianne Hackborn
a2fabf4d1d Merge "Battery monitoring fixes:" 2014-05-22 17:22:15 +00:00
Dianne Hackborn
8cc6a4994b Battery monitoring fixes:
- Improve monitoring of level changes to not be confused
  when it goes up while draining or down while charging.
- Put back in connectivity service code to tell battery
  stats about the interfaces.
- Turn back on reporting of mobile radio active state
  from the RIL.
- Fix bug in marshalling/unmarshalling that would cause
  the UI to show bad data.

Change-Id: I733ef52702894cca81a0813eccdfc1023e546fce
2014-05-22 09:43:18 -07:00
Paul Jensen
733080b88e Merge "Implement bind-to-network functionality of android.net.Network." 2014-05-22 16:14:21 +00:00
The Android Automerger
da1f6624cf merge in master-release history after reset to 8b8f98b68792a4b5c1650d67d0aa953a7f10aab0 2014-05-22 05:50:24 -07:00
Robert Greenwalt
f5b09c82ca Move dis/enable of mobile data to Telephony
ConnectivityService doesn't do this anymore.

bug:15077247
Change-Id: I3208c91b2c0369b594987f39ca29da7478435513
2014-05-21 21:34:05 -07:00
Paul Jensen
9e66e88160 Implement bind-to-network functionality of android.net.Network.
This is implemented by calling through to netd_client.
Included are functions to bind-to-network-for-process strictly for DNS to
facilitate startUsingNetworkFeature() reimplementation.

Change-Id: Ib22c7d02ea81d251bdfeeb0f64a47ce32eefcb1b
2014-05-22 04:16:54 +00:00
Lorenzo Colitti
347122d298 Delete the EthernetDataTracker.
Code search says these are the only two files that use it. The
tracker will be resurrected in a slightly different form in
frameworks/opt/net/ethernet.

Bug: 14993642
Bug: 14981801
Change-Id: I2477668ca78dfe46661dda1d97c7f786fd7eba35
2014-05-21 16:40:46 -07:00
The Android Automerger
bbcf89abab merge in master-release history after reset to 1e0d82fdb15231d881d94c51f5eb1b30abd4b045 2014-05-21 05:50:19 -07:00
Jaewan Kim
6d8dcb76d8 Move IP config from WifiConfiguration to IpConfiguration.
This is so that Ethernet can use it in the future.

Bug: 7606609
Bug: 8687763

Change-Id: I5d1189682b13f1088848809604690648d8d9ecca
2014-05-20 15:24:10 -07:00
Robert Greenwalt
46dcbab0a2 Add NetworkFactory names and unregistration.
Some Factories come and go (Telephony) and so they need to be able to unregister.
Also, debugging is tough when the factories are anonymous, so add names for logging.

Lastly, only send single set of NetworkRequests to a newly registered NetworkFactory
and only send the requests.

Change-Id: I717d63363f25c446f8ecf38d933b1a35d744af6e
2014-05-20 09:03:57 -07:00