Commit Graph

2411 Commits

Author SHA1 Message Date
Lorenzo Colitti
b7993df3ba Require the new PACKET_KEEPALIVE_OFFLOAD permission.
Bug: 23884210
Change-Id: I50a1a647a69deaba92e73021ee7d6cc0f3eb1eee
2015-09-09 00:16:57 +09:00
Lorenzo Colitti
723f82f17f Add an error code for generic hardware error.
This is necessary because currently the wifi code just returns
whatever hardware-specific integer it gets back from the HAL,
which is bad because that will be interpreted by the caller as
one of the error codes defined in this class.

In parallel we'll also modify the wifi code to return this new
error code if the hardware returns an error.

Bug: 21405946
Change-Id: Ic9fa1193ced69a4e7ff543e397221c89b10a5a13
2015-09-09 00:16:57 +09:00
Lorenzo Colitti
bdaaf14f96 Fix bugs and crashes in PacketKeepalive API.
Bug: 22606153
Bug: 23820819
Bug: 23884210
Change-Id: I1bf82094ec664baed345e9fb137fada0cbf4b7a0
2015-09-09 00:16:56 +09:00
Lorenzo Colitti
f25beee872 Add tests for the PacketKeepalive API.
This currently fails in many different ways, but it tells us what
to fix.

Bug: 22606153
Bug: 23884210
Change-Id: If2e5ee0a8d7b26cad67d3d566ed5b1383e0db096
2015-09-09 00:16:56 +09:00
Lorenzo Colitti
fe66316765 Use a CountDownLatch instead of sleep() in NetworkFactory tests.
This makes testNetworkFactoryRequests 2-3 times faster.

Bug: 22606153
Change-Id: I9657b6929e77f23ec811d0ab57b2ba974f0b6a69
2015-09-08 16:41:47 +09:00
Lorenzo Colitti
0891bc4f09 Get rid of shortSleep() in ConnectivityServiceTest.
Instead, use IdleHandler to wait for things to become idle.

Bug: 22606153
Change-Id: Ic6ab93ad4d336b40962f9be1096629a44b63ee2f
2015-09-08 16:41:47 +09:00
Lorenzo Colitti
c8d52c6993 Make ConnectivityServiceTest a bit more readable.
1. Make TestNetworkCallback a bit smarter and rename it to
   SingleUseNetworkCallback. This allows us to get rid of all the
   calls to TestNetworkCallback#getConditionVariable.
2. Delete the commented out code that used to test a
   ConnectivityService model that has not been used since KK.
3. Remove unused imports, etc.

Bug: 22606153
Change-Id: I81a2d0b970d19e5f4515490d8c2f88d416445fa1
2015-09-07 20:41:51 +09:00
Robert Greenwalt
72c6951953 am a59ee3ac: am 597c55b5: am e686d9b3: am 8e285f2f: Merge "Cut down some logs." into mnc-dr-dev
* commit 'a59ee3ac094d9d2a1c38852bc824d20f8166e28a':
  Cut down some logs.
2015-09-06 23:08:25 +00:00
Robert Greenwalt
b2f4802da2 am 8e285f2f: Merge "Cut down some logs." into mnc-dr-dev
* commit '8e285f2f74460b1b4bc9ba0faa3c94540f5ab92c':
  Cut down some logs.
2015-09-04 22:06:21 +00:00
Robert Greenwalt
72877c2493 Cut down some logs.
bug:23623327
Change-Id: I737d4e6c384bf4da62c65ad2abe0c9b5dca0067a
2015-09-03 17:53:42 -07:00
Daniel Estrada Alva
43b0bcbe25 am 429b020e: am 280b4495: am 967c8816: am cfd45ae4: Merge "Add SUPL-specific network bcast" into mnc-dr-dev
* commit '429b020e615eebd244208373c2a3e81c59da36ec':
  Add SUPL-specific network bcast
2015-09-03 06:40:03 +00:00
Daniel Estrada Alva
23072d6c42 am cfd45ae4: Merge "Add SUPL-specific network bcast" into mnc-dr-dev
* commit 'cfd45ae4718934d403a17410ab6a7c722bdd01fc':
  Add SUPL-specific network bcast
2015-09-02 21:12:13 +00:00
Robert Greenwalt
6803efe7ee Add SUPL-specific network bcast
Move SUPL CONNECTIVITY_ACTION bcasts to a different, hidden intent
to reduce the churn of apps when SUPL comes/goes.

Short term hack until SUPL moves to use the new APIs and there's
no bcast.

bug:23350688
Change-Id: I3dc14b42afa72465260aa41ccedfe1df27baabd9
2015-09-01 15:06:04 -07:00
Robert Greenwalt
845b32d9d8 am 325c15df: am e3bcde94: Merge "Reduce CONNECTIVITY_CHANGE bcasts" into mnc-dev
* commit '325c15dfe3c31ea4d5e343fb170a0d20ad71bb4f':
  Reduce CONNECTIVITY_CHANGE bcasts
