Commit Graph

2545 Commits

Author SHA1 Message Date
TreeHugger Robot
6e82080513 Merge "Move Badging from ScoredNetwork to NetworkingBadging." 2017-02-18 01:14:04 +00:00
Hugo Benichi
01432b306d resolve merge conflicts of 9355bce0c3 to master
Test: none
Change-Id: Iac65e01d07edf79ec97e7d996f8cfee6f811606b
2017-02-17 10:47:58 +09:00
Hugo Benichi
9355bce0c3 Merge "IP connectivity metrics: delete obsolete logger service" am: 37e3f22c2e am: c54962a4bd
am: 9c2b6afa2f

Change-Id: I5f8cd508812d9532778c2f1f019308a4b8d8ee33
2017-02-17 00:18:35 +00:00
Hugo Benichi
9c2b6afa2f Merge "IP connectivity metrics: delete obsolete logger service" am: 37e3f22c2e
am: c54962a4bd

Change-Id: Iccc3ee97bd2ac267b312c6c7d9269ac02a2bd68e
2017-02-17 00:09:11 +00:00
Hugo Benichi
c54962a4bd Merge "IP connectivity metrics: delete obsolete logger service"
am: 37e3f22c2e

Change-Id: Ib335bc5e19c2c703d23267bf2835fc89fcf5a957
2017-02-17 00:00:14 +00:00
Hugo Benichi
37e3f22c2e Merge "IP connectivity metrics: delete obsolete logger service" 2017-02-16 23:52:13 +00:00
Etan Cohen
c454a74514 Merge changes from topic 'cm_request_to' am: 6fb97e8fd8 am: ede9f94e32 am: c3f0f5f3de
am: fcc8afcc7d

Change-Id: I2cef23ff183428041273007cf9bb1b655f92372a
2017-02-16 14:46:52 +00:00
Etan Cohen
fcc8afcc7d Merge changes from topic 'cm_request_to' am: 6fb97e8fd8 am: ede9f94e32
am: c3f0f5f3de

Change-Id: Ief32189b0f6f2c70d7e4097f70dbdf8195bd8713
2017-02-16 14:38:28 +00:00
Etan Cohen
c3f0f5f3de Merge changes from topic 'cm_request_to' am: 6fb97e8fd8
am: ede9f94e32

Change-Id: I2720e64e4af88df9d3a7b6209e9fcef4a0340986
2017-02-16 14:29:29 +00:00
Etan Cohen
ede9f94e32 Merge changes from topic 'cm_request_to'
am: 6fb97e8fd8

Change-Id: I9ca18c0570be831ab37cdf200c28b0778117198d
2017-02-16 14:23:18 +00:00
Etan Cohen
6fb97e8fd8 Merge changes from topic 'cm_request_to'
* changes:
  [CM] Remove maximum timeout value for request network
  [CM] Remove non-functional timeout from request network
2017-02-16 14:15:44 +00:00
Etan Cohen
ba07c8c4ec [CM] Remove maximum timeout value for request network
The request network with timeout was originally created with a
check of max timeout against a constant of 100 minutes. However,
the API was not public and did not implement a timeout. Any users
were internal and never got any onUnavailable() callback (since
timeout never triggered).

There is no reason to have a max timeout so the constant is
remove.

Bug: 31399536
Test: unit tests and CTS of ConnectivityManager
Change-Id: Icbedfb4299d75b6a7e3e43720111531f1faafd06
2017-02-16 14:15:16 +00:00
Hugo Benichi
d22edc28f5 IP connectivity metrics: delete obsolete logger service
Test: - runtest frameworks-net
      - manually verified $ adb shell dumpsys connmetrics
Bug: 32648597

Change-Id: I69f7dee5871508398d7f7209658a00c768e2d18e
2017-02-15 17:12:58 +09:00
Stephen Chen
fde900dbbd Fail safely on invalid ScanResults when creating NetworkKey
Added tests for NetworkKey#createFromScanResult

Bug: 34671341
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkKeyTest.java
runtest --path
frameworks/base/services/tests/servicestests/src/com/android/server/NetworkScoreServiceTest.java

Change-Id: Ideac1615917649cd3934421228a82aeed37e7ad1
2017-02-14 18:39:57 -08:00
Hugo Benichi
849e24866d Merge "ConnectivityManager: fix potential NPE" am: b688dd18ab am: ab453cd565 am: 7c9cc1f9e5
am: f648c98762

