Commit graph

2,446 commits

Message SHA1
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

Jeff Davidson   commited 2016-03-14 11:24:12 -07:00
2cf791102e
DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
am: a27c12ef29  -s ours

* commit 'a27c12ef29':
  DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.

Lorenzo Colitti   authored and   android-build-merger   commited 2016-03-07 22:19:32 +00:00
e4ffb0392e
DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
Cherry-picked from 6282a08d3a

Bug: 19159232
Change-Id: Ic366b53259ee5944a8e864876425a6558c0a7216

Lorenzo Colitti   authored and   Paul Stewart   commited 2016-03-07 10:34:32 -08:00
a27c12ef29
Turn down the logging a little bit.
Change-Id: Ib6e0e6f3577afac3b9bfe9a9b1cce70fb16d9d04

Joe Onorato   commited 2016-03-04 12:21:30 -08:00
549c01ec10
Have ConnectivityService install packet filters when possible
am: 69b7682a46

* commit '69b7682a46':
  Have ConnectivityService install packet filters when possible

Paul Jensen   authored and   android-build-merger   commited 2016-03-03 14:48:45 +00:00
38ac9019d9
Support 464xlat on Ethernet.
am: bc241263b5

* commit 'bc241263b5':
  Support 464xlat on Ethernet.

Lorenzo Colitti   authored and   android-build-merger   commited 2016-03-03 08:39:16 +00:00
81cf43c087
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

Paul Jensen   authored and   Lorenzo Colitti   commited 2016-03-03 17:32:01 +09:00
69b7682a46
Support 464xlat on Ethernet.
Bug: 26991160
Change-Id: I848c9e86e1ed337e95cfddda46723a9a1dcaed30

Lorenzo Colitti   commited 2016-03-03 17:31:57 +09:00
bc241263b5
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

Lorenzo Colitti   commited 2016-03-02 17:01:50 +09:00
cdb49e2109
Merge changes Ic366b532,I0179b45b into nyc-dev
* changes:
  Move PinningNetworkCallback out to a new NetworkPinner class.
  Use MessageUtils in ConnectivityManager.

Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2016-03-02 04:18:03 +00:00
45c7b01e49
Move PinningNetworkCallback out to a new NetworkPinner class.
Also add tests.

Bug: 19159232
Change-Id: Ic366b53259ee5944a8e864876425a6558c0a7216

Lorenzo Colitti   commited 2016-03-02 12:50:35 +09:00
6282a08d3a
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

Jeff Sharkey   commited 2016-03-01 19:29:16 -07:00
a6066fde20
Use MessageUtils in ConnectivityManager.
Change-Id: I0179b45bc54ffced8e5647d6f005b891b5de93ab

Lorenzo Colitti   commited 2016-03-01 22:57:29 +09:00
7e28683228
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

Robin Lee   commited 2016-02-29 16:29:44 +00:00
224743c6b7
Delete all NetworkUtils DHCP-related code.
am: 48718451c0

* commit '48718451c0':
  Delete all NetworkUtils DHCP-related code.

Erik Kline   authored and   android-build-merger   commited 2016-02-22 09:16:16 +00:00
31f822b095
Delete all NetworkUtils DHCP-related code.
Bug: 26991160
Change-Id: I2c74e0161f43f65c1b6a85dc9f294b64c8f1ae6e

Erik Kline   commited 2016-02-22 15:14:31 +09:00
48718451c0
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

Antonio Cansado   commited 2016-02-17 18:43:53 -08:00
ee7b26ab4f
Expose measurement results to interested callers.
am: 41e3340ade

* commit '41e3340ade':
  Expose measurement results to interested callers.

Erik Kline   authored and   android-build-merger   commited 2016-02-10 15:58:17 +00:00
b1ec885b3b
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

Erik Kline   commited 2016-02-11 00:28:27 +09:00
41e3340ade
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

Jeremy Klein   commited 2016-02-04 19:06:59 -08:00
24d06b2ee8
Merge "Created a ACTION_RESTRICT_BACKGROUND_CHANGED intent."
Felipe Leme   authored and   Android (Google) Code Review   commited 2016-02-02 23:59:30 +00:00
d81d8636e1
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

Jeff Davidson   commited 2016-01-29 10:13:18 -08:00
9804c89aab
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

Felipe Leme   commited 2016-01-28 13:28:11 -08:00
6a5b769ca0
Merge "Allow NetworkFactories to match any network specifier on a request" into mm-wireless-dev
am: c4752acb32

* commit 'c4752acb32':
  Allow NetworkFactories to match any network specifier on a request

