Commit Graph

3178 Commits

Author SHA1 Message Date
Lorenzo Colitti
35e18d0049 Fix one of the breakages of ConnectivityServiceTest in master.
Change-Id: I31c7a019383fa589beb1572486700e54edfb97e8
2015-11-27 11:46:18 +09:00
Lorenzo Colitti
3999ca3d84 Merge "Fix javadoc for the NetworkRequest version of requestNetwork." 2015-11-26 08:16:51 +00:00
Lorenzo Colitti
5a97ed19a8 Fix javadoc for the NetworkRequest version of requestNetwork.
The documentation for this method says that the request can be
released using releaseNetworkRequest, but that's not true.
releaseNetworkRequest only takes a PendingIntent, and can only be
used to release a request filed with a PendingIntent.

Fix the docs to say that the request needs to be released using
unregisterNetworkCallback.

Change-Id: If044fd2d463ab8d09874172d5d56946251057a3c
2015-11-26 17:06:20 +09:00
Lorenzo Colitti
318e8eec0e Make the new NetworkRequest flavour consistent with the others.
Change-Id: I491eb0b6d2fa0f1c472c97ef403488407e71803e
2015-11-25 15:47:14 +09:00
Lorenzo Colitti
7493d4695b Merge "Temporarily add a requestNetwork flavour that takes a legacy type" 2015-11-25 06:37:25 +00:00
Lorenzo Colitti
6653c4dc9c Temporarily add a requestNetwork flavour that takes a legacy type
This method is public @hide to support progressive refactoring of
tethering away from startUsingNetworkFeature to requestNetwork,
without getting in the way of the CONNECTIVITY_ACTION cleanup in
b/22513439 .

Bug: 9580643
Bug: 22513439
Change-Id: I9053ec746cc8f415a2d5849f044667eeb14e1b19
2015-11-25 12:00:52 +09:00
Sreeram Ramachandran
c16309fa1d Don\'t use framework permission strings for netd permissions. am: 5c36486ea0 am: f51479864b am: e7267a355d am: d3b6e2d790 am: c987320b4a am: 992bfeab73 am: 26b435dfe1 am: 6d983179a0 am: 5d41bd8d1a am: c1552f0caf am: 38a3b2154c
am: 017e0c060c

* commit '017e0c060c659931859d3a63436000940c7c785e':
  Don't use framework permission strings for netd permissions.
2015-11-20 03:52:20 +00:00
Sreeram Ramachandran
017e0c060c Don\'t use framework permission strings for netd permissions. am: 5c36486ea0 am: f51479864b am: e7267a355d am: d3b6e2d790 am: c987320b4a am: 992bfeab73 am: 26b435dfe1 am: 6d983179a0 am: 5d41bd8d1a am: c1552f0caf
am: 38a3b2154c

* commit '38a3b2154c7ee5d75b5670abaa4c154edd3c36eb':
  Don't use framework permission strings for netd permissions.
2015-11-20 01:52:25 +00:00
Sreeram Ramachandran
c1bde19a5e Don\'t use framework permission strings for netd permissions. am: 5c36486ea0 am: f51479864b am: e7267a355d am: d3b6e2d790 am: c987320b4a am: 992bfeab73 am: 26b435dfe1 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
26b435dfe1 Don\'t use framework permission strings for netd permissions. am: 5c36486ea0 am: f51479864b am: e7267a355d am: d3b6e2d790 am: c987320b4a
am: 992bfeab73

* commit '992bfeab73c940cda7afe10af2d669d297218af5':
  Don't use framework permission strings for netd permissions.
2015-11-19 16:50:11 +00:00
Sreeram Ramachandran
992bfeab73 Don\'t use framework permission strings for netd permissions. am: 5c36486ea0 am: f51479864b am: e7267a355d am: d3b6e2d790
am: c987320b4a

* commit 'c987320b4ad1a6fea7bb948cf045e6afb768d339':
  Don't use framework permission strings for netd permissions.
2015-11-19 16:40:35 +00:00
Sreeram Ramachandran
c987320b4a Don\'t use framework permission strings for netd permissions. am: 5c36486ea0 am: f51479864b am: e7267a355d
am: d3b6e2d790

* commit 'd3b6e2d790f95f2fb3d85f0993b90bb8708a6114':
  Don't use framework permission strings for netd permissions.