Change-Id: I628fdf36a5a80a2d93ff4c4785253cb16a9e4ad2
2017-02-15 01:29:31 +00:00
Hugo Benichi
f648c98762 Merge "ConnectivityManager: fix potential NPE" am: b688dd18ab am: ab453cd565
am: 7c9cc1f9e5

Change-Id: I6f487ce9da656610c939ddc78e834ac8ef5f8135
2017-02-15 01:24:29 +00:00
Hugo Benichi
7c9cc1f9e5 Merge "ConnectivityManager: fix potential NPE" am: b688dd18ab
am: ab453cd565

Change-Id: I72e114037ce6a0ec53863749b8ffa34513c9fdce
2017-02-15 01:09:58 +00:00
Hugo Benichi
ab453cd565 Merge "ConnectivityManager: fix potential NPE"
am: b688dd18ab

Change-Id: If562fc6a921569ad9d3141cac72b6f395a30da9e
2017-02-15 01:05:24 +00:00
Sundeep Ghuman
699deaf610 Move Badging from ScoredNetwork to NetworkingBadging.
This is a non-functional refactor. The old enums will be removed once
ag/35323372 is addressed.

Bug: 35114358
Test: Ran existing tests (see files touched).
Change-Id: I08fd8c7964463b5908ce361e61f8fe811d0ff6f3
2017-02-14 14:04:18 -08:00
Hugo Benichi
6f260f3691 ConnectivityManager: fix potential NPE
ConnectivityManager static sCallbackHandler is referenced and directly
used in a way that is not ensuring its proper initialization.

This patch fixes this potential NPE by using getHandler() instead.

Also this patch changes sendRequestForNetwork's signature to only accept
the subtype CallbackHandler instead of Handler: without using
CallbackHandler the NetworkCallbacks are not triggered properly and
bookkeeping of sCallbacks does not happen. sendRequestForNetwork's
signature now makes this explicit.

This step prepares the addition of overloaded versions of
registerNetworkCallback and cie that takes custom Handlers.

Test: build, flashed, manually checked connectivity
Change-Id: I52e8a2cb5075e7aef7b35e30c9845cacba927d13
2017-02-14 16:01:40 +09:00
Sudheer Shanka
27e6931583 Ensure network connectivity on app start.
Bug: 27803922
Test: cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests
Change-Id: Ifd7a52924cd6bbc809c9a3f92d52fe2df09b7fe2
2017-02-13 17:17:41 -08:00
Jeremy Joslin
4ad7ca056f Adding a little more verbose logging.
Log statements to help track the request call path.

Test: manual
Change-Id: I68cfdf68cf8adcece45de2a60bec94e6f06be761
2017-02-13 11:35:03 -08:00
Jeremy Joslin
f95c865411 Adding a new internal method to get all valid scorers.
New NetworkScoreManager method to get all valid scorers from the
NetworkScoreService. The implementation is stubbed out for the time
being.

Test: make
Bug: 35095406
Change-Id: Iece2cc10a0a9377f2d82385d172b06660bb9b130
2017-02-09 15:32:04 -08:00
TreeHugger Robot
5a0d21156d Merge "Check for null inputs in the ctor." 2017-02-09 00:25:28 +00:00
Jeremy Joslin
e925aeacab Check for null inputs in the ctor.
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases -t com.google.android.gts.wifi.WifiHostTest
Bug: 35152108
Change-Id: I321b52b0feb62aced20bca7f47e962f5c7d78343
2017-02-08 14:50:34 -08:00
TreeHugger Robot
a327386e90 Merge "Fix typo in ScoredNetwork javadoc." 2017-02-08 21:56:18 +00:00
Jeremy Joslin
a5172f69ca New internal interface method to get the active scorer metadata.
Returns the cached NetworkScorerAppData from the connected service.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34773276
Change-Id: Ia8986e770c4ede0c0f7e2ad4f5bc0a0117a9ae2b
2017-02-07 16:12:22 +00:00
Sundeep Ghuman
c3cd62f848 Fix typo in ScoredNetwork javadoc.
Bug: 34824590
Test: NA
Change-Id: I1dcb9a2ca7de1e42f28ecf5b916700ffb184da72
2017-02-06 14:54:09 -08:00
Jeremy Joslin
bdd9ac2324 Default the lastSelectetNetworkId to -1
Test: adb shell am instrument -e class android.net.RecommendationRequestTest  -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Bug: 35045563
Change-Id: I04d71f2072d8a5a706f05905b580dd7af77d13d8
2017-02-06 12:55:43 -08:00
Jeremy Joslin
37e877becc Cache NetworkScorerAppData in the ScoringServiceConnection.
Store the entire NetworkScorerAppData instance in the
ScoringServiceConnection instead of just most of its fields.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34773276
Change-Id: Id2ed7c431dee9895e85e1966903ac919f1704eba
2017-02-03 16:29:38 +00:00
Erik Kline
e8bc75bfcc Merge "Add ConnectivityManager.networkCapabilitiesForType()" am: c313123afe am: 6f32aa0259 am: 7196e935a8
am: c700509ade