Etan Cohen   authored and   android-build-merger   commited 2016-01-28 18:24:23 +00:00
a19d34ba18
Merge "Allow NetworkFactories to match any network specifier on a request" into mm-wireless-dev
Etan Cohen   authored and   Android Partner Code Review   commited 2016-01-28 18:20:09 +00:00
c4752acb32
Merge "Add the network handle to the NetworkAgentInfo#toString() output."
Erik Kline   authored and   Android (Google) Code Review   commited 2016-01-28 06:44:59 +00:00
0b40c62e05
Add the network handle to the NetworkAgentInfo#toString() output.
This will make it possible to find nethandles via, e.g.
 "dumpsys connectivity --short".

Without this, native multinetwork API debugging requires running
"dumpsys connectivity --diag" in order to see the nethandle values.

Bug: 19537384
Change-Id: Icdd2b112523d4ecf88d5339f229e714a56d248f8

Erik Kline   commited 2016-01-28 15:06:56 +09:00
b6b7ce4446
Merge changes from topic '2016 GPS Changes'
* changes:
  Framework support to read newly added fields
  Added an API to query GPS hardware version info
  GPS Measurement and Navigation APIs go public
  Supported GNSS multi-constellation in frameworks

Lifu Tang   authored and   Android (Google) Code Review   commited 2016-01-28 02:02:17 +00:00
cae08e7f85
Merge "Remove the unused Looper param from Tethering constructor."
Jeremy Klein   authored and   Android (Google) Code Review   commited 2016-01-27 20:54:01 +00:00
6ffcaf55e1
Unhiding MSIM APIs.
1. Unhide MSIM APIs in TelephonyManager that already have non-MSIM equivalent
   APIs public.
2. Make MSIM API naming consistent (overloaded, no suffix).
3. Unhide APIs in SubscriptionManager that are necessary for MSIM.

Bug: 26772894
Change-Id: Ibebab7379ea79c8e4812bbd190342827048e30e2

Shishir Agrawal   commited 2016-01-26 13:47:27 -08:00
592cb147bf
Remove the unused Looper param from Tethering constructor.
Tethering just constructs its own Looper right below where it
assigns the looper param to mLooper.

Change-Id: I2d522942eff2ad3439bb3961e78ab0625d3fa9df

Jeremy Klein   commited 2016-01-26 11:10:55 -08:00
2ada3deec1
Merge "DO NOT MERGE : Unhiding MSIM APIs." into mm-wireless-dev
am: 45836d13e5  -s ours

* commit '45836d13e5d06c787b5039894b6c0ac7c5eb7b7b':
  DO NOT MERGE : Unhiding MSIM APIs.

Shishir Agrawal   authored and   android-build-merger   commited 2016-01-26 18:04:39 +00:00
34aca4e512
DO NOT MERGE : Unhiding MSIM APIs.
1. Unhide MSIM APIs in TelephonyManager that already have non-MSIM equivalent
   APIs public.
2. Make MSIM API naming consistent (overloaded, no suffix).
3. Unhide APIs in SubscriptionManager that are necessary for MSIM.

Bug: 26772894
Change-Id: Ibebab7379ea79c8e4812bbd190342827048e30e2

Shishir Agrawal   commited 2016-01-26 09:29:24 -08:00
d331d9665b
Expose a simple tethering API which includes provision checks.
This CL exposes startTethering and stopTethering functions which also
encapsulate all provisioning check logic. Right now, only silent checks
are implemented, but UI checks will come in a follow-up CL. GTS tests
and Settings changes are under the same topic ID.

BUG: 26247383
Change-Id: I65f61d899594cb3f9035d8496366af17a57a090f

Jeremy Klein   commited 2016-01-25 16:37:09 -08:00
9a36ec8c25
Supported GNSS multi-constellation in frameworks
Change-Id: I82574afd3697c47e806d2cfaedc33756d0353b73

Lifu Tang   commited 2016-01-25 15:15:14 -08:00
ae4adaa96a
Fixed RestrictBackgroundStatus signature by adding @hide.
BUG: 26082535
Change-Id: I2e4b63327a8f791db01ee0c1ab090557170857fa

Felipe Leme   commited 2016-01-25 12:09:03 -08:00
1b42ef950f
Merge "Created new public API so applications can customize its metered network usage while running in background."
Felipe Leme   authored and   Android (Google) Code Review   commited 2016-01-22 19:26:06 +00:00
e4cff08ce6
Merge "Debug logging for when getActiveNetworkInfo returns BLOCKED." into mnc-dr1.5-dev am: a6855a1faa am: d841d71593
am: 228c56e200

