Commit Graph

2998 Commits

Author SHA1 Message Date
Robin Lee
5b52bef8d8 Internal API for system apps to determine default network for other apps
Callers with CONNECTIVITY_INTERNAL permission can read off the netId
that an application is assigned to by default.

Necessary for making connections as the default network for a client
app eg. when downloading stuff on its behalf.

Bug: 27074270
Change-Id: I8d35e8e99126875f55f3c545090326f3e9be43fb
2016-04-07 14:55:59 +00:00
Erik Kline
e9c091ba5a Merge "Make public the registerDefaultNetworkCallback API" into nyc-dev am: df78e84
am: a577a3a

* commit 'a577a3a29f601fd2b71ad89eedcc52bdd8efbccb':
  Make public the registerDefaultNetworkCallback API

Change-Id: Ic749ede5b84e443fed04701ecdd0f6521a77158f
2016-04-06 08:58:22 +00:00
Erik Kline
df78e84ef7 Merge "Make public the registerDefaultNetworkCallback API" into nyc-dev 2016-04-06 08:51:08 +00:00
Erik Kline
1fb9333459 Don\'t flush DNS cache on route changes. am: b988890
am: 09a5fbd

* commit '09a5fbd6ec86000f95423a47e9266ee124609cb3':
  Don't flush DNS cache on route changes.

Change-Id: I0e019a46548bbc81628939989fad39f96bc83ebe
2016-04-06 04:00:25 +00:00
Trevor Johns
3e5055bec9 Merge branch 'mnc-mr-docs' into mnc-ub-dev
Large merge to reconnect automerger for docs branch to mainline.

 Conflicts:
	docs/html-intl/intl/es/index.jd
	docs/html-intl/intl/es/preview/download.jd
	docs/html-intl/intl/es/preview/index.jd
	docs/html-intl/intl/ja/index.jd
	docs/html-intl/intl/ja/preview/download.jd
	docs/html-intl/intl/ja/preview/index.jd
	docs/html-intl/intl/ko/index.jd
	docs/html-intl/intl/ko/preview/download.jd
	docs/html-intl/intl/ko/preview/index.jd
	docs/html-intl/intl/pt-br/index.jd
	docs/html-intl/intl/pt-br/preview/download.jd
	docs/html-intl/intl/pt-br/preview/index.jd
	docs/html-intl/intl/ru/index.jd
	docs/html-intl/intl/ru/preview/download.jd
	docs/html-intl/intl/ru/preview/index.jd
	docs/html-intl/intl/zh-cn/index.jd
	docs/html-intl/intl/zh-cn/preview/download.jd
	docs/html-intl/intl/zh-cn/preview/index.jd
	docs/html-intl/intl/zh-tw/index.jd
	docs/html-intl/intl/zh-tw/preview/download.jd
	docs/html-intl/intl/zh-tw/preview/index.jd
	docs/html/guide/topics/manifest/compatible-screens-element.jd
	docs/html/guide/topics/manifest/uses-feature-element.jd
	docs/html/preview/download.jd
	docs/html/preview/features/runtime-permissions.jd
	docs/html/sdk/index.jd
	docs/html/tools/revisions/studio.jd
	docs/html/tools/sdk/eclipse-adt.jd
	docs/html/tools/support-library/features.jd
	telephony/java/android/telephony/TelephonyManager.java

Bug: 28000173
Change-Id: Iacab0481175f1b32e0ac3bab98cde9e994100e94
2016-04-05 20:32:07 -07:00
Erik Kline
7c912a4025 Make public the registerDefaultNetworkCallback API
Change-Id: I89d7a6f49f5d6a0da3402a07407b0f8d93181b4f
2016-04-06 12:22:47 +09:00
Erik Kline
b988890b21 Don't flush DNS cache on route changes.
Since Lollipop, routes are isolated within Networks.  Flushing a
Network's DNS cache whenever that same Network's routes are updated
doesn't provide any benefit.  Any system components depending on this
behaviour need to uncovered and fixed.

Additionally, clean up no-longer-used flushNetworkDnsCache().  This
should be replaced, when needed, by a proper binder interface to netd.

Change-Id: I34bf79e4839da014d466058a876d754209d0c007
2016-04-06 11:30:51 +09:00
Erik Kline
62ba687155 Merge "Delete unused default DNS setting code" into nyc-dev am: 39ca5c2
am: 2e6eeed

* commit '2e6eeed7d321f468f9434927f0ca433926044bec':
  Delete unused default DNS setting code