Change-Id: I15fe6fe4c9aec3d244b46516c2992ded33337a9f
2017-02-02 20:03:51 +00:00
Erik Kline
c700509ade Merge "Add ConnectivityManager.networkCapabilitiesForType()" am: c313123afe am: 6f32aa0259
am: 7196e935a8

Change-Id: I2ab05143299f13012dc2a88efca52160e08c6d97
2017-02-02 07:32:09 +00:00
Erik Kline
7196e935a8 Merge "Add ConnectivityManager.networkCapabilitiesForType()" am: c313123afe
am: 6f32aa0259

Change-Id: I6828bc3bb094ca8597ca2d8538045758638c374f
2017-02-02 07:27:13 +00:00
Erik Kline
6f32aa0259 Merge "Add ConnectivityManager.networkCapabilitiesForType()"
am: c313123afe

Change-Id: I0ad50fbf38f11b383fd889dc598cfddd47051477
2017-02-02 07:22:05 +00:00
Erik Kline
35bf06c968 Add ConnectivityManager.networkCapabilitiesForType()
This static method returns a NetworkCapabilities instance with
transports and capabilities set according to the given legacy type.

Also:
    - add NetworkRequest.Builder.setCapabilities(), to be able to use
      the NetworkCapabilities instances returned from the above
    - update UpstreamNetworkMonitor to make immediate use of this

