Commit graph

13,045 commits

Message SHA1
Merge "Report new network scores back to factories."
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-04 18:48:44 +00:00
515dc898e4
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.

Lorenzo Colitti   authored and   Android Git Automerger   commited 2014-06-04 18:46:31 +00:00
97618013db
am cffe6d73: Merge "Fix legacy APIs." into lmp-preview-dev
* commit 'cffe6d7315bc364d913e6a7daf1b62b7d173bfb7':
  Fix legacy APIs.

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-04 18:44:59 +00:00
66dc60fe8f
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

Robert Greenwalt   commited 2014-06-04 18:38:01 +00:00
5ccc1c5eb6
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

Lorenzo Colitti   authored and   The Android Automerger   commited 2014-06-04 10:46:14 -07:00
1ae327fda7
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

Lorenzo Colitti   authored and   The Android Automerger   commited 2014-06-04 10:46:13 -07:00
d5f87d3552
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

Robert Greenwalt   authored and   The Android Automerger   commited 2014-06-04 10:46:12 -07:00
22db776bf3
am e8f910c6: Fix Legacy NetworkInfo API
* commit 'e8f910c635710e4b2d7f299ba33f6205cc4371e3':
  Fix Legacy NetworkInfo API

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-04 17:03:25 +00:00
b3d4e07986
am ead9aa35: Merge "Refactor NetworkFactory." into lmp-preview-dev
* commit 'ead9aa35d4f5b94d9d602247826ba97afe2b6791':
  Refactor NetworkFactory.

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-04 17:01:56 +00:00
240a1d36a7
am 5fc756c3: (-s ours) Merge "Rewrite startUsingNetworkFeature for new API" into lmp-preview-dev
* commit '5fc756c3f4b7203d53834b9750332325ebf4e92d':
  Rewrite startUsingNetworkFeature for new API

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-04 16:45:02 +00:00
ce66fda8ff
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

Lorenzo Colitti   commited 2014-06-04 20:04:38 +09:00
f7c6e734e9
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

Lorenzo Colitti   commited 2014-06-04 12:20:06 +09:00
74246df4e4
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

Robert Greenwalt   commited 2014-06-03 17:22:11 -07:00
7d19a36be1
merge in master-release history after reset to 632cae1d64b021e2b6c5b87cc59e87481c4e0ba4
The Android Automerger   commited 2014-06-03 13:13:44 -07:00
4f080cec93
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)

Robert Greenwalt   commited 2014-06-03 14:00:56 +00:00
5a367872ce
merge in master-release history after reset to 632cae1d64b021e2b6c5b87cc59e87481c4e0ba4
The Android Automerger   commited 2014-06-03 06:32:06 -07:00
1ad3561715
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

Robert Greenwalt   authored and   Lorenzo Colitti   commited 2014-06-03 19:58:54 +09:00
ce20973ca0
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)

Robert Greenwalt   commited 2014-06-03 01:26:48 +00:00
cf82b83c79
Rewrite startUsingNetworkFeature for new API
bug:14993207
Change-Id: I041a80faa07bf3094af13a6c606f3b15aa03f789
(cherry picked from commit 09fe5e618b09965183cf53fba87c39025a19e8d1)

Robert Greenwalt   commited 2014-06-02 23:29:20 +00:00
b59a91be9f
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

Robert Greenwalt   commited 2014-06-02 16:19:08 -07:00
82b9d2ad42
Merge "Rewrite startUsingNetworkFeature for new API"
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-02 23:12:29 +00:00
3c271afcb4
merge in master-release history after reset to 845d488bc35eece8a2e46912164a2a254e1029c8
The Android Automerger   commited 2014-05-31 05:51:26 -07:00
5b24dd0745
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().

Sreeram Ramachandran   authored and   Android Git Automerger   commited 2014-05-30 21:39:09 +00:00
ef1df196e5
Support legacy routes added by apps via ensureRouteToHost().
Change-Id: I0ee1ca89fdc859d75a89021ca8c1902811b1e4a9
(cherry picked from commit fb17b32550de624b7f476b70b7a2fc77f31dde7d)

Sreeram Ramachandran   commited 2014-05-30 18:21:34 +00:00
45a8630b13
Merge "Support legacy routes added by apps via ensureRouteToHost()."
Sreeram Ramachandran   authored and   Android (Google) Code Review   commited 2014-05-30 03:29:39 +00:00
536817e165
Support legacy routes added by apps via ensureRouteToHost().
Change-Id: I0ee1ca89fdc859d75a89021ca8c1902811b1e4a9

