Commit Graph

1771 Commits

Author SHA1 Message Date
Billy Lau
e37acf3256 am 4a10b66d: am 99271a39: am 9751afcf: am 26ab6ed3: am 70f998e5: Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev
* commit '4a10b66df364092cdc42a3cfaa990c877b389624':
  Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS
2015-08-08 02:49:54 +00:00
Shirish Kalele
822b4f3a8d am 4ecee3f8: am 558f1030: am 74f93f9a: am d7408469: am 027e3b7f: Merge "Fix check for caller being the active network scorer" into mnc-dev
* commit '4ecee3f88e067ed0339a4e004996a3c69ce5480e':
  Fix check for caller being the active network scorer
2015-08-08 02:48:37 +00:00
Billy Lau
4a10b66df3 am 99271a39: am 9751afcf: am 26ab6ed3: am 70f998e5: Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev
* commit '99271a3995e35c64105b2778f695ca6dd716a3f2':
  Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS
2015-08-07 22:49:52 +00:00
Billy Lau
26ab6ed3ef am 70f998e5: Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev
* commit '70f998e57df2b3ed79331669a93a0ba314f25e7d':
  Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS
2015-08-07 22:22:24 +00:00
Billy Lau
70f998e57d Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev 2015-08-07 22:16:03 +00:00
Shirish Kalele
4ecee3f88e am 558f1030: am 74f93f9a: am d7408469: am 027e3b7f: Merge "Fix check for caller being the active network scorer" into mnc-dev
* commit '558f10307c65e5c0a3e0e11a4abca4a083f751dc':
  Fix check for caller being the active network scorer
2015-08-07 20:55:42 +00:00
Shirish Kalele
d7408469f7 am 027e3b7f: Merge "Fix check for caller being the active network scorer" into mnc-dev
* commit '027e3b7f51cd172dae89f69cc358363b0cf20f5f':
  Fix check for caller being the active network scorer
2015-08-07 20:30:59 +00:00
Shirish Kalele
027e3b7f51 Merge "Fix check for caller being the active network scorer" into mnc-dev 2015-08-07 20:25:06 +00:00
Billy Lau
a7238a397d Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS
Merge the CHANGE_NETWORK_STATE permission with WRITE_SETTINGS.

AndroidManifest.xml:
Raised the protection level of CHANGE_NETWORK_STATE permission from
normal to signature|appops and pre23|preinstall for compatibility

provider/Settings:
Wrote new helper methods to check if app is allowed to change network
state.

ConnectivityManager.java & ConnectivityService.java:
Replace enforcement checks for CHANGE_NETWORK_STATE with
checkAndNoteChangeNetworkStateOperations instead.

Change-Id: If8c2dd3c76a5324ca43f1d90fa17973216c2bcc5
2015-08-07 19:29:51 +01:00
Shirish Kalele
4cab12d91d Fix check for caller being the active network scorer
Compare caller and scorer uids to decide if caller is the
active scorer instead of calling AppOps.checkPackage().

Bug: 23000690
Change-Id: I64285f965716f3aceb24f193d86ab9d6be7202c5
2015-08-06 12:53:59 -07:00
Paul Jensen
9180e2ea59 am abd27102: am 41779e46: am 95297732: am 86e7d135: resolved conflicts for merge of dbc4edcc to mnc-dr-dev
* commit 'abd27102f4e232be448bc6012e0bd833637ab3fa':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-08-05 11:44:46 +00:00
Paul Jensen
abd27102f4 am 41779e46: am 95297732: am 86e7d135: resolved conflicts for merge of dbc4edcc to mnc-dr-dev
* commit '41779e467a478e11de2df10ad97542e6f2d57ca7':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-08-05 11:38:26 +00:00
Paul Jensen
86e7d135ac resolved conflicts for merge of dbc4edcc to mnc-dr-dev
Change-Id: I3a8624b2b375e0d174983d7690082e0e6932c4de
2015-08-05 07:07:24 -04:00
Paul Jensen
dbc4edccfc Merge "Fix NOT_RESTRICTED network capability and enforce it." into mnc-dev 2015-08-05 10:03:47 +00:00
Paul Jensen
487ffe7d3d Fix NOT_RESTRICTED network capability and enforce it.
With this change:
1. NOT_RESTRICTED should be removed from NetworkRequests that bring up
   special restricted carrier networks (e.g. IMS, FOTA).