2015-08-28 22:34:16 +00:00
Robert Greenwalt
21fc1a295e am 8096be27: am fbb28f55: am 77d02900: am 325c15df: am e3bcde94: Merge "Reduce CONNECTIVITY_CHANGE bcasts" into mnc-dev
* commit '8096be27323b26ae177255381366823c8448e3c5':
  Reduce CONNECTIVITY_CHANGE bcasts
2015-08-28 22:16:02 +00:00
Robert Greenwalt
325c15dfe3 am e3bcde94: Merge "Reduce CONNECTIVITY_CHANGE bcasts" into mnc-dev
* commit 'e3bcde94caf8440d5e3958a340b3d276d03f7691':
  Reduce CONNECTIVITY_CHANGE bcasts
2015-08-28 21:36:39 +00:00
Robert Greenwalt
1bb9827d76 Reduce CONNECTIVITY_CHANGE bcasts
If an app uses the new api (requestNetwork) to bring up MMS, don't
mark it as a legacy request.  This was done because the messaging
service had to use a combination of new API and old
(requestRouteToHost) due to api problems.  This has been resolved
so don't mark these as legacy requests anymore.

The general stuff is still in for other types due to lack of testing
time but this should be removed altogether in the future.

bug:23350688
Change-Id: I41c27efb253c39d8af1357ae7916ed5315c716db
2015-08-28 12:37:54 -07:00
Paul Jensen
d3e8d7b4ce Don't mark NetworkRequests restricted when they don't have restricted caps
Requests without NET_CAPABILITIES_INTERNET and just the default network
capabilities should not be marked restricted.  Without this fix apps
can hit permissions exceptions if they inadvertently make requests
without NET_CAPABILITIES_INTERNET.

Bug:23164917
Change-Id: I4c7136821315bcb05dfc42ffbc505a5d4f6109e6
(cherry picked from commit 5d87922526)
2015-08-28 12:50:09 -04:00
Paul Jensen
e203d89de7 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
(cherry picked from commit 1b2d980e40)
2015-08-28 12:48:11 -04:00
Lorenzo Colitti
749bfc1606 am a5bfd73a: am ab5e962e: am d7121f56: am 3e4966ed: am 11e84bde: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into mnc-dev
* commit 'a5bfd73ab683d3310ee3ce31d7ad3edb656aa858':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-08-19 21:23:03 +00:00
Lorenzo Colitti
a825353efe am 3e4966ed: am 11e84bde: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into mnc-dev
* commit '3e4966ed2195172b8cf93abe17a2dc2192668024':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-08-19 20:58:44 +00:00
Lorenzo Colitti
3e4966ed21 am 11e84bde: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into mnc-dev
* commit '11e84bde9e98cb4b777a67208989d259883e9375':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-08-19 20:54:48 +00:00
Paul Jensen
5d87922526 Don't mark NetworkRequests restricted when they don't have restricted caps
Requests without NET_CAPABILITIES_INTERNET and just the default network
capabilities should not be marked restricted.  Without this fix apps
can hit permissions exceptions if they inadvertently make requests
without NET_CAPABILITIES_INTERNET.

Bug:23164917
Change-Id: I4c7136821315bcb05dfc42ffbc505a5d4f6109e6
2015-08-19 11:08:38 -04:00
Adam Lesinski
dd8a92a5b9 am 3170650a: am 56df15d3: am 5b3a38e0: am daf7e5be: am 886e7a63: Merge "Change default cellular activity timeout to 10" into mnc-dev
* commit '3170650a2b611f175e401634436c650a56d957e9':
  Change default cellular activity timeout to 10
2015-08-19 02:22:12 +00:00
Adam Lesinski
4a6bc3d477 am daf7e5be: am 886e7a63: Merge "Change default cellular activity timeout to 10" into mnc-dev
* commit 'daf7e5befdf829b3e8ef83e5a0af998859265091':
  Change default cellular activity timeout to 10
2015-08-19 01:39:03 +00:00
Adam Lesinski
daf7e5befd am 886e7a63: Merge "Change default cellular activity timeout to 10" into mnc-dev
* commit '886e7a63b122a30c69c663d32e3e5f880a07593e':
  Change default cellular activity timeout to 10
2015-08-19 00:53:35 +00:00
Adam Lesinski
6d4ebd786f Change default cellular activity timeout to 10
LTE radios take 10 seconds to power down, so we should set the
activity timeout to 10 seconds.

Bug:23294704
Change-Id: I7478b77f134b0fe2d82e39acd5c370add12735ca
2015-08-18 11:47:07 -07:00
Billy Lau
1b28ba07b5 am a0984c71: am 0ed58c3f: Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev
* commit 'a0984c71a173718a864cb9d06a2a9176d989d1bf':
  Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS
