Commit Graph

2470 Commits

Author SHA1 Message Date
Erik Kline
d23d19cdcf Merge "Support registering a request for the default network" into nyc-dev am: d36ba73
am: e96834c

* commit 'e96834c583f99fb31bb9c80bddc8a73387fed028':
  Support registering a request for the default network
2016-03-22 07:33:25 +00:00
Erik Kline
e0aed6342f Support registering a request for the default network
Change-Id: I079f5be97b585cf5692dd4c7a144b993d168a9a5
2016-03-22 15:44:16 +09:00
Lorenzo Colitti
edd3f968a5 Merge "Remove framework code that calls SIOCKILLADDR" into nyc-dev am: e6109dd
am: 7ceb8f5

* commit '7ceb8f53825c1220647f3282da62ada393e8b6a5':
  Remove framework code that calls SIOCKILLADDR
2016-03-22 05:47:06 +00:00
Lorenzo Colitti
0251d679fb Remove framework code that calls SIOCKILLADDR
Bug: 26976388
Change-Id: I652361d9e650a77085070d6c26b28b7638ba2dfe
2016-03-22 12:54:32 +09:00
Lorenzo Colitti
090e4ed9bc Merge changes Idf0cfee8,I27307e2e into nyc-dev am: 7d0e392
am: e77e70d

* commit 'e77e70d00f3da6dd856f2d641d46080fbebacd0a':
  Use native netd binder interface in NetworkManagementService.
  Fix IdleableHandlerThread.
2016-03-17 19:09:06 +00:00
Lorenzo Colitti
0cbda755e9 Fix IdleableHandlerThread.
Occasionally, ConnectivityServiceTest fails with "BUG: only one
idle handler allowed". I have not been able to reproduce this
consistently, but code inspection reveals an unsafe access to
mIdleHandler inside queueIdle. Wrap that in a synchronized block.

Change-Id: I27307e2e55fa8d937d7f043bd436894091c3c667
2016-03-17 10:52:57 +09:00
Lorenzo Colitti
e6146a38dc Merge "APF: add debug code." into nyc-dev am: 6b7c9ec
am: ae57b47

* commit 'ae57b477436f1e89bb7c92533680cf445db67053':
  APF: add debug code.
2016-03-16 08:20:36 +00:00
Lorenzo Colitti
dad8897a98 APF: add debug code.
1. Store additional debug information when RA filtering.
2. Add a toString method for RA packets.
3. Make "adb shell dumpsys connectivity apf" dump APF filter
   state.

Bug: 26238573
Change-Id: I1441ff7bc90e63624f8b10a220b2ac97f4d390a5
2016-03-16 15:45:47 +09:00
Jeff Davidson
7c103d6c65 Merge "NetworkStats.Bucket API polish." into nyc-dev am: 7b8ee822d4
am: cb4ad1548e

* commit 'cb4ad1548ec10019760bbfd76268805809301fd6':
  NetworkStats.Bucket API polish.
2016-03-14 19:37:56 +00:00
Jeff Davidson
7b8ee822d4 Merge "NetworkStats.Bucket API polish." into nyc-dev 2016-03-14 19:30:23 +00:00
Jeff Davidson
2cf791102e NetworkStats.Bucket API polish.
-Add @IntDef constants for STATE_ and ROAMING_.
-Expand docs for ROAMING_ constants.
-Use ROAMING_NO/YES instead of ROAMING_DEFAULT/ROAMING.

Bug: 27531260
Change-Id: I54ecfb4148caa549214df0bee9983036ffa4cb55
2016-03-14 11:24:12 -07:00
Robin Lee
d11a0637cf Merge "Skip lockdown setup if user is not up yet" into nyc-dev am: d646b3d67f
am: 2149ad57fd

* commit '2149ad57fda5b04a07a9ae7af723a358f7e29d2b':
  Skip lockdown setup if user is not up yet
2016-03-14 13:28:27 +00:00
Robin Lee
b402c02f3c Skip lockdown setup if user is not up yet
Sometimes USER_UNLOCKED can be sent before USER_STARTED. This puts
lockdown in a bad state as it needs a fully-functioning user to tie
itself to and listen for connectivity events.

Bug: 27637943
Change-Id: I41a784a75a8c8674cb61dbba10693dd56c9396dd
2016-03-14 13:19:14 +00:00
Lorenzo Colitti
322cebb57d DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class. am: a27c12ef29 -s ours am: e4ffb0392e
am: fc79ffdbe6  -s ours