2. NetworkRequests without NOT_RESTRICTED require CONNECTIVITY_INTERNAL
   permission to register
3. Binding sockets to networks without NOT_RESTRICTED requires
   CONNECTIVITY_INTERNAL permission

Bug:21637535
Change-Id: I5991d39facaa6b690e969fe15dcbeec52e918321
2015-08-04 07:24:24 -04:00
Dianne Hackborn
53fdd0fe7e am 80d0df7c: am 62f05dfa: am 55a23950: am e8d3b394: am 692a244b: Fix build.
* commit '80d0df7cd967d877422be706b250d46d33270477':
  Fix build.
2015-08-01 17:53:17 +00:00
Dianne Hackborn
80d0df7cd9 am 62f05dfa: am 55a23950: am e8d3b394: am 692a244b: Fix build.
* commit '62f05dfa6f3763479d289d747114c34832ab10f6':
  Fix build.
2015-08-01 17:04:37 +00:00
Dianne Hackborn
e8d3b39467 am 692a244b: Fix build.
* commit '692a244bffea11157c37c8de93482cb912599b98':
  Fix build.
2015-07-31 19:42:24 +00:00
Dianne Hackborn
692a244bff Fix build.
Change-Id: Icdf6fa14e53a1c030d0d90205d3bf2d7610b6196
2015-07-31 10:35:34 -07:00
Lorenzo Colitti
00c8a9d60a am 5bbbf8ed: am 3b03916d: am c7a86e90: am c70348c1: am 496a9d26: Merge "Stop supporting legacy ConnectivityManager routing methods in M." into mnc-dev
* commit '5bbbf8edfd74389f9b38d3497d6d86afb543b8f2':
  Stop supporting legacy ConnectivityManager routing methods in M.
2015-07-31 05:49:08 +00:00
Lorenzo Colitti
5bbbf8edfd am 3b03916d: am c7a86e90: am c70348c1: am 496a9d26: Merge "Stop supporting legacy ConnectivityManager routing methods in M." into mnc-dev
* commit '3b03916de7d1d2c91d5d8c9d1f0f555814a9242f':
  Stop supporting legacy ConnectivityManager routing methods in M.
2015-07-31 05:43:26 +00:00
Lorenzo Colitti
c70348c194 am 496a9d26: Merge "Stop supporting legacy ConnectivityManager routing methods in M." into mnc-dev
* commit '496a9d269b0778ffa1965f3b11d768fe70fd7719':
  Stop supporting legacy ConnectivityManager routing methods in M.
2015-07-31 05:24:49 +00:00
Lorenzo Colitti
ffc42b0b7b Stop supporting legacy ConnectivityManager routing methods in M.
The methods startUsingNetworkFeature, stopUsingNetworkFeature and
requestRouteToHost were @removed in all the M preview builds, but
internal and external developers have noted that this imposes
additional burden for applications that need to work across
multiple platform versions because it causes compile-time errors.

We switched from @removed back to @deprecated to avoid these
problems. In order to effectively deprecate these methods, which
are error-prone and insecure, make them throw
UnsupportedOperationException if the app's target SDK is M or
above.

Because there are still one or two places in system code that use
these APIs, exempt Process.SYSTEM_UID and the OMA-DM client from
the check for now.

Bug: 22728205
Change-Id: I790bd32f3aa8067cbb625962a209bb9232f4b58c
2015-07-31 11:08:27 +09:00
Paul Jensen
722113aa5f am 917b275d: am 06287d1c: am 9a2314b0: am 682fd6ae: am a991c66c: Merge "Fix missing onLost NetworkCallbacks when network loses capability" into mnc-dev
* commit '917b275d6b54b08edb6326512d7e48a02163e730':
  Fix missing onLost NetworkCallbacks when network loses capability
2015-07-30 03:12:21 +00:00
Paul Jensen
917b275d6b am 06287d1c: am 9a2314b0: am 682fd6ae: am a991c66c: Merge "Fix missing onLost NetworkCallbacks when network loses capability" into mnc-dev
* commit '06287d1c1859c9eafb0b4e195e57215a7e9af59c':
  Fix missing onLost NetworkCallbacks when network loses capability