2015-08-09 19:40:47 +00:00
Billy Lau
85b90229bd am 4a10b66d: am 99271a39: am 9751afcf: am a0984c71: am 0ed58c3f: 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
Billy Lau
a0984c71a1 am 0ed58c3f: Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev
* commit '0ed58c3f002db531fa499913f8ba047a62f39df3':
  Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS
2015-08-07 22:22:24 +00:00
Billy Lau
0ed58c3f00 Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev 2015-08-07 22:16:03 +00:00
Billy Lau
ce3f9dc328 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
Paul Jensen
8d8db52e89 am abd27102: am 41779e46: am 95297732: am 4f74dbe1: resolved conflicts for merge of f5b01767 to mnc-dr-dev
* commit 'abd27102f4e232be448bc6012e0bd833637ab3fa':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-08-05 11:44:46 +00:00
Paul Jensen
23e37057e6 am 4f74dbe1: resolved conflicts for merge of f5b01767 to mnc-dr-dev
* commit '4f74dbe114cd7b2d6f9c113777424e5a4e1a37a3':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-08-05 11:24:35 +00:00
Paul Jensen
4f74dbe114 resolved conflicts for merge of f5b01767 to mnc-dr-dev
Change-Id: I3a8624b2b375e0d174983d7690082e0e6932c4de
2015-08-05 07:07:24 -04:00
Paul Jensen
f5b0176786 Merge "Fix NOT_RESTRICTED network capability and enforce it." into mnc-dev 2015-08-05 10:03:47 +00:00
Paul Jensen
1b2d980e40 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
Abodunrinwa Toki
90c145b2cd Merge "Turn off failing tests in FrameworksCoreTests." 2015-08-01 18:32:11 +00:00
Dianne Hackborn
3317ea3798 am 80d0df7c: am 62f05dfa: am 55a23950: am 34300e4b: am 18c1d830: Fix build.
* commit '80d0df7cd967d877422be706b250d46d33270477':
  Fix build.
2015-08-01 17:53:17 +00:00
Abodunrinwa Toki
47a70d00e7 Turn off failing tests in FrameworksCoreTests.
We want a green state so we can confidence in tests we write
going forward.

Change-Id: I2c8db848897b56d0c64202ad28861eb4a7572e07
2015-07-31 18:13:30 -07:00
Dianne Hackborn
953c40cf61 am 34300e4b: am 18c1d830: Fix build.
* commit '34300e4bd479d3e85692202688826662e7661eb1':
  Fix build.
2015-07-31 19:53:59 +00:00
Dianne Hackborn
34300e4bd4 am 18c1d830: Fix build.
* commit '18c1d8301d8f544ae133198459bbf2698d80a14b':
  Fix build.
2015-07-31 19:42:24 +00:00
Dianne Hackborn
18c1d8301d Fix build.
Change-Id: Icdf6fa14e53a1c030d0d90205d3bf2d7610b6196
2015-07-31 10:35:34 -07:00
Lorenzo Colitti
1a119d520b am 5bbbf8ed: am 3b03916d: am c7a86e90: am 25c1e480: am 4024ad11: 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
2e0d5f45f5 am 25c1e480: am 4024ad11: Merge "Stop supporting legacy ConnectivityManager routing methods in M." into mnc-dev
* commit '25c1e480f5fd3f67b4a4d2d9616c8af822db8de5':
  Stop supporting legacy ConnectivityManager routing methods in M.
2015-07-31 05:31:13 +00:00
Lorenzo Colitti
25c1e480f5 am 4024ad11: Merge "Stop supporting legacy ConnectivityManager routing methods in M." into mnc-dev
* commit '4024ad119816ed4c4ab62e8c6252c9d484e74a5f':
  Stop supporting legacy ConnectivityManager routing methods in M.
2015-07-31 05:24:49 +00:00
Lorenzo Colitti
4024ad1198 Merge "Stop supporting legacy ConnectivityManager routing methods in M." into mnc-dev 2015-07-31 05:17:08 +00:00
Hung-ying Tyan
2604fa162f am 058fbd0f: am 4581ca53: am 7b2b74e1: am dc7add28: am f049071d: Merge "Revise lockdown check in getLegacyVpnInfo()" into mnc-dev
* commit '058fbd0fef35e62d2baf3e58b7a0c2f24b155dff':
  Revise lockdown check in getLegacyVpnInfo()
2015-07-31 03:23:43 +00:00
Hung-ying Tyan
6a9f6f6738 am dc7add28: am f049071d: Merge "Revise lockdown check in getLegacyVpnInfo()" into mnc-dev
* commit 'dc7add287de5ef1e7c96596924bf73ee2d1c0f5d':
  Revise lockdown check in getLegacyVpnInfo()
2015-07-31 03:04:41 +00:00
Hung-ying Tyan
dc7add287d am f049071d: Merge "Revise lockdown check in getLegacyVpnInfo()" into mnc-dev
* commit 'f049071da45bec441813e29593e2bcd323a97bd0':
  Revise lockdown check in getLegacyVpnInfo()
2015-07-31 02:57:19 +00:00