Change-Id: I28efdd6bd2b1cbaf0936fcd7d0104b8bf3f27647
2016-04-05 04:09:44 +00:00
Erik Kline
85fc29e714 Delete unused default DNS setting code
Change-Id: I601a647714171f205d179d6fef6c112949fc5a94
2016-04-05 11:48:01 +09:00
Lorenzo Colitti
62d97981db Merge "Add a toString method to ApfCapabilities." into nyc-dev am: 36e480c
am: 366ce8a

* commit '366ce8a8d92b3368c51b7d7f1408eadcddcaf96c':
  Add a toString method to ApfCapabilities.

Change-Id: Iee5554cdabab4fe8a274faed22e0d56c48c64317
2016-03-29 08:17:35 +00:00
Lorenzo Colitti
bd0c0af47f Add a toString method to ApfCapabilities.
Change-Id: I505b90b7cd818cb3477990ec6b41b16db46d1c08
2016-03-28 17:33:30 +09:00
Paul Jensen
7e35dac240 Merge "Move ApfFilter from ConnectivityService to IpManager" into nyc-dev am: 732340c
am: ebdf3f0

* commit 'ebdf3f006854b04de2508314be7ac0788b6faa99':
  Move ApfFilter from ConnectivityService to IpManager
2016-03-25 13:01:09 +00:00
Paul Jensen
6b7f7a0852 Move ApfFilter from ConnectivityService to IpManager
There's a few advantages to having ApfFilter in IpManager:
1. If things go wrong, crashing a particular transport is less bad then
   crashing ConnectivityService.  We also don't want to use
   ConnectivityService as a dumping ground for transport-specific logic.
2. This makes implementing WifiManager.MulticastLock a lot simpler and
   safer because enabling/disabling it doesn't have to go through the
   NetworkAgent, which could risk various races (e.g. installing a filter
   into the wrong WiFi network).
3. IpManager is the ultimate source for LinkProperties for a particular
   transport and since ApfFilter uses the LinkProperties it's better to
   have it closely paired with the IpManager. Likewise, ApfFilter needs
   to know the APF capabilities of the transport, so having it in
   the transport avoids having to parcel this information through the
   NetworkAgent.

Bug: 26238573
Change-Id: I99b85f2b64972f0e7572170ec5d1926081aa3429
2016-03-25 07:46:07 -04:00
Pierre Imai
7d65e52f5d Merge "Add initial connectivity metrics handling." into nyc-dev am: 1ed762c
am: 0abbcda

* commit '0abbcda3ad85b523fc1eef27f76f0d642c19245b':
  Add initial connectivity metrics handling.
2016-03-25 06:25:23 +00:00
Pierre Imai
1ed762c929 Merge "Add initial connectivity metrics handling." into nyc-dev 2016-03-25 06:17:36 +00:00
Pierre Imai
194a57644d Add initial connectivity metrics handling.
Adds initial support for IP connectivity metrics collection (DHCP
client, IP reachability monitor, network monitor, connectivity
service).

Change-Id: If9a0455f2a34aa9abea90f9c1b38e4d895dc1a72
2016-03-25 13:21:41 +09:00
Erik Kline
f2a536f7b5 Merge "Add "track default" type to NetworkRequestInfo" into nyc-dev am: 3e4c79e4
am: 6d54e91

* commit '6d54e91479d185030cd167d292441d7bd9321c9f':
  Add "track default" type to NetworkRequestInfo
2016-03-24 04:29:45 +00:00
Erik Kline
2c61a26366 Add "track default" type to NetworkRequestInfo
The "default network tracking" request is somewhere between a listen
and a request, in previous semantics. It is more like a listen in that
it doesn't cause any network to be brought up, but also like a request
in that will only get callbacks about a single network at a time (not
all networks that might match).

This change minimally splits the NetworkRequest types into 3: LISTEN,
REQUEST, and TRACK_DEFAULT.

Change-Id: I2d113b2f6eed526a7808592bce0118260a56f77c
2016-03-24 12:52:54 +09:00
Jeremy Klein
407e2a51e0 Merge "Add a null check for the OnStartTetheringCallback." 2016-03-23 18:52:16 +00:00
Pierre Imai
475811222a Merge "Improve NetworkCapabilities command chaining." into nyc-dev am: 9b71d66
am: 8704426

* commit '87044260bed79cd191c21081b2394271797d902f':
  Improve NetworkCapabilities command chaining.
