Commit Graph

3725 Commits

Author SHA1 Message Date
Luke Huang
13801b90e2 Merge "interface-related commands porting" am: 808c2fa747 am: 21fecd5957
am: f1fba3e8fd

Change-Id: I7a44b6e8521dd2a852bbd7b4e07599df8951f7b2
2018-11-01 00:46:40 -07:00
Luke Huang
f1fba3e8fd Merge "interface-related commands porting" am: 808c2fa747
am: 21fecd5957

Change-Id: Iab8092b55399397d9e9f2333ce358964562daed7
2018-11-01 00:31:30 -07:00
Luke Huang
808c2fa747 Merge "interface-related commands porting" 2018-11-01 07:09:54 +00:00
Junyu Lai
74d5f7f24a Merge "Fix negative uid stats caused by 464xlat adjust when eBPF is on." am: 0d63da86e2 am: d62c2baa6d
am: cadfe44e05

Change-Id: I9d0d8b67ed0159ba2a71059620ebe5698eb79ccb
2018-10-30 19:56:01 -07:00
Junyu Lai
cadfe44e05 Merge "Fix negative uid stats caused by 464xlat adjust when eBPF is on." am: 0d63da86e2
am: d62c2baa6d

Change-Id: I3ee791e4b6fdd9d508807810183dc02c69bd2c0b
2018-10-30 19:46:18 -07:00
junyulai
c33ac0d43b Fix negative uid stats caused by 464xlat adjust when eBPF is on.
When using xt_qtaguid to count per uid stats,
NetworkStatsService needs to adjust the 464xlat traffic since
iptables module would double count for ipv4 and ipv6 packet.
But for eBPF, the per uid stats is collected in a different
hook, so the adjustment on root uid would only be needed in tx
direction.

Bug: 112226716
Test: 1. Make ipv4 traffic in ipv6-only network and check data
         usage.
      2. Make ipv4 traffic in a client which connect to
         ipv6-only hotspot.
      3. runtest frameworks-net
      4. cts-tradefed run cts -m CtsNetTestCases -t \
                 android.net.cts.TrafficStatsTest
      5. cts-tradefed run cts -m CtsUsageStatsTestCases

Change-Id: Ic9a84f5446eddc943c255d5f3b89dad171f53cac
2018-10-30 21:23:38 +08:00
Luke Huang
8c12dcd11a Merge "Refactor UidRange by using stable aidl structure" am: d1d3b374b7 am: 53c8b8a939
am: 68f4bd92bc

Change-Id: I82e06fe93a3ed88368b649ef8d3283322191ffe7
2018-10-28 18:06:15 -07:00
Luke Huang
68f4bd92bc Merge "Refactor UidRange by using stable aidl structure" am: d1d3b374b7
am: 53c8b8a939

Change-Id: I09ac7fc6525948b76114ef936dc1b3d2d1bae0fb
2018-10-28 17:55:57 -07:00
Treehugger Robot
d1d3b374b7 Merge "Refactor UidRange by using stable aidl structure" 2018-10-29 00:17:34 +00:00
Luke Huang
1edf4c6397 Merge "Firewall-related commands porting" am: 1acfa7de1b am: 6ba18c6b03
am: b87796365e

Change-Id: I3a2d3115a9664fd2be458076d7a7092a7cb5293c
2018-10-25 21:21:01 -07:00
Chalard Jean
96d551145d Merge "To support skip464xlat per Network" am: a01c77a499 am: e826aa52e4
am: fbb737678b

Change-Id: I4a6d7480e2e7e775e511cc7eaaabe65b6a3bde7d
2018-10-25 20:09:15 -07:00
Luke Huang
14f7544c3e interface-related commands porting
Test: runtest frameworks-net passes
Test: manual testing of interface related function works(tethering)
Change-Id: Ie1a1ac00c28ef914d62e7d75b0db8c2434c810d2
2018-10-25 16:40:47 +09:00
Luke Huang
b87796365e Merge "Firewall-related commands porting" am: 1acfa7de1b
am: 6ba18c6b03

Change-Id: I15cedc624dc20168edc8feecf78affb9fad5482b
2018-10-24 19:49:58 -07:00
Luke Huang
1acfa7de1b Merge "Firewall-related commands porting" 2018-10-25 00:20:12 +00:00
Chalard Jean
fbb737678b Merge "To support skip464xlat per Network" am: a01c77a499
am: e826aa52e4