2015-11-19 16:30:59 +00:00
Sreeram Ramachandran
e7267a355d Don\'t use framework permission strings for netd permissions. am: 5c36486ea0
am: f51479864b

* commit 'f51479864b9ef8c82e4250cc972f1adee5a142d6':
  Don't use framework permission strings for netd permissions.
2015-11-19 16:10:19 +00:00
Sreeram Ramachandran
f51479864b Don\'t use framework permission strings for netd permissions.
am: 5c36486ea0

* commit '5c36486ea0a01f8e11ce2c365e435c7968293de7':
  Don't use framework permission strings for netd permissions.
2015-11-19 15:59:42 +00:00
Sreeram Ramachandran
5c36486ea0 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 e203d89.

Bug: 21900139
Bug: 18194858
Change-Id: Ib3ec377ab26ce904d3d4678f04edec6cb1260517
(cherry picked from commit d9bf64ba1d)
2015-11-18 17:04:18 +00:00
Christopher Tate
a75b36178d 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.

Bug 20157436

Change-Id: I2eb030a24efdd466a2eee1666c5231201b43684b
2015-10-30 12:14:15 -07:00
Erik Kline
aa8f8f33b5 Also treat loss of IPv6 as a loss of provisioning.
Bug: 23226635
Change-Id: Icebb7d83ed5b3b796901b9f023909a02eb461941
2015-10-27 17:11:27 +09:00
Lorenzo Colitti
44e6ace9c3 Merge "Reinstate CHANGE_NETWORK_STATE as a normal permission." into mnc-dr-dev am: 809dcade99 am: bdc458048a am: bb8f652372
am: 550cc7cfd2

* commit '550cc7cfd2e8f93c8cb6e59078ce9c16d93c912a':
  Reinstate CHANGE_NETWORK_STATE as a normal permission.
2015-10-22 06:33:09 +00:00
Lorenzo Colitti
550cc7cfd2 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
86f052636f 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
0b40c87afc 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
feb08ac5a3 Merge "Don\'t buzz when automatically connecting to captive portals" into mnc-dr-dev am: d214496319 am: 5c09f31e49 am: 18ec0b5187
am: c60969a5e5

* commit 'c60969a5e558e7e645900d3586f8564ddc82fab3':
  Don't buzz when automatically connecting to captive portals
2015-10-21 02:28:06 +00:00
Lorenzo Colitti
c60969a5e5 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
21dd113304 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
5d3203086b 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
3147b284f3 am f66c49e5: am 9c8abd1d: am f23eece2: am d37059e6: Merge "Don\'t crash if an invalid always-on VPN profile is configured." into mnc-dr-dev
* commit 'f66c49e5b1b9dde59fbdcc652ab232f85773dcb0':
  Don't crash if an invalid always-on VPN profile is configured.
2015-10-14 18:01:48 +00:00
Erik Kline
f66c49e5b1 am 9c8abd1d: am f23eece2: am d37059e6: 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
5c2b44e5fa am d37059e6: Merge "Don\'t crash if an invalid always-on VPN profile is configured." into mnc-dr-dev
* commit 'd37059e6aa6fbb0733730cb99a0413686a83e241':
  Don't crash if an invalid always-on VPN profile is configured.
2015-10-14 17:42:31 +00:00
Erik Kline
d37059e6aa 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
60f1e8cbb4 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
4c678a94b5 resolved conflicts for b7f40415 to master
Change-Id: I1f13a63c3680901fac58ef709118c9242032b11f
2015-10-12 17:51:45 -07:00
Jeff Sharkey
b7f4041550 am 75051c3a: am 7f6d8754: am 114f3fe2: 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
0bc8b7d358 am 114f3fe2: Merge "Push firewall rules up to ConnectivityService." into mnc-dr-dev
* commit '114f3fe265c742a83fc97174ff8501693bb92ff3':
  Push firewall rules up to ConnectivityService.
2015-10-12 16:39:45 +00:00
Jeff Sharkey
114f3fe265 Merge "Push firewall rules up to ConnectivityService." into mnc-dr-dev 2015-10-12 16:34:19 +00:00
Lorenzo Colitti
4e99c84bc6 Merge "Log UID and PID of legacy route requests." 2015-10-09 06:35:51 +00:00
Lorenzo Colitti
4e69f08c64 Log UID and PID of legacy route requests.
Bug: 23801105
Change-Id: I1722af0424f5b9bbd7276b77ce1571842fa541b3
2015-10-09 13:08:34 +09:00
Lorenzo Colitti
28bb16c366 Add a null check to hasIPv4AddressOnInterface.
Change-Id: Ie38505ec0a93f4060348d92db341c536b7d60ed0
2015-10-09 12:36:30 +09:00
Fyodor Kupolov
6c7a780dd6 Fixed VPN support for restricted profiles in split system user model
In a new split system user model, owner of a restricted profile is not limited
to just user0. restrictedProfileParentId field should be used to get an owner.