2016-03-23 01:22:19 +00:00
Pierre Imai
9b71d6659d Merge "Improve NetworkCapabilities command chaining." into nyc-dev 2016-03-23 01:11:15 +00:00
Paul Stewart
3dee52489b Merge changes Iddeebeb8,Idd1e37a3 into nyc-dev am: e611bda
am: 366f851

* commit '366f851e35019816f278de6307c5aec87bbe569f':
  WifiManager: Use ConnectivityThread
  Create ConnectivityThread
2016-03-22 22:31:06 +00:00
Paul Stewart
e611bda1e2 Merge changes Iddeebeb8,Idd1e37a3 into nyc-dev
* changes:
  WifiManager: Use ConnectivityThread
  Create ConnectivityThread
2016-03-22 22:23:48 +00:00
Pierre Imai
aabd22dad9 Improve NetworkCapabilities command chaining.
setNetworkSpecifier() now returns this.
BUG: 26797290

Change-Id: Ia8bd0836d9ac715408eca102bf4a2d23f044fa72
2016-03-22 22:29:22 +09:00
Erik Kline
8ac4ad8df5 Merge "Support registering a request for the default network" into nyc-dev am: d36ba73
am: e96834c

* commit 'e96834c583f99fb31bb9c80bddc8a73387fed028':
  Support registering a request for the default network
2016-03-22 07:33:25 +00:00
Erik Kline
23bf99c956 Support registering a request for the default network
Change-Id: I079f5be97b585cf5692dd4c7a144b993d168a9a5
2016-03-22 15:44:16 +09:00
Lorenzo Colitti
768bd2c12e Merge "Remove framework code that calls SIOCKILLADDR" into nyc-dev am: e6109dd
am: 7ceb8f5

* commit '7ceb8f53825c1220647f3282da62ada393e8b6a5':
  Remove framework code that calls SIOCKILLADDR
2016-03-22 05:47:06 +00:00
Lorenzo Colitti
d8332d1a1b Remove framework code that calls SIOCKILLADDR
Bug: 26976388
Change-Id: I652361d9e650a77085070d6c26b28b7638ba2dfe
2016-03-22 12:54:32 +09:00
Paul Stewart
1f6a458995 Create ConnectivityThread
Create a common singleton thread to be shared among all
connectivity tasks.  Instead of launching separate threads to
handle downstream messages from the various service instances used
in connectivity, these managers can choose to share this instance.

Bug: 27695292

Change-Id: Idd1e37a3e793c5485091509c3d7351e4d29288f0
2016-03-19 10:05:06 -07:00
Lorenzo Colitti
c2f99d7910 Merge changes Idf0cfee8,I27307e2e into nyc-dev am: 7d0e392
am: e77e70d

* commit 'e77e70d00f3da6dd856f2d641d46080fbebacd0a':
  Use native netd binder interface in NetworkManagementService.
  Fix IdleableHandlerThread.
2016-03-17 19:09:06 +00:00
Lorenzo Colitti
6114f2bbb1 Fix IdleableHandlerThread.
Occasionally, ConnectivityServiceTest fails with "BUG: only one
idle handler allowed". I have not been able to reproduce this
consistently, but code inspection reveals an unsafe access to
mIdleHandler inside queueIdle. Wrap that in a synchronized block.

Change-Id: I27307e2e55fa8d937d7f043bd436894091c3c667
2016-03-17 10:52:57 +09:00
Lorenzo Colitti
b520f1d12c Merge "APF: add debug code." into nyc-dev am: 6b7c9ec
am: ae57b47

* commit 'ae57b477436f1e89bb7c92533680cf445db67053':
  APF: add debug code.
2016-03-16 08:20:36 +00:00
Lorenzo Colitti
1e01f0872e APF: add debug code.
1. Store additional debug information when RA filtering.
2. Add a toString method for RA packets.
3. Make "adb shell dumpsys connectivity apf" dump APF filter
   state.

Bug: 26238573
Change-Id: I1441ff7bc90e63624f8b10a220b2ac97f4d390a5
2016-03-16 15:45:47 +09:00
Jeremy Klein
35e99ea8ef Add a null check for the OnStartTetheringCallback.
This avoids a NullPointerException when trying to call the callback
and gives a more readable error message.

Change-Id: Id0353ef541c76efcb4a9a12c082e1b6ec9389f02
2016-03-14 12:57:17 -07:00
Jeff Davidson
8b8d4014ab Merge "NetworkStats.Bucket API polish." into nyc-dev am: 6daa09a162
am: cb4ad1548e

* commit 'cb4ad1548ec10019760bbfd76268805809301fd6':
  NetworkStats.Bucket API polish.
