Commit Graph

2284 Commits

Author SHA1 Message Date
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
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
Shishir Agrawal
d331d9665b 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
2016-01-26 09:29:24 -08:00
Etan Cohen
d988de60d7 Allow NetworkFactories to match any network specifier on a request
Current usage of NetworkSpecifier: network factory will match a request
if the request has either a (1) empty network specifier, or (2) a
network specifier which is identical to that of the network factory.
Note: 'matching' w.r.t. network specifier - all other matching rules
are still in effect.

Change: add rule (3) or the network specifier of the network factory
is the special string (which is defined as "*" and which user-facing
network requests aren't allowed to use).

Rationale: allows on-demand network creation.

Example:
- Can specify a Wi-Fi NetworkRequest with NetworkSpecifier="ssid"
- It will match a Wi-Fi network factory specifying NetworkSpecifier="*"
- That network factory will bring up a Wi-Fi network, connecting to the
  specified SSID.
- Once the network is created it will create a NetworkAgent which will
  now have a NetworkSpecifier matching that of the request (not the
  match-all special string!)

That final step of making sure that the NetworkAgent matches the request
and not the match-all is critical to delivering any subsequent callbacks
correctly. I.e. your network will only get callbacks which match it.

Bug: 26192833
Change-Id: I49e3b492e0bb48a3f6e9a34e3f94f0e1cf89741f
2015-12-15 08:06:54 -08:00
Baligh Uddin
7f18ef2523 empty commit to trigger build
Change-Id: I3ec926126a0d9ee7d64ffc70ca7aa7c6c9e2a9c6
2015-12-13 18:01:17 +00:00
Tyler Gunn
6c194d9014 Merge commit 'da131290ae5e476691e05e5eb4ac6d507012a0ac' into mncvtdev-to-mmwirelessdev-merge-2015-12-10 2015-12-10 20:05:46 -08:00
Tyler Gunn
5ab5b554ab Merge commit '70da83381f77e0ee9ada47eafaae395038ff77ad' into mncvtdev-to-mmwirelessdev-merge-2015-12-10 2015-12-10 20:04:17 -08:00
Tyler Gunn
92d8863f70 Merge commit '98bd72181e176cdc5536b9709127a71cca082bbf' into mncvtdev-to-mmwirelessdev-merge-2015-12-10 2015-12-10 19:59:27 -08:00
Christopher Tate
75fb864e80 DO NOT MERGE Introduce direct listener API for alarm delivery
The Alarm Manager now supports a set() variant that takes a listener
callback to invoke at alarm trigger time rather than a PendingIntent.
This is much lower overhead and has guaranteed low delivery latency
from the trigger time.  The tradeoff is that the app must be running
*continuously* from the time the alarm is set to the time it is
delivered.  If the app exits for any reason before the alarm fires,
the listener becomes invalid and the alarm will be dropped.  This is
more or less equivalent to setting an alarm with a broadcast
PendingIntent that matches only a runtime-registered receiver.

The app's alarm listener can be any object that implements the new
AlarmManager.OnAlarmListener interface and implements its onAlarm()
method.  There is no data delivered at alarm trigger time: whatever
state needs to be associated with the specific alarm instance should
simply be packaged inside the OnAlarmListener instance.

An alarm using OnAlarmListener can request that the onAlarm() method
be called on an arbitrary handler.  If the program passes 'null' for
this parameter when setting the alarm, the callback occurs on the
application's main Looper thread.

Cherry-picked from b481a892d2
Bug 20157436

Change-Id: I2eb030a24efdd466a2eee1666c5231201b43684b
2015-12-10 16:06:50 -08:00
Jan Nordqvist
5dbd59feb2 DO NOT MERGE Hotspot 2.0 relase 2 first cut.
CP mods to take a URL as a parameter, and new ScanInfo object.

Cherry-picked from 0f3b4449b0
Change-Id: Idbb2d4751c575ba07a56942771e2b2955b624635
2015-12-10 16:06:50 -08:00
Sreeram Ramachandran
84376d950f Don\'t use framework permission strings for netd permissions. am: 2c4e4c95e0 am: a40a3e6bf4 am: e55b156581 am: d3b6e2d790 am: 934b45022a am: 8b05ea51ad am: 4d2ed63c65 am: 6d983179a0
am: 5d41bd8d1a

* commit '5d41bd8d1acd894cef1aff9018614194df6f95ab':
  Don't use framework permission strings for netd permissions.
2015-11-19 17:20:14 +00:00
Sreeram Ramachandran
4d2ed63c65 Don\'t use framework permission strings for netd permissions. am: 2c4e4c95e0 am: a40a3e6bf4 am: e55b156581 am: d3b6e2d790 am: 934b45022a
am: 8b05ea51ad

* commit '8b05ea51adab2a057ed0367472d194c2dc29a0bc':
  Don't use framework permission strings for netd permissions.
2015-11-19 16:50:11 +00:00
Sreeram Ramachandran
8b05ea51ad Don\'t use framework permission strings for netd permissions. am: 2c4e4c95e0 am: a40a3e6bf4 am: e55b156581 am: d3b6e2d790
am: 934b45022a

* commit '934b45022aaaee96a43768ac1c498c6a49f7b2cd':
  Don't use framework permission strings for netd permissions.
2015-11-19 16:40:35 +00:00
Sreeram Ramachandran
934b45022a Don\'t use framework permission strings for netd permissions. am: 2c4e4c95e0 am: a40a3e6bf4 am: e55b156581
am: d3b6e2d790

* commit 'd3b6e2d790f95f2fb3d85f0993b90bb8708a6114':
  Don't use framework permission strings for netd permissions.
2015-11-19 16:30:59 +00:00
Sreeram Ramachandran
e55b156581 Don\'t use framework permission strings for netd permissions. am: 2c4e4c95e0
am: a40a3e6bf4

* commit 'a40a3e6bf4c3de9119812d854bf53923a68131ed':
  Don't use framework permission strings for netd permissions.
2015-11-19 16:10:19 +00:00
Sreeram Ramachandran
a40a3e6bf4 Don\'t use framework permission strings for netd permissions.
am: 2c4e4c95e0

* commit '2c4e4c95e011bc4dd54c71c341b1f7ff83a53842':
  Don't use framework permission strings for netd permissions.
2015-11-19 15:59:42 +00:00
Sreeram Ramachandran
2c4e4c95e0 Don't use framework permission strings for netd permissions.
These framework permission strings were being used as arbitrary labels
that mapped to netd permissions that have completely different meaning.
This leads to confusion, so use different strings.

This is being cherry picked from lmp-mr1-dev to lmp-dev to fix failures
when creating restricted networks due to prior back-port e46a802.

Bug: 21900139
Bug: 18194858
Change-Id: Ib3ec377ab26ce904d3d4678f04edec6cb1260517
(cherry picked from commit d84f7f863c)
2015-11-18 17:04:18 +00:00
Lorenzo Colitti
c41cfe3335 Merge "Reinstate CHANGE_NETWORK_STATE as a normal permission." into mnc-dr-dev am: 809dcade99 am: bdc458048a
am: bb8f652372

* commit 'bb8f652372f261edd2083103d4300a9173993706':
  Reinstate CHANGE_NETWORK_STATE as a normal permission.
2015-10-22 06:28:24 +00:00
Lorenzo Colitti
0289a5eac4 Merge "Reinstate CHANGE_NETWORK_STATE as a normal permission." into mnc-dr-dev
am: 809dcade99

* commit '809dcade9906001f6aa51a68aa783e20bb1d7c0d':
  Reinstate CHANGE_NETWORK_STATE as a normal permission.
2015-10-22 06:18:45 +00:00
Lorenzo Colitti
91de63b074 Reinstate CHANGE_NETWORK_STATE as a normal permission.
This is a partial revert of http://ag/738523 , but not a full
revert because M apps that have gone through the WRITE_SETTINGS
route to obtain permission to change network state should
continue to have permission to do so.

Specifically:

1. Change the protection level of CHANGE_NETWORK_STATE back from
   "signature|preinstalled|appop|pre23" to "normal". This allows
   apps that declare CHANGE_NETWORK_STATE in their manifest to
   acquire it, even if they target the M SDK or above.
2. Change the ConnectivityManager permission checks so that they
   first check CHANGE_NETWORK_STATE, and then ask Settings
   if the app has the WRITE_SETTINGS runtime permission.
3. Slightly simplify the code in the Settings provider code that
   deals specifically with the ability to change network state.
4. Make the ConnectivityService permissions checks use the
   ConnectivityManager code to avoid code duplication.
5. Update the ConnectivityManager public Javadoc to list both
   CHANGE_NETWORK_STATE and WRITE_SETTINGS.

Bug: 21588539
Bug: 23597341
Change-Id: Ic06a26517c95f9ad94183f6d126fd0de45de346e
2015-10-22 08:33:45 +09:00
Lorenzo Colitti
aea9258396 Merge "Don\'t buzz when automatically connecting to captive portals" into mnc-dr-dev am: d214496319 am: 5c09f31e49
am: 18ec0b5187

* commit '18ec0b518741dc5ac32c52ae9681efec3e73a23c':
  Don't buzz when automatically connecting to captive portals
2015-10-21 02:19:15 +00:00
Lorenzo Colitti
a2a1919f8e Merge "Don\'t buzz when automatically connecting to captive portals" into mnc-dr-dev
am: d214496319

* commit 'd214496319785311f99f8415b7c8be3189420488':
  Don't buzz when automatically connecting to captive portals
2015-10-21 01:15:27 +00:00
Lorenzo Colitti
c22996447c Don't buzz when automatically connecting to captive portals
Play a sound and vibrate (by setting DEFAULT_ALL) only if the
user manually selected the network. This applies to both captive
portals and networks with no Internet access.

Bug: 24126143
Change-Id: Idf075d5c85f9f4b07a3431a25d1a3f7089cf1ee2
2015-10-21 09:59:31 +09:00
Erik Kline
bc68bc37c4 am 9c8abd1d: am f23eece2: am f90627d4: Merge "Don\'t crash if an invalid always-on VPN profile is configured." into mnc-dr-dev
* commit '9c8abd1d7ab205047a7e0f131eca24b2f3019d5d':
  Don't crash if an invalid always-on VPN profile is configured.
2015-10-14 17:55:13 +00:00
Erik Kline
002149d821 am f90627d4: Merge "Don\'t crash if an invalid always-on VPN profile is configured." into mnc-dr-dev
* commit 'f90627d40bb987dbfebba781d0c1a88436555863':
  Don't crash if an invalid always-on VPN profile is configured.
2015-10-14 17:42:31 +00:00
Erik Kline
f90627d40b Merge "Don't crash if an invalid always-on VPN profile is configured." into mnc-dr-dev 2015-10-14 17:37:57 +00:00
Lorenzo Colitti
f5e2883d41 Don't crash if an invalid always-on VPN profile is configured.
This is currently being hit because Settings does not clear the
always-on VPN configuration when the corresponding VPN profile is
deleted. This will be fixed in Settings, but there's no harm in
being robust to invalid configurations here.

Bug: 23625458
Change-Id: Id185a54d5892339197cd40026df5174debd957cf
2015-10-13 15:29:14 +09:00
Jeff Sharkey
a8f0bb0ff1 am 75051c3a: am 7f6d8754: am 22d9b51c: Merge "Push firewall rules up to ConnectivityService." into mnc-dr-dev
* commit '75051c3a62123b4668231d0243ba11462e02ac5a':
  Push firewall rules up to ConnectivityService.
2015-10-12 16:55:58 +00:00
Jeff Sharkey
7ef52249c0 am 22d9b51c: Merge "Push firewall rules up to ConnectivityService." into mnc-dr-dev
* commit '22d9b51ce0f5d7e758e41055d984eea0470fe04c':
  Push firewall rules up to ConnectivityService.
2015-10-12 16:39:45 +00:00
Jeff Sharkey
22d9b51ce0 Merge "Push firewall rules up to ConnectivityService." into mnc-dr-dev 2015-10-12 16:34:19 +00:00
Elliott Hughes
26c330a424 am ccffea7a: resolved conflicts for a884d81e to stage-aosp-master
* commit 'ccffea7a3d4ab33a1fed5648bb5926c65dea15b6':
  constify JNINativeMethod function pointer tables
2015-09-24 17:14:10 +00:00
Elliott Hughes
ccffea7a3d resolved conflicts for a884d81e to stage-aosp-master
Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
2015-09-24 10:01:32 -07:00
Paul Jensen
78266a6d4a am 7724cffc: am 06cf7c44: am 4e0d6dbd: am 4cbfe331: am 46a36218: am 5eff98f8: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit '7724cffc30f49baad11636871f6970c6252dc6f1':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-09-23 14:57:59 +00:00
Paul Jensen
34ab693fb0 am 477302fe: am d2af51fa: am bfff9435: (-s ours) am 10a7d744: am 21087892: am 334c6e9a: am a9e98343: Merge "Fix NOT_RESTRICTED network capability and enforce it." into lmp-dev
* commit '477302fede5c8ae439ecc786d5404435875e585e':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-09-23 14:57:53 +00:00
Paul Jensen
7724cffc30 am 06cf7c44: am 4e0d6dbd: am 4cbfe331: am 46a36218: am 5eff98f8: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit '06cf7c44af0953ae0ee107c05992a9b6975360ef':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-09-23 14:50:45 +00:00
Paul Jensen
477302fede am d2af51fa: am bfff9435: (-s ours) am 10a7d744: am 21087892: am 334c6e9a: am a9e98343: Merge "Fix NOT_RESTRICTED network capability and enforce it." into lmp-dev
* commit 'd2af51fabf49e7bdea23e4da79b5fd0aa0957edc':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-09-23 14:50:40 +00:00
Paul Jensen
06cf7c44af am 4e0d6dbd: am 4cbfe331: am 46a36218: am 5eff98f8: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit '4e0d6dbdb4b739baa4925e0087eb5ef5de65f66e':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-09-23 14:42:02 +00:00
Paul Jensen
d2af51fabf am bfff9435: (-s ours) am 10a7d744: am 21087892: am 334c6e9a: am a9e98343: Merge "Fix NOT_RESTRICTED network capability and enforce it." into lmp-dev
* commit 'bfff94358e4f35de82d3f564a3b4dcffcb8c411a':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-09-23 14:41:57 +00:00
Paul Jensen
4e0d6dbdb4 am 4cbfe331: am 46a36218: am 5eff98f8: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit '4cbfe3316fd1105b697a9838ef7bafaebf5080a2':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-09-23 11:33:18 +00:00
Paul Jensen
bfff94358e am 10a7d744: am 21087892: am 334c6e9a: am a9e98343: Merge "Fix NOT_RESTRICTED network capability and enforce it." into lmp-dev
* commit '10a7d7449dae2aabf4f22f980e7efabf274a939a':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-09-23 11:33:13 +00:00
Paul Jensen
46a3621883 am 5eff98f8: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit '5eff98f8f6b90432e4d005c0939c85c05109fe6c':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-09-23 11:13:48 +00:00
Paul Jensen
21087892f8 am 334c6e9a: am a9e98343: Merge "Fix NOT_RESTRICTED network capability and enforce it." into lmp-dev
* commit '334c6e9a5d22094eccdc199c7d6061e27206c3e7':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-09-23 11:13:40 +00:00
Paul Jensen
5eff98f8f6 am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit 'ece4ac2105d18d8d7b6296d6de3fdd5641c35258':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-09-23 11:06:32 +00:00
Paul Jensen
334c6e9a5d am a9e98343: Merge "Fix NOT_RESTRICTED network capability and enforce it." into lmp-dev
* commit 'a9e98343146244b71e236d82c95a8d0fa30a41c1':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-09-23 11:06:27 +00:00
Daniel Micay
6d5e7fa0c5 constify JNINativeMethod function pointer tables
Change-Id: I4036c924958221cbc644724f8eb01c5de3cd7954
2015-09-22 17:10:35 -04:00
Lorenzo Colitti
6288ea38c8 Unbreak build, bring ConnectivityService in sync with mnc-dr-dev
The version of ConnectivityService.java in mnc-vt-dev doesn't
compile due to the presence of two similar-but-not-identical code
blocks in handleRegisterNetworkAgent. The history here is a
a little convoluted - this code was originally merged into
mnc-vt-dev, then cherry-picked into dr-dev, and from there
automerged into mnc-vt-dev, causing conflicts. This latest
breakage is likely due to the automerged not detecting a conflict
because the code block was subtly different.

Attempt to fix this once and for all by making the mnc-vt-dev
version of the file identical to the mnc-dr-dev version.

Change-Id: I270739b0be6f6358045700494a1b0f25f0b365a3
2015-09-16 11:00:47 +09:00
Lorenzo Colitti
2e8f85c466 am 7198c0aa: Merge "Framework fixes for RSSI offload." into mnc-dr-dev
* commit '7198c0aa4ccbeaecf2606006d3a6ace684f805fe':
  Framework fixes for RSSI offload.
2015-09-16 01:01:12 +00:00
Lorenzo Colitti
71ec67ddf7 Framework fixes for RSSI offload.
1. When registering a NetworkCallback, only update RSSI
   thresholds if the request specifies a signal strength.
2. When releasing a NetworkCallback, only update RSSI
   thresholds if the request specified a signal strength.
3. Add logging.

Add logging.
Bug: 21405941
Bug: 23679346
Bug: 23815756
Change-Id: I4bc42d0ab02285a7a9d14e09f8a1cd868f4d9d7f
2015-09-15 16:00:39 +09:00
Lorenzo Colitti
f114a91d16 am e1e97377: Merge "NetworkDiagnostics: ping default router from all global addreses." into mnc-dr-dev
* commit 'e1e97377d04ab6e5d069c85aba4226f47371e7c6':
  NetworkDiagnostics: ping default router from all global addreses.
2015-09-15 02:46:51 +00:00
Jeff Sharkey
baefe062f7 Push firewall rules up to ConnectivityService.
getActiveNetworkInfo() and friends already know how to augment their
results to help apps detect when network access is blocked.  This
change wires up the new app-idle and device-idle firewall rules to
be reported through these APIs.

This also causes other platform tools like DownloadManager and
SyncManager to respect these new policies.

Bug: 24050462
Change-Id: Id9517b0b70be7e3ca2ab27bed8049db916e4d829
2015-09-14 15:49:36 -07:00