* commit 'fc79ffdbe641a470e364cf205616879cb87e3eb1':
  DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
2016-03-07 22:30:32 +00:00
Lorenzo Colitti
e4ffb0392e DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
am: a27c12ef29  -s ours

* commit 'a27c12ef29405d06705a9626389837472540a5a9':
  DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
2016-03-07 22:19:32 +00:00
Lorenzo Colitti
a27c12ef29 DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
Cherry-picked from 6282a08d3a

Bug: 19159232
Change-Id: Ic366b53259ee5944a8e864876425a6558c0a7216
2016-03-07 10:34:32 -08:00
Joe Onorato
fba6810653 Merge changes Ib6e0e6f3,I109f04c2,Idc716000,I44c51d5f,I810b9bd5, ... into nyc-dev am: 5d4ab988bd
am: 15e93f3715

* commit '15e93f3715742d0ffad6089cf804842f2e5f393b':
  Turn down the logging a little bit.
  Turn down the logging a little bit and don't do a log wrapper function.
  Turn down the logging a little bit.
  Turn down the logging a little bit.
  Turn down the logging a little bit.
  Turn down the logging a little bit.
  Turn down the logging a little bit.
2016-03-04 21:53:06 +00:00
Joe Onorato
549c01ec10 Turn down the logging a little bit.
Change-Id: Ib6e0e6f3577afac3b9bfe9a9b1cce70fb16d9d04
2016-03-04 12:21:30 -08:00
Paul Jensen
3d3be815ab Have ConnectivityService install packet filters when possible am: 69b7682a46 am: 38ac9019d9
am: 171160a352

* commit '171160a35286c12fb89058cd89d1bf93ff8943bf':
  Have ConnectivityService install packet filters when possible
2016-03-03 14:54:43 +00:00
Paul Jensen
38ac9019d9 Have ConnectivityService install packet filters when possible
am: 69b7682a46

* commit '69b7682a4651d7d69fd7a0ffa5323ee15ce9f0d7':
  Have ConnectivityService install packet filters when possible
2016-03-03 14:48:45 +00:00
Lorenzo Colitti
8bb58b5899 Support 464xlat on Ethernet. am: bc241263b5 am: 81cf43c087
am: 9c129cccac

* commit '9c129cccac2a14ac2e4369e52134d2cb95e9da28':
  Support 464xlat on Ethernet.
2016-03-03 08:55:16 +00:00
Lorenzo Colitti
81cf43c087 Support 464xlat on Ethernet.
am: bc241263b5

* commit 'bc241263b559a12244863d5705abe22d42df2426':
  Support 464xlat on Ethernet.
2016-03-03 08:39:16 +00:00
Paul Jensen
69b7682a46 Have ConnectivityService install packet filters when possible
Listen for ICMP6 router advertisements on networks that support
packet filters.  Construct packet filters and install them to
ignore redundant future ICMP6 router advertisements.

Bug: 26238573
Change-Id: If78300b9fda257c21f3ee6533e1da7de9f897cb4
2016-03-03 17:32:01 +09:00
Lorenzo Colitti
bc241263b5 Support 464xlat on Ethernet.
Bug: 26991160
Change-Id: I848c9e86e1ed337e95cfddda46723a9a1dcaed30
2016-03-03 17:31:57 +09:00
Lorenzo Colitti
97fbf258c3 Merge changes Id78aab9c,I51096b18 into nyc-dev am: 1856df512f
am: 057f24547a

* commit '057f24547afe0e2122863cab96b8149a43d3cf2d':
  Speed up ConnectivityServiceTest.
  Make it easier to test code that uses WakeupMessage.
2016-03-02 08:59:08 +00:00
Lorenzo Colitti
cdb49e2109 Speed up ConnectivityServiceTest.
1. Override WakeupMessage with an implementation that uses
   sendEmptyMessageDelayed. This allows us to replace a
   6-second sleep with a 150ms wait.
2. Change waitFor()'s polling interval from 100ms to 50ms.

With these changes ConnectivityServiceTest goes from ~9s to ~3s.

Change-Id: Id78aab9cded90a5b17f09d7f437904e179808dd2
2016-03-02 17:01:50 +09:00
Lorenzo Colitti
82137901f2 Merge changes Ic366b532,I0179b45b into nyc-dev am: 45c7b01e49
am: 6ad667122c