2016-03-14 19:37:56 +00:00
Jeff Davidson
6daa09a162 Merge "NetworkStats.Bucket API polish." into nyc-dev 2016-03-14 19:30:23 +00:00
Jeff Davidson
43e43a99c9 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
2016-03-14 11:24:12 -07:00
Robin Lee
0bbd52a09c Merge "Skip lockdown setup if user is not up yet" into nyc-dev am: d646b3d67f
am: 2149ad57fd

* commit '2149ad57fda5b04a07a9ae7af723a358f7e29d2b':
  Skip lockdown setup if user is not up yet
2016-03-14 13:28:27 +00:00
Robin Lee
050d914677 Skip lockdown setup if user is not up yet
Sometimes USER_UNLOCKED can be sent before USER_STARTED. This puts
lockdown in a bad state as it needs a fully-functioning user to tie
itself to and listen for connectivity events.

Bug: 27637943
Change-Id: I41a784a75a8c8674cb61dbba10693dd56c9396dd
2016-03-14 13:19:14 +00:00
zhangshuxiao
ad8499f9cd When the applicantion is removed, reset network permission of this uid.
Probably not a portal: exception java.net.SocketException: Binding socket to network 102 failed: EPERM (Operation not permitted)

If there are SYSTEM permissions, then the original is SYSTEM permissions,
do not update. If other app of this uid have network permissions, the same
as before do not update, or update permissions. If all app of this uid
do not have any network permission to remove permissions.

Change-Id: I304d22b37de38d8b182639c0d7d7200adfcf715d
Signed-off-by: zhangshuxiao <zhangshuxiao@xiaomi.com>
2016-03-11 16:45:59 +08:00
Lorenzo Colitti
e74e501c37 DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class. am: 502d7cd551 -s ours am: 96b3d0a1bb
am: fc79ffdbe6  -s ours

* commit 'fc79ffdbe641a470e364cf205616879cb87e3eb1':
  DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
2016-03-07 22:30:32 +00:00
Lorenzo Colitti
96b3d0a1bb DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
am: 502d7cd551  -s ours

* commit '502d7cd551e8a510f818bbe85a038c4e60913ef7':
  DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
2016-03-07 22:19:32 +00:00
Lorenzo Colitti
502d7cd551 DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
Cherry-picked from 4b0c762011

Bug: 19159232
Change-Id: Ic366b53259ee5944a8e864876425a6558c0a7216
2016-03-07 10:34:32 -08:00
Joe Onorato
f18010f994 Merge changes Ib6e0e6f3,I109f04c2,Idc716000,I44c51d5f,I810b9bd5, ... into nyc-dev am: 5d4ab988bd
am: 15e93f3715

* commit '15e93f3715742d0ffad6089cf804842f2e5f393b':
  Turn down the logging a little bit.
  Turn down the logging a little bit and don't do a log wrapper function.
  Turn down the logging a little bit.
  Turn down the logging a little bit.
  Turn down the logging a little bit.
  Turn down the logging a little bit.
  Turn down the logging a little bit.
2016-03-04 21:53:06 +00:00
Joe Onorato
8441f29d3a Turn down the logging a little bit.
Change-Id: Ib6e0e6f3577afac3b9bfe9a9b1cce70fb16d9d04
2016-03-04 12:21:30 -08:00
Paul Jensen
e3b37eaa84 Have ConnectivityService install packet filters when possible am: 9eca1f6072 am: 1d411461ef
am: 171160a352

* commit '171160a35286c12fb89058cd89d1bf93ff8943bf':
  Have ConnectivityService install packet filters when possible
2016-03-03 14:54:43 +00:00
Paul Jensen
1d411461ef Have ConnectivityService install packet filters when possible
am: 9eca1f6072

* commit '9eca1f607295b7138ac2113f77ae6018fe17f200':
  Have ConnectivityService install packet filters when possible
2016-03-03 14:48:45 +00:00
Lorenzo Colitti
dd29cf55ce Support 464xlat on Ethernet. am: 6a6903553b am: fbf7f85029
am: 9c129cccac

* commit '9c129cccac2a14ac2e4369e52134d2cb95e9da28':
  Support 464xlat on Ethernet.
2016-03-03 08:55:16 +00:00
Lorenzo Colitti
fbf7f85029 Support 464xlat on Ethernet.
am: 6a6903553b

* commit '6a6903553b196988d149d251652af9b73a2ddec2':
  Support 464xlat on Ethernet.
2016-03-03 08:39:16 +00:00
Paul Jensen
9eca1f6072 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
2016-03-03 17:32:01 +09:00