* commit '228c56e200':
  Debug logging for when getActiveNetworkInfo returns BLOCKED.

Lorenzo Colitti   authored and   android-build-merger   commited 2016-01-22 18:50:49 +00:00
592da45e75
Created new public API so applications can customize its metered network
usage while running in background.

The new API is 'int getRestrictBackgroundStatus()' and returns the
following values:

 - RESTRICT_BACKGROUND_STATUS_DISABLED: no restrictions
 - RESTRICT_BACKGROUND_STATUS_WHITELISTED: restriction but app is
   whitelisted
 - RESTRICT_BACKGROUND_STATUS_ENABLED: full restriction

The proper way to interprete these values for using metered networks
while running on background is:

 - When disabled, there is no restriction and the application could use the
   metered networks freely.

 - When whitelisted, the application can use the metered network, but should try
   to minimize the usage.

 - When enabled, the application should not try to use metered networks at
   all, since the usage will be denied.

BUG: 26451391
Change-Id: If07d42bb88e4c02802df0234861f38aef2cfead7

Felipe Leme   commited 2016-01-22 10:50:11 -08:00
d16384b560
Merge "Debug logging for when getActiveNetworkInfo returns BLOCKED." into mnc-dr1.5-dev am: a6855a1faa
am: d841d71593

* commit 'd841d71593c0c4a7c5beaf5196a22d9158c2d697':
  Debug logging for when getActiveNetworkInfo returns BLOCKED.

Lorenzo Colitti   authored and   android-build-merger   commited 2016-01-22 00:14:27 +00:00
228c56e200
Debug logging for when getActiveNetworkInfo returns BLOCKED.
Bug: 26488100
Change-Id: I991581732d35aed18392bed2f3d69ca8fb231f5e

Lorenzo Colitti   commited 2016-01-22 05:21:34 +09:00
600e9a2d68
Merge "Implement roaming tracking in NetworkStats summary queries."
Jeff Davidson   authored and   Android (Google) Code Review   commited 2016-01-20 01:43:02 +00:00
8d16e2c29a
Implement roaming tracking in NetworkStats summary queries.
Whether a network is deemed roaming or not was already being tracked
as part of the NetworkIdentitySet, so the underlying data store
already tracks roaming and native data separately. However, this data
was being aggregated together in NetworkStatsCollection#getSummary,
since the NetworkIdentitySet is converted to an iface name for the
purposes of matching, and the iface name will be identical whether or
not the iface is considered roaming. Now it is separated.

Also fixes a long-standing bug in NetworkIdentitySet where an identity
read from a saved file would always be considered roaming == false,
even if it wasn't at the time it was written.

Bug: 25813438
Change-Id: I11ab5b51182ed8da7af8fde468df065f9fdc3dad

Jeff Davidson   commited 2016-01-19 16:57:51 -08:00
5210fa503f
[VPN] start lockdown before user is unlocked
Removed the dependency on KeyStore encryption by removing that flag for
VPN profiles which don't use secure credentials when saving in Settings.

Old encrypted profiles will simply fail to load untile USER_PRESENT is
sent, as before.

Bug: 26108660
Change-Id: I2677d741d54252f15cb772c94ce1b39041f1e19c

Robin Lee   commited 2016-01-19 16:40:20 +00:00
4908ef3e42
Merge "Always-on app VPNs"
Robin Lee   authored and   Android (Google) Code Review   commited 2016-01-14 11:37:18 +00:00
5c1c2fa073
Always-on app VPNs
Bug: 22547950
Change-Id: I46b204170bfac58d944f39b22f815b080de71a58

Robin Lee   commited 2016-01-12 19:54:54 +00:00
33c73e2424
Merge "Makes captive portal server calculation in one place."
Udam Saini   authored and   Android (Google) Code Review   commited 2016-01-12 18:40:45 +00:00
77c04b683b
Makes captive portal server calculation in one place.
This also creates a hidden api for the captive portal server calculation
so that the Setup Wizard can use this as well.

bug:13246857
Change-Id: I4dfd0916df97cfce13252c7cc15f7bd05ed95f77

Udam Saini   commited 2016-01-08 14:38:31 -08:00
53b71ee34b
Add a TETHER_PRIVILEGED permission and use it where needed.
BUG: 26247383
Change-Id: I73f7227d77926faa9081e83eccb83c8ddee33e08

Jeremy Klein   commited 2016-01-07 10:11:24 -08:00
0486333736
Use "merge -s ours origin/mirror-partner-mm-wireless-dev" as described in b/26154276
Alex Cheung   commited 2015-12-23 14:48:52 -08:00
cd858e2dbd