* commit '6ad667122c35098ab62afd92b5ac26937397825b':
  Move PinningNetworkCallback out to a new NetworkPinner class.
  Use MessageUtils in ConnectivityManager.
2016-03-02 07:04:56 +00:00
Jeff Sharkey
735f381856 Merge "When system server goes down, crash apps more." into nyc-dev am: 60b7bcc614
am: 33a64f5e56

* commit '33a64f5e5600d86ef6ce270ce57fffbf4f2ab35d':
  When system server goes down, crash apps more.
2016-03-02 06:57:26 +00:00
Lorenzo Colitti
45c7b01e49 Merge changes Ic366b532,I0179b45b into nyc-dev
* changes:
  Move PinningNetworkCallback out to a new NetworkPinner class.
  Use MessageUtils in ConnectivityManager.
2016-03-02 04:18:03 +00:00
Lorenzo Colitti
6282a08d3a Move PinningNetworkCallback out to a new NetworkPinner class.
Also add tests.

Bug: 19159232
Change-Id: Ic366b53259ee5944a8e864876425a6558c0a7216
2016-03-02 12:50:35 +09:00
Jeff Sharkey
a6066fde20 When system server goes down, crash apps more.
Apps making calls into the system server may end up persisting
internal state or making security decisions based on the perceived
success or failure of a call, or the default values returned.

The reality is that if the system process just died, init will be
along shortly to kill all running apps, so we should have no problem
rethrowing the RemoteException as a RuntimeException.

Bug: 27364859
Change-Id: Ife0bcb079636c88d54c44d17eb580409fd79028b
2016-03-01 19:29:16 -07:00
Robin Lee
891bb1159e Merge "ConnectivityService: listen to USER_UNLOCKED too" into nyc-dev am: 2f4286b792
am: fc46e9e4ca

* commit 'fc46e9e4caf6c0dfe0b6f905a06c2d2b132d8173':
  ConnectivityService: listen to USER_UNLOCKED too
2016-03-02 02:00:05 +00:00
Lorenzo Colitti
7e28683228 Use MessageUtils in ConnectivityManager.
Change-Id: I0179b45bc54ffced8e5647d6f005b891b5de93ab
2016-03-01 22:57:29 +09:00
Robin Lee
224743c6b7 ConnectivityService: listen to USER_UNLOCKED too
When the credential-encrypted private storage for the target user is
unlocked, we should try to start up VPN for them.

Bug: 27357283
Change-Id: Id9079230d00e3cea08a49ae66bd1f553416b4f54
2016-02-29 16:29:44 +00:00
Erik Kline
5f211d61de Delete all NetworkUtils DHCP-related code. am: 48718451c0 am: 31f822b095
am: 80027c1f0b

* commit '80027c1f0b6a754b1a7cc5a6df918144cf979c78':
  Delete all NetworkUtils DHCP-related code.
2016-02-22 09:24:12 +00:00
Erik Kline
31f822b095 Delete all NetworkUtils DHCP-related code.
am: 48718451c0

* commit '48718451c03de8566c19f5c475a7202bd26d50d6':
  Delete all NetworkUtils DHCP-related code.
2016-02-22 09:16:16 +00:00
Erik Kline
48718451c0 Delete all NetworkUtils DHCP-related code.
Bug: 26991160
Change-Id: I2c74e0161f43f65c1b6a85dc9f294b64c8f1ae6e
2016-02-22 15:14:31 +09:00
Antonio Cansado
fa6b97b789 Merge "Implementation of data usage callbacks." into nyc-dev am: 12d7ea815b
am: 7e098af672

* commit '7e098af67280dbc877790486043998b13e83986e':
  Implementation of data usage callbacks.
2016-02-18 21:12:15 +00:00
Antonio Cansado
ee7b26ab4f Implementation of data usage callbacks.
NetworkStatsService will register data usage requests
and keep data usage stats scoped to the request.

There are different types of data usage requests
- scoped to a set of NetworkTemplate; these are restrictred to
device owners and carrier apps and allow the caller to monitor
all activity on the specified interfaces.
- scoped to all uids visible to the user, if the user has
android.Manifest.permission#PACKAGE_USAGE_STATS permission.
The set of uids may change over time, so we keep track of that.
- scoped to a set of uids given by the caller, granted that
the caller has access to those uids.
- scoped to the caller's own data usage. This doesn't require
PACKAGE_USAGE_STATS.