Sreeram Ramachandran   commited 2014-05-29 19:00:37 -07:00
8c60a1db64
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

Paul Jensen   authored and   Android Git Automerger   commited 2014-05-30 01:49:49 +00:00
5d17f6c126
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.

Paul Jensen   authored and   Android Git Automerger   commited 2014-05-29 19:23:20 +00:00
18265aa92d
Adjust Network's SocketFactory to restrict host name resolution to that Network
bug: 13885501

Change-Id: Iab9a5a2e060fe261f4be9ba974c1a55fb6b9c98b
(cherry picked from commit 92064edf55ee11967d9cc7529125236ee8e469b2)

Paul Jensen   commited 2014-05-29 19:17:06 +00:00
0179f8830a
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)

Paul Jensen   authored and   Robert Greenwalt   commited 2014-05-29 18:53:57 +00:00
94d37923b9
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

Lorenzo Colitti   authored and   The Android Automerger   commited 2014-05-29 09:01:30 -07:00
61eb383b1a
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.

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-05-29 15:20:50 +00:00
fe485fcd53
merge in master-release history after reset to 49696392cfd3a7e329b28ceb087c02363c7a06d9
The Android Automerger   commited 2014-05-29 05:50:27 -07:00
459c068ca5
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

Lorenzo Colitti   commited 2014-05-29 21:36:07 +09:00
86f5cd9767
Merge "Don't break things if a network goes back to CONNECTED."
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2014-05-29 12:25:46 +00:00
1b14f762c7
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

Lorenzo Colitti   commited 2014-05-29 19:19:54 +09:00
fad22fe934
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.

Lorenzo Colitti   authored and   Android Git Automerger   commited 2014-05-28 21:44:50 +00:00
f052469c7b
Merge "Adjust Network's SocketFactory to restrict host name resolution to that Network"
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-05-28 18:26:29 +00:00
1ff0fad207
merge in master-release history after reset to f3c87775c12f317f06e2ca81c4886c7faab1c5cf
The Android Automerger   commited 2014-05-28 05:50:09 -07:00
5f51f949e1
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)

Lorenzo Colitti   commited 2014-05-28 09:29:07 +00:00
a2db7676f3
Merge "Support disconnecting while trying to connect."
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2014-05-28 07:40:50 +00:00
0741b352db
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

Lorenzo Colitti   commited 2014-05-28 07:35:24 +00:00
007e2c2453
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

Dave Langemak   authored and   Android Git Automerger   commited 2014-05-27 22:24:21 +00:00
b5b3d88c3e
Move dis/enable of mobile data to Telephony
ConnectivityService doesn't do this anymore.

bug:15077247
Change-Id: I3208c91b2c0369b594987f39ca29da7478435513
(cherry picked from commit 53013c87496980b534e447e717a32698fbd4bca0)

Robert Greenwalt   authored and   Dave Langemak   commited 2014-05-27 20:28:50 +00:00
3d6c958af4
Rewrite startUsingNetworkFeature for new API
bug:14993207
Change-Id: I041a80faa07bf3094af13a6c606f3b15aa03f789

Robert Greenwalt   commited 2014-05-27 13:24:14 -07:00
2000cddea0
Adjust Network's SocketFactory to restrict host name resolution to that Network
Change-Id: Iab9a5a2e060fe261f4be9ba974c1a55fb6b9c98b

Paul Jensen   commited 2014-05-27 10:49:34 -04:00
486d6ac868
merge in master-release history after reset to ac099d9b1db61a40cbcb1b9f8dd76027e49100a5
The Android Automerger   commited 2014-05-24 05:50:34 -07:00
aee443248b
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

Dianne Hackborn   authored and   The Android Automerger   commited 2014-05-22 17:48:40 -07:00
756df2cc88
am deca2a04: (-s ours) Merge "(DO NOT MERGE) Battery monitoring fixes:" into lmp-preview-dev
* commit 'deca2a041d13846158b0db92781b352ab473d9bc':
  (DO NOT MERGE) Battery monitoring fixes:

Dianne Hackborn   authored and   Android Git Automerger   commited 2014-05-23 00:11:11 +00:00
f1f6fc8a09
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.
  ...

The Android Automerger   authored and   Android Git Automerger   commited 2014-05-23 00:11:04 +00:00
72027d9ad7