Test: as follows
    - build (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - WiFi to DUN upstream tethering works
Bug: 32163131

Change-Id: Idfe1ddd2815c355cbf27cf29eb0e3de177de84e9
2017-02-02 11:07:59 +09:00
Lorenzo Colitti
2de4925f5c Add an API hint for metered multipath traffic.
This allows an application that knows how to provide seamless
network connectivity (e.g., using QUIC multipath) to find out if
doing so is desired.

Test: builds, boots, runtest frameworks-net passes.
Bug: 34630278
Change-Id: Ic7fd0b9e1cd879fdfaf84009d7125391895e9087
2017-02-01 17:02:29 +09:00
Jeremy Joslin
94ea572773 Merge "Post runnables instead of sending messages." am: 71317f4a6c am: 71a4792147 am: 31669e8924
am: 28f9de475f

Change-Id: I6f2774e0efd7cfcabb49db25614bac99bfdb1b30
2017-02-01 01:53:28 +00:00
Jeremy Joslin
28f9de475f Merge "Post runnables instead of sending messages." am: 71317f4a6c am: 71a4792147
am: 31669e8924

Change-Id: Ia7937ea6d29924e1b717430e8330d81e3f7ee9e3
2017-02-01 01:48:05 +00:00
Jeremy Joslin
31669e8924 Merge "Post runnables instead of sending messages." am: 71317f4a6c
am: 71a4792147

Change-Id: Idff8f071f316942e8b520c913e96d3eb8b44227d
2017-02-01 01:40:58 +00:00
Jeremy Joslin
71a4792147 Merge "Post runnables instead of sending messages."
am: 71317f4a6c

Change-Id: I13cb1fd38262f869b99245678c89f45b834210c8
2017-02-01 01:34:16 +00:00
Jeremy Joslin
c695a17421 Post runnables instead of sending messages.
Gaining access to a Handler's Looper can be problematic in custom
Handler implementations. Instead of creating a new internal Handler
to dispatch the method calls on we simply post Runnables to the
given Handler.

Test: adb shell am instrument -e class android.net.NetworkRecommendationProviderTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Bug: 34845471
Change-Id: I6fe380a92aebd630781abe5853f94737bcfeaa5f
2017-01-31 11:51:25 -08:00
Robert Quattlebaum
9cd7af310c Minor updates to reflect libbinder changes.
* Parcel: Update comment to reflect new file path
* IpPrefix: Update AIDL file to indicate appropriate C++ header

Change-Id: Ia9edccca5e8ef1f36a709b593a768003e1234dfa
2017-01-30 15:05:53 -08:00
John Reck
6e4f930457 Merge "Fix a bunch of repeated reads of a ro.* property" am: 4265991701 am: e4c2e8f303
am: 3c2837e77e

Change-Id: Idbcb9dfeac57036d3621474ee65ba967cc7bc499
2017-01-27 23:05:52 +00:00
John Reck
3c2837e77e Merge "Fix a bunch of repeated reads of a ro.* property" am: 4265991701
am: e4c2e8f303

Change-Id: Id6af451556fde8eefac8076735e625911f8bf272
2017-01-27 23:02:41 +00:00
John Reck
e4c2e8f303 Merge "Fix a bunch of repeated reads of a ro.* property"
am: 4265991701

Change-Id: I996fbd1002ef788a768b575ab6d2177dc9ab5af1
2017-01-27 22:57:29 +00:00
John Reck
ed065024a5 Fix a bunch of repeated reads of a ro.* property
SystemProperties.get() is not particularly fast,
especially if a string is returned. Since ro.* values
are unable to be changed, there's no need to
continously re-query them. Cache the value at
static init time to trivially fix this.

Test: refactoring CL.
Change-Id: Iccb021d3cb2ba3a4a1d0048ddec6811bb7409eec
(cherry picked from commit aa67f684ff)
2017-01-27 11:04:39 -08:00
The Android Automerger
6a688ca1ad Merge commit '88932754ffdcbffb3cb43e03991e5eb598c10458' into nyc-mr1-dev-plus-aosp
* commit '88932754ffdcbffb3cb43e03991e5eb598c10458':
  Captive portals: login activity probes like NetworkMonitor
  Logging improvements in CaptivePortalLoginActivity
  Captive portal systel log improvements
  Fix flaky IpPrefixTest.
  Removing bogus file added by mistake
  frameworks-test: adding missing @SmallTest
  Netd events: record connect() success/errno
  Add missing dependency.
  Show notification for always-on app VPN
2017-01-27 06:39:52 +00:00
The Android Automerger
7bc2aebd53 Merge commit '48a1136c8b3000c651e8bcd86325acd1dce6e4ec' into nyc-mr1-dev-plus-aosp
* commit '48a1136c8b3000c651e8bcd86325acd1dce6e4ec':
  Implement metered tracking for NetworkStats summary queries.
2017-01-27 06:39:41 +00:00
The Android Automerger
53095bb5bd Merge commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1' into nyc-mr1-dev-plus-aosp
* commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1': (35 commits)
  NetworkMonitor: send one DNS probe per web probe
  NetworkMonitor metrics: add first validation information
  APF: also drop any ICMPv6 RSs
  ConnectivityServiceTest: fix testAvoidBadWifiSettings
  Fix ConnectivityServiceTest testRequestBenchmark
  Switch over to new "time.android.com" NTP pool.
  Define API for metering network stats buckets.
  Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
  Use @Ignore to explicitly disable a @Test method.
  Fixed NetworkStatsServiceTest and converted it to JUnit4.
  VPN network stat accounting changes.
  ConnectivityThread: use lazy holder idiom
  ConnectivityManager: use ConnectivityThread looper
  ConnectivityManager: a simpler CallbackHandler
  Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
  Add a null check for the OnStartTetheringCallback.
  TokenBucket for rate-limiting and throttling
  IpConnectivityMetrics reads buffer size in settings
  CaptivePortalLogin: set mixed content policy to compatibility.
  Add IP conn metrics to dumpsys and bug reports
  ...
2017-01-27 06:39:05 +00:00
Hugo Benichi
88932754ff Captive portals: login activity probes like NetworkMonitor
This patch changes CaptivePortalLoginActivity captive portal test to be
consistent with NetworkMonitor by:
 - using Network.java to open the http connection.
 - adding a UserAgent property to the request header.

Test: manually tested.
Bug: 32369183

(cherry picked from commit cdf3ba48cc)

Change-Id: I559eb0497475daad758ba3b3395225dcd0a27a57
2017-01-26 18:53:03 +09:00