Change-Id: I944738258051525b371bd17dd3ee7b411b82d12b
2018-10-24 17:19:51 -07:00
Nathan Harold
41e2d7494f Merge "Move some members to the "Q blacklist"." am: f5cf9f24ed
am: 13c9e7e2f3

Change-Id: Ia2419cce28d26d9464da2a5172cb332b629e943e
2018-10-24 16:14:06 -07:00
Luke Huang
77017913a4 Refactor UidRange by using stable aidl structure
Use stable aidl generated structure instead of UidRange

Test: runtest frameworks-net passes
Test: manual testing of UidRange related function works
Change-Id: Iaf1c10777dc1e71df2be2a57533a10257b12626b
2018-10-24 19:45:09 +09:00
Chalard Jean
a01c77a499 Merge "To support skip464xlat per Network" 2018-10-24 07:15:20 +00:00
Luke Huang
a241db9df7 Firewall-related commands porting
Test: runtest frameworks-net passes
Test: manual testing of firewall works
Change-Id: Ic19c3872988a2b5dd315feb57e0757797d00a6ac
2018-10-24 13:12:41 +09:00
Mathew Inwood
45d2c252b1 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
(cherry picked from commit 8c854f86a4)
2018-10-22 17:28:24 -07:00
Junyu Lai
555917c3b0 Merge "Add new callback to inform blocking of network on specific uid." am: f709e754ab am: 745952eac8
am: 70626e3b94

Change-Id: I2bec503c5ffac156b679a48c09591458ab716789
2018-10-19 09:47:40 -07:00
Junyu Lai
70626e3b94 Merge "Add new callback to inform blocking of network on specific uid." am: f709e754ab
am: 745952eac8

Change-Id: I24b45f860992626968a6adfb0ff6b6389c85cf45
2018-10-19 09:26:39 -07:00
Junyu Lai
f709e754ab Merge "Add new callback to inform blocking of network on specific uid." 2018-10-19 15:20:48 +00:00
Chalard Jean
03eb7e1905 Merge "Fix a bug where Uri can't parse IPv6 literal addresses." am: 54677a86d4 am: 86ff3f4c7a
am: 6997192f35

Change-Id: I591c592e64a48f71f5528d999426343977fe48ce
2018-10-19 06:28:37 -07:00
Chalard Jean
6997192f35 Merge "Fix a bug where Uri can't parse IPv6 literal addresses." am: 54677a86d4
am: 86ff3f4c7a

Change-Id: Iec4629bc84bb32185be7120a6f5dfc5e97a5dbff
2018-10-19 06:14:19 -07:00
Chalard Jean
1a1d52ebb4 Fix a bug where Uri can't parse IPv6 literal addresses.
Bug: 25540738
Test: added CTS in aosp change #793137 and ran them
Change-Id: Ibf870b7e87799090fae9ed456286c11990b01461
2018-10-19 11:25:27 +09:00
Eran Messeri
5cb1e8e636 Merge "Enterprise Policy for Private DNS Setting" 2018-10-17 16:59:57 +00:00
Lorenzo Colitti
03fc4a7f68 Merge "Change permissions checks for setAirplaneMode." am: 3889ff53ed am: 10c175041e
am: 3d23e905a9

Change-Id: Icfc55aefa11a5e1dd92382c2be94c7b63889aa8f
2018-10-15 08:49:52 -07:00
Lorenzo Colitti
3d23e905a9 Merge "Change permissions checks for setAirplaneMode." am: 3889ff53ed
am: 10c175041e

Change-Id: Ibe5bbd51adae83e1bfb5a4ab43d29eb2ccd02a8b
2018-10-15 08:29:00 -07:00
Lorenzo Colitti
3889ff53ed Merge "Change permissions checks for setAirplaneMode." 2018-10-15 13:36:45 +00:00
Eran Messeri
a2e0ca77a8 Enterprise Policy for Private DNS Setting
A new API for setting the Private DNS settings value programatically via
the DevicePolicyManager.

Since there are two separate settings for Private DNS, and the value
provided for the hostname needs to be validated, a new
DevicePolicyManager API is introduced.

Only a Device Policy Client in Device Owner mode may change these
settings.
The DPC may additionally set a user restriction (added in a separate CL)
to prevent the user from changing Private DNS settings.