Bug: 25812785
Change-Id: Ie11f35fc1f29d0dbe82f7fc924b169bb55c76708
2016-02-17 18:43:53 -08:00
Pierre Imai
7aab8bfc16 Merge "Silence the obnoxious MTU 0 error message that occur when no MTU is specified for a given network." 2016-02-12 01:51:23 +00:00
Erik Kline
b1ec885b3b Expose measurement results to interested callers.
am: 41e3340ade

* commit '41e3340adedef80452acd57ef7838a7726f709cb':
  Expose measurement results to interested callers.
2016-02-10 15:58:17 +00:00
Erik Kline
41e3340ade Expose measurement results to interested callers.
With this it's possible for callers to:

    Network network = ...
    LinkProperties lp = ...

    NetworkDiagnostics netdiag = new NetworkDiagnostics(network, lp, 5000);
    netdiag.startMeasurements();
    netdiag.waitForMeasurements();

    boolean result = true;
    for (Measurement m : netdiag.getMeasurements()) {
        if (!m.checkSucceeded()) {
            result = false;
            // Additional error handling here.
        }
    }

    return result;

Bug: 21832299
Bug: 26780890
Change-Id: Iaf7ff029e2c6a998b574c23d0dcde8d57a467a22
2016-02-11 00:28:27 +09:00
Pierre Imai
98f9c2c23b Silence the obnoxious MTU 0 error message that occur when no MTU is
specified for a given network.

Bug: 10705136
Change-Id: I637d3b62ca6bb3de217d1eb03cdb1668622d06f1
2016-02-09 10:07:36 +09:00
Jeremy Klein
24d06b2ee8 Remove several TetherUtil functions which are no longer needed.
Slowly chipping away at TetherUtil to clean up this code.
This CL also adds an admin check to
ConnectivityService.isTetheringSupported to get parity with the
TetherUtil function before removing it.

Change-Id: Ibe7c5c9fb420d57e5458f77dad30e8a1e751a3e2
2016-02-04 19:06:59 -08:00
Felipe Leme
d81d8636e1 Merge "Created a ACTION_RESTRICT_BACKGROUND_CHANGED intent." 2016-02-02 23:59:30 +00:00
Jeff Davidson
9804c89aab Notify NetworkStatsService of roaming status changes.
When the roaming status of the cell network changes, it is handled as
follows:

-DcActiveState gets an event (either EVENT_DATA_CONNECTION_ROAM_ON or
 EVENT_DATA_CONNECTION_ROAM_OFF) and calls
 NetworkAgent#sendNetworkInfo with updated NetworkInfo.
-ConnectivityService then gets an EVENT_NETWORK_INFO_CHANGED and calls
 updateNetworkInfo with the new info.

With the previous code, the NetworkAgent's NetworkInfo object would be
updated internally, but because the state of the connection had not
changed from CONNECTED, the change would be considered a duplicate and
otherwise ignored.

With the new code, we call notifyIfacesChanged() when the state is the
same but the roaming status has changed. That should be all that is
necessary, as roaming is not exposed as a link property or network
capability today.

Bug: 26545456
Change-Id: I33d32d1fa84ce41dbe01542e5b498eda4b744b74
2016-01-29 10:13:18 -08:00
Felipe Leme
6a5b769ca0 Created a ACTION_RESTRICT_BACKGROUND_CHANGED intent.
This intent will be broadcasted when:

- Global restrict background setting is changed (sent to all packages)
- An individual uid is added to or removed from the whitelist (sent just
  to the packages belonging to that uid).

This intent is only sent to registered receivers.

BUG: 26451391
Change-Id: Ic0a5771f88baa52076ad04764f29098a386463cc
2016-01-28 13:28:11 -08:00
Etan Cohen
a19d34ba18 Merge "Allow NetworkFactories to match any network specifier on a request" into mm-wireless-dev
am: c4752acb32

* commit 'c4752acb32c18172cbf89ed2cd415cb3264ad145':
  Allow NetworkFactories to match any network specifier on a request
2016-01-28 18:24:23 +00:00
Etan Cohen
c4752acb32 Merge "Allow NetworkFactories to match any network specifier on a request" into mm-wireless-dev 2016-01-28 18:20:09 +00:00
Erik Kline
0b40c62e05 Merge "Add the network handle to the NetworkAgentInfo#toString() output." 2016-01-28 06:44:59 +00:00