Bug: 22950929
Change-Id: I928319a9450e543972237a42267eb2404e117c83
2015-09-28 16:44:04 -07:00
Elliott Hughes
10b521a490 am 9653a1d4: am 830ed7c8: resolved conflicts for a884d81e to stage-aosp-master
* commit '9653a1d4b1d87111bb90d9cc0be89d2e5fabba8f':
  constify JNINativeMethod function pointer tables
2015-09-24 17:23:00 +00:00
Elliott Hughes
9653a1d4b1 am 830ed7c8: resolved conflicts for a884d81e to stage-aosp-master
* commit '830ed7c82f13e162017a609420ebf46d10b0f4bf':
  constify JNINativeMethod function pointer tables
2015-09-24 17:14:10 +00:00
Elliott Hughes
830ed7c82f resolved conflicts for a884d81e to stage-aosp-master
Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
2015-09-24 10:01:32 -07:00
Paul Jensen
8305b479dd am 6ae227e2: am a2e47e2f: am d737f715: am 9f22f069: am 2c183a0f: am d2287312: am 4cbfe331: am d7d3affa: am f5118c89: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit '6ae227e27fcab0a454ac45b897843bfceaa09c69':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-09-23 19:52:00 +00:00
Paul Jensen
2642986508 am f86347f5: am 88674941: am 6a728e17: am be6f0f5f: am 7ba4015c: am 96a44308: (-s ours) am 10a7d744: am 734a54f6: am 9f99bc6c: am a9e98343: Merge "Fix NOT_RESTRICTED network capability and enforce it." into lmp-dev
* commit 'f86347f54d0da443172713db0f6fc145ca5b19ff':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-09-23 19:51:53 +00:00
Paul Jensen
4621ebdf88 am 9f22f069: am 2c183a0f: am d2287312: am 4cbfe331: am d7d3affa: am f5118c89: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit '9f22f069e60a8952b5b64053cc2c1bcb7175418e':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-09-23 14:57:59 +00:00
Paul Jensen
b1e0a40c4e am be6f0f5f: am 7ba4015c: am 96a44308: (-s ours) am 10a7d744: am 734a54f6: am 9f99bc6c: am a9e98343: Merge "Fix NOT_RESTRICTED network capability and enforce it." into lmp-dev
* commit 'be6f0f5f0936364ff500cad2886485f82a7e736b':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-09-23 14:57:53 +00:00
Paul Jensen
9f22f069e6 am 2c183a0f: am d2287312: am 4cbfe331: am d7d3affa: am f5118c89: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit '2c183a0f849f97eda4f441fac7994d8e8234344b':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-09-23 14:50:45 +00:00
Paul Jensen
be6f0f5f09 am 7ba4015c: am 96a44308: (-s ours) am 10a7d744: am 734a54f6: am 9f99bc6c: am a9e98343: Merge "Fix NOT_RESTRICTED network capability and enforce it." into lmp-dev
* commit '7ba4015c955f2ecd9433093d948e37686ef8f91a':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-09-23 14:50:40 +00:00
Paul Jensen
2c183a0f84 am d2287312: am 4cbfe331: am d7d3affa: am f5118c89: am ece4ac21: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into lmp-dev
* commit 'd2287312c6ce3ed99b411a6ec86c0333bfd3ae65':
  Don't mark NetworkRequests restricted when they don't have restricted caps
2015-09-23 14:42:02 +00:00
Paul Jensen
7ba4015c95 am 96a44308: (-s ours) am 10a7d744: am 734a54f6: am 9f99bc6c: am a9e98343: Merge "Fix NOT_RESTRICTED network capability and enforce it." into lmp-dev
* commit '96a44308b69c1f098c5e5aaae01cab87ea9e10aa':
  Fix NOT_RESTRICTED network capability and enforce it.
2015-09-23 14:41:57 +00:00
Paul Jensen
d2287312c6 am 4cbfe331: am d7d3affa: am f5118c89: 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