2015-07-30 02:57:30 +00:00
Paul Jensen
682fd6aede am a991c66c: Merge "Fix missing onLost NetworkCallbacks when network loses capability" into mnc-dev
* commit 'a991c66c12da30d0240ac6c98736edee93d95977':
  Fix missing onLost NetworkCallbacks when network loses capability
2015-07-30 02:20:49 +00:00
Paul Jensen
a991c66c12 Merge "Fix missing onLost NetworkCallbacks when network loses capability" into mnc-dev 2015-07-30 02:10:50 +00:00
Paul Jensen
dede231240 am 06eabfcc: am 4c55639a: am 8c83be09: am bf10991d: resolved conflicts for merge of 30813942 to mnc-dr-dev
* commit '06eabfcc2d82833ec89bf92d087210bab18d78bb':
  Disable WiFi autojoin when user decides via "Stay connected?" dialog
2015-07-29 17:31:12 +00:00
Paul Jensen
06eabfcc2d am 4c55639a: am 8c83be09: am bf10991d: resolved conflicts for merge of 30813942 to mnc-dr-dev
* commit '4c55639a780caa3e0a3594795ab408c5a8618ff2':
  Disable WiFi autojoin when user decides via "Stay connected?" dialog
2015-07-29 17:09:00 +00:00
Robin Lee
5bdaeeafe6 Merge "Fix funky javadoc" 2015-07-29 16:32:07 +00:00
Robin Lee
1472c92128 Fix funky javadoc
Using @link for the first word of a @throws line is redundant and
generates strange HTML where the row appears twice.

See for example:
    http://developer.android.com/reference/android/net/VpnService.Builder.html#addAllowedApplication%28java.lang.String%29

Change-Id: I9c0bbe9156d292eb6f0e2e2ccb6dbcfef95bc312
2015-07-29 17:25:06 +01:00
Paul Jensen
bf10991d76 resolved conflicts for merge of 30813942 to mnc-dr-dev
Change-Id: I8b33797528f16596f0d350ad38458baa51fcacf6
2015-07-29 11:31:53 -04:00
Paul Jensen
308139425e Merge "Disable WiFi autojoin when user decides via "Stay connected?" dialog" into mnc-dev 2015-07-29 13:52:02 +00:00
Robert Greenwalt
691b81042f am f99b6f28: am 872d264c: am d6162cf2: am b3c93c5f: Merge "Un-remove legacy ConnectivityManager API." into mnc-dev
* commit 'f99b6f2886cde0406798f0b8b4b1666c29b387bf':
  Un-remove legacy ConnectivityManager API.
2015-07-28 21:03:04 +00:00
Robert Greenwalt
d6162cf244 am b3c93c5f: Merge "Un-remove legacy ConnectivityManager API." into mnc-dev
* commit 'b3c93c5f4256a1da1a8020abe5812a841b67667a':
  Un-remove legacy ConnectivityManager API.
2015-07-28 19:57:31 +00:00
Robert Greenwalt
b3c93c5f42 Merge "Un-remove legacy ConnectivityManager API." into mnc-dev 2015-07-28 19:39:48 +00:00
Robert Greenwalt
a36c074052 Un-remove legacy ConnectivityManager API.
These were @removed too soon.  We need to keep them @deprecated until
the bulk of devices support the new API and then we can remove them.

bug:22728205
Change-Id: If1b46ff1878f1778517624112b195c461645ddd1
2015-07-28 11:41:31 -07:00
Paul Jensen
cf4c2c6372 Fix missing onLost NetworkCallbacks when network loses capability
If a network no longer satisfies a NetworkRequest, send the onLost
NetworkCallback.  If it was a real request (not listen) then update
the NetworkFactories.

To test this change I created a little infrastructure to fake
different Internet connectivity probe results during tests.  This
allowed me to rewrite some of ConnectivityServiceTest's logic for
validating networks.  This brought to light a couple issues that
I had to address to keep tests passing:
1. testUnlingeringDoesNotValidate was relying on a bad side-effect
   of my old method of ConnectivityServiceTest's logic for
   validating networks, so I rewrote the test.
2. ConnectivityService was not sending out NetworkCallbacks for
   WiFi when Cellular was validated.  I'm including a fix for this
   in this CL also.