Bug: 112982691
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testPrivateDnsPolicy
Change-Id: I566437e4fe10e1346858149120c50b3c20ca073f
2018-10-15 11:53:22 +01:00
Lorenzo Colitti
f5845d14e1 Change permissions checks for setAirplaneMode.
Require NETWORK_SETTINGS (or NETWORK_SETUP_WIZARD) instead of the
legacy CONNECTIVITY_INTERNAL permission. The users are as follows:

- The system callers (Phone, Settings, SystemUI, VrSettings) all
  have NETWORK_SETTINGS.
- SetupWizard has NETWORK_SETUP_WIZARD
- sl4a has NETWORK_STACK

Bug: 115302596
Test: builds, boots, airplane mode via SystemUI works
Change-Id: I8ca40182bd8b5e3fd9a82296c0cc28de30ed4baf
2018-10-12 16:35:46 +09:00
Yuuki Habu
8f54b61a9a To support skip464xlat per Network
To add skip464exlat in NetworkMisc.
NetworkAgent can skip to start 464xlat if need.
(e.g. IMS PDN for Cellular can be disabled)

Device will treat the network as IPv6-only if it is set

Bug: 69949375
Test: Nat464XlatTest, ConnectivityServiceTest

Change-Id: I676a02cb92530d64f29f34e89482a934f3ec4553
2018-10-12 14:35:30 +09:00
Chalard Jean
e6726c89a6 Merge "Add log for debugging ConnectivityManager" am: 4b48dca2e8 am: e3c0f28a1e
am: d55d5c2126

Change-Id: I23a34c21d05db126d8d2aacdeb700b3d2b2ed018
2018-10-11 21:29:52 -07:00
Chalard Jean
d55d5c2126 Merge "Add log for debugging ConnectivityManager" am: 4b48dca2e8
am: e3c0f28a1e

Change-Id: I2d8604c172b26e474050afd45fba74dc6c2c18bc
2018-10-11 21:21:45 -07:00
Chalard Jean
4b48dca2e8 Merge "Add log for debugging ConnectivityManager" 2018-10-12 03:14:48 +00:00
junyulai
05986c638b Add new callback to inform blocking of network on specific uid.
Currently, apps rely on querying NetworkInfo object to know
whether their network is blocked or not. There is no proactive
way to tell app when it is being blocked/unblocked. The only
event that app would receive is SocketException with
ECONNABORTED when their ongoing socket connection has been
blocked, which is not an elegant way to notify app.

Thus, this commit is trying to address this problem. Therefore,
with the uses of other callbacks, the need of
getState/getDetailedState in NetworkInfo could be completely
eliminated.

Test: runtest frameworks-net
      runtest -x NetworkPolicyManagerServiceTest.java
      cts-tradefed run cts -m CtsHostsideNetworkTests
      cts-tradefed run cts -m CtsNetTestCases -t \
              android.net.cts.ConnectivityManagerTest
Bug: 74575553

Change-Id: Iec96a3103d0aa9a505020eb89d69b89c0b694486
2018-10-11 16:31:10 +08:00
Lorenzo Colitti
8494db31cb Merge "Make setAirplaneMode @SystemApi for SetupWizard." am: 772b75c26d am: aab9359c05
am: 6b2f6b1e05

Change-Id: I994f0ff3ad9a3833eb56da7614e3632452d5c476
2018-10-10 23:32:45 -07:00
Lorenzo Colitti
6b2f6b1e05 Merge "Make setAirplaneMode @SystemApi for SetupWizard." am: 772b75c26d
am: aab9359c05

Change-Id: I8049e2484526104eba7fad92d2819eb94319fa84
2018-10-10 20:26:35 -07:00
Lorenzo Colitti
85eca488e5 Make setAirplaneMode @SystemApi for SetupWizard.
Expose ConnectivityManager#setAirplaneMode and the
NETWORK_SETUP_WIZARD permission so that SetupWizard can call
setAirplaneMode.

Delete setAirplaneMode from the greylist because the permissions
checks on it, since at least 2013, have been for a privileged
permission (CONNECTIVITY_INTERNAL) that normal apps don't have.

Test: m
Bug: 115302596
Change-Id: I28f24d32c4b4b386407e9e0e3514ea9f8854f4a8
2018-10-10 17:50:05 +09:00
Soi, Yoshinari
dee2aa4e55 Add log for debugging ConnectivityManager
Add log to ConnectivityManager for better investigations of issue.
This patch adds StackTrace to the following APIs.

reportInetCondition()
reportBadNetwork()
reportNetworkConnectivity()
sendRequestForNetwork()
requestNetwork()
releaseNetworkRequest()
registerNetworkCallback()
unregisterNetworkCallback()

Bug: 116751720
Change-Id: I992292cd9d6f3d69c91ddbde5577591f9ec0f39b
2018-10-10 11:56:04 +09:00
Andrew Solovay
d10e384d6c resolve merge conflicts of a3e34fe9fe to pi-dev-plus-aosp
Bug: None
Test: Eyeballed (comment-only change).
Change-Id: Ia644cde66376b2bddeb27bb2a147b3266037aa2c
Exempt-From-Owner-Approval: Docs-only change
Merged-In: Ia06e1fffd814671289a1caebd5962aedc18a28d7
2018-10-04 22:50:39 +00:00
Andrew Solovay
a3e34fe9fe Merge "docs: Replacing {#link with {@link" into pi-dev 2018-10-04 20:06:59 +00:00
Andrew Solovay
a44f2c075b docs: Replacing {#link with {@link
Several java files had the typo {#link (for cross-references to other
Javadocs) instead of the proper {@link format. This was confusing the
new doc publish tool (Mivi) since that's the format used for {# Django
comments #}.

Fixed a couple of links that had other errors (which prevented building
once the {# -> {@ was done) and other typos.

Replaced throughout the frameworks/base project; I'll need a separate CL
for the AndroidX fixes.

Staged to:

go/dac-stage/reference/android/app/Instrumentation.html
go/dac-stage/reference/android/bluetooth/BluetoothAdapter.html
go/dac-stage/reference/android/bluetooth/BluetoothDevice.html
go/dac-stage/reference/android/bluetooth/BluetoothServerSocket.html
go/dac-stage/reference/android/inputmethodservice/InputMethodService.html
go/dac-stage/reference/android/view/KeyCharacterMap.html
go/dac-stage/reference/android/view/KeyEvent.html
go/dac-stage/reference/android/media/AudioManager.html
go/dac-stage/reference/android/net/wifi/WifiConfiguration.html

(Other files were not in the public Javadocs.)

Bug: 111925950
Test: make ds-docs
Exempt-From-Owner-Approval: Docs-only change
Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Merged-In: Ia06e1fffd814671289a1caebd5962aedc18a28d7
2018-10-04 18:20:51 +00:00
Andrew Solovay
b577f20c23 Merge "cherry-pick from pi-dev docs: Replacing {#link with {@link" 2018-10-04 18:17:23 +00:00
Andrew Solovay
5c05dedda1 cherry-pick from pi-dev docs: Replacing {#link with {@link
Several java files had the typo {#link (for cross-references to other
Javadocs) instead of the proper {@link format. This was confusing the
new doc publish tool (Mivi) since that's the format used for {# Django
comments #}.

Fixed a couple of links that had other errors (which prevented building
once the {# -> {@ was done) and other typos.

Replaced throughout the frameworks/base project; I'll need a separate CL
for the AndroidX fixes.

(Other files were not in the public Javadocs.)

Bug: 111925950
Test: make ds-docs
Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Original Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Exempt-From-Owner-Approval: Docs-only change
2018-10-04 18:17:05 +00:00
kopriva
331101321f Merge "docs: fixing several typos, bug 36941887" into pi-dev am: 7640a41654
am: 9c736132c2

Change-Id: Idc9080fb4f2ec58a1817a8e847213f8d6bcbb2fa
2018-10-03 17:16:33 -07:00
kopriva
9c736132c2 Merge "docs: fixing several typos, bug 36941887" into pi-dev
am: 7640a41654

Change-Id: I4e95b8e43ce12a428baa41102260d6b145589a34
2018-10-03 16:58:12 -07:00
kopriva
c5fea19846 docs: fixing several typos, bug 36941887
Test: make ds-docs

Bug: 36941887

Change-Id: Id65c5a6b1cbb214ea46b13a6a68d667c819a2f60
Exempt-From-Owner-Approval: Docs-only change
2018-10-03 13:29:15 -07:00
Lorenzo Colitti
49018457bf Merge "Make requestRouteToHost a no-op for system callers." am: f1bcfb6014 am: 07012857ae
am: b0cac388e4

Change-Id: I2999208487c2c15d7e158e690cf7a2ac4e7c3e6d
2018-09-30 23:47:25 -07:00