Bug:22220234
Change-Id: I29314f38189817f8b2561a213c4f9e8522696663
2015-07-28 12:19:32 -04:00
Lorenzo Colitti
2ae3a05b42 am b0014e9f: am 08ef66bb: am 62ca62b3: am e288b3af: Merge changes I5c994de5,I6cb0dd84 into mnc-dev
* commit 'b0014e9f38bb7e01ba488e50c61f3fc9a7aaf9fc':
  Add a test for public bugs 2111 and 2136.
  Always check off-link connectivity in NetworkDiagnostics.
2015-07-28 02:02:59 +00:00
Lorenzo Colitti
62ca62b32a am e288b3af: Merge changes I5c994de5,I6cb0dd84 into mnc-dev
* commit 'e288b3af14421731d8f477b97e8d77588f20498b':
  Add a test for public bugs 2111 and 2136.
  Always check off-link connectivity in NetworkDiagnostics.
2015-07-28 01:20:16 +00:00
Lorenzo Colitti
87cfc70b73 Always check off-link connectivity in NetworkDiagnostics.
Currently, NetworkDiagnostics only checks off-link connectivity if
one of the DNS servers is off-link. Make it check off-link
connectivity in all cases by sending probes to Google Public DNS
if off-link DNS servers are not specified.

Bug: 22569331
Bug: 22641669
Bug: 22748900
Change-Id: I6cb0dd8491bc0c1a488631deca56722b9c1d2b3f
2015-07-27 16:41:44 +09:00
Erik Kline
56066f6036 am f35e9344: am ec69003d: am 9d598e11: Pass signal strength thresholds inside a Bundle
* commit 'f35e93446d5172446fa2cf37cac405a62cd54233':
  Pass signal strength thresholds inside a Bundle
2015-07-18 18:08:45 +00:00
Lorenzo Colitti
a169460950 am 1c6b02af: am da355c80: am c3f21f3b: Support NetworkCallbacks based on signal strength.
* commit '1c6b02af8b53982c2717c684e5cdd94618dff422':
  Support NetworkCallbacks based on signal strength.
2015-07-18 18:08:39 +00:00
Lorenzo Colitti
15cda089b6 am 6163290e: am e647d93d: am 8bf977d5: ConnectivityManager API for for packet keepalives.
* commit '6163290e5975b0d4ebdecc20dfa41faac4b4ba79':
  ConnectivityManager API for for packet keepalives.
2015-07-18 17:51:42 +00:00
Lorenzo Colitti
2d2a59924d am 47a47d3b: am 00365fc6: am 260a36d1: Make immutable NetworkCapabilities more explicit.
* commit '47a47d3b907325be3b851ce87f275e6032527c5e':
  Make immutable NetworkCapabilities more explicit.
2015-07-18 17:51:36 +00:00
Erik Kline
9d598e115f Pass signal strength thresholds inside a Bundle
Bug: 21407651
Change-Id: I2c80e89441e2eb15a246cb1fa9347f886cefa80f
2015-07-18 17:28:52 +00:00
Lorenzo Colitti
c3f21f3b8b Support NetworkCallbacks based on signal strength.
Bug: 21405941
Change-Id: I2ed8a5aeb8dac464a4305671ed22abcacb485bc9
2015-07-18 17:28:26 +00:00
Lorenzo Colitti
8bf977d562 ConnectivityManager API for for packet keepalives.
Bug: 21405946
Change-Id: Ie1f8f8bee684fe2bb1092a9f1bc9f5dc29b1defc
2015-07-18 17:00:13 +00:00
Lorenzo Colitti
260a36d1b2 Make immutable NetworkCapabilities more explicit.
Bug: 21405941
Change-Id: Iafd738c31747b0f5f9356bed1c97f5f282830af1
2015-07-18 16:59:47 +00:00
Paul Jensen
f95d220308 Disable WiFi autojoin when user decides via "Stay connected?" dialog
If the user selects "No" in the "Stay connected?" dialog box:
1. Disable autojoining that network in the future, and
2. Disassociate from that network.

Bug:22187193
Change-Id: I14dc9236c57e3ab7d3ec95edc906787cbfbf3c9f
2015-07-16 14:41:18 +00:00