Commit Graph

2364 Commits

Author SHA1 Message Date
Automerger Merge Worker
6a2a493c55 [automerger skipped] [SP20] Check signature permission when accessing network stats provider am: f62907d9ca -s ours
am skip reason: Change-Id Idfebd0a1988c3dcfd812d87e30f6a2034d6fbf6b with SHA-1 f2b6d74356 is in history

Change-Id: I41bb8c1d96e494f4e54ab59138f1257cc23f05c7
2020-03-17 23:35:44 +00:00
junyulai
544bc807a4 [SP25] Rename functions that add Entry conditionally
Currently, in NetworkStats, there are many methods to manipulate
the records. However, some methods are similar and ambiguous,
such as addEntry, addValues, setValues, addIfaceValues,
combineValues and combineAllValues.

Thus, properly grouping and renaming methods are necessary.
In this change, for methods that add one record conditionally,
name them addEntry.
  addValues -> addEntry

Test: atest FrameworksNetTests ImsPhoneCallTrackerTest TetheringTests
Fix: 148895143
Change-Id: I9495a198cf247e6c79100f7ac1edcea370b071de
2020-03-17 14:59:59 +00:00
junyulai
02a6340ca0 [SP24] Rename functions that add Entry unconditionally
Currently, in NetworkStats, there are many methods to manipulate
the records. However, some methods are similar and ambiguous,
such as addEntry, addValues, setValues, addIfaceValues,
combineValues and combineAllValues.

Thus, properly grouping and renaming methods are necessary.
In this change, for methods that add one record unconditionally,
name them insertEntry.
  setIfaceValues -> insertEntry
  addEntry -> insertEntry

Test: atest FrameworksNetTests ImsPhoneCallTrackerTest TetheringTests
Test: m doc-comment-check-docs
Bug: 148895143
Change-Id: I801ddc49e283a254b9586700c9b597c0adb0d459
Merged-In: I801ddc49e283a254b9586700c9b597c0adb0d459
(cherry picked from aosp/1256352)
2020-03-17 14:59:31 +00:00
junyulai
ca952de92d [SP23] Address misc API review comment about NetworkStats
This change add several javadoc for NetworkStats and its Entry
class. Also remove IFACE_ALL constant accordlingly.

Test: atest FrameworkNetTests
Test: m doc-comment-check-docs
Bug: 148895143

Change-Id: Id1b8f41be79f847ad73197ff0e18258b6ee8a730
Merged-In: Id1b8f41be79f847ad73197ff0e18258b6ee8a730
(cherry picked from aosp/1256351)
2020-03-17 14:58:59 +00:00
junyulai
27d58bfd96 [SP21] Address comments for API council review about aosp/1172143
Test: atest FrameworksNetTests ImsPhoneCallTrackerTest
Test: atest TetheringTests NetworkStackTests
Test: m doc-comment-check-docs
Fix: 148552904

Change-Id: I141393f229e772d2eb9f7c156849e379bd71b845
Merged-In: I141393f229e772d2eb9f7c156849e379bd71b845
(cherry picked from aosp/1253717)
2020-03-17 14:57:59 +00:00
Automerger Merge Worker
f62907d9ca [SP20] Check signature permission when accessing network stats provider
Currently, registerNetworkStatsProvider requires the
UPDATE_DEVICE_STATS permission. This is a privileged permission
so it can be granted to preinstalled apps. Thus, apps like
GmsCore, or preinstalled apps will be able to update network stats.

This change checks for a new permission that would only allow
signature apps to declare that. Also check
MAINLINE_NETWORK_STACK permission to allow NetworkStack process
to use it.

Test: adb shell dumpsys netstats
Test: atest FrameworksNetTests
Bug: 149652079

Change-Id: Iaecbf10a7610461bd52e315659006c7332c416e6
Merged-In: Iaecbf10a7610461bd52e315659006c7332c416e6
Merged-In: Idfebd0a1988c3dcfd812d87e30f6a2034d6fbf6b
(cherry picked from commit e9e8d8f9ff096c1723eba1d74b17bb7cade7f23b)
2020-03-17 14:53:33 +00:00
Automerger Merge Worker
79606cc385 [automerger skipped] Merge "Fix typo in aosp/1242602" into rvc-dev am: 984a51c6ee -s ours
am skip reason: Change-Id Ie023c8371785fc239c54eacbf056141c2e9e3444 with SHA-1 9d4e21f0be is in history

Change-Id: Ie4565f23be593f4ed5f398ffd320eb8897fd9736
2020-03-17 14:26:58 +00:00
Automerger Merge Worker
c884826573 [automerger skipped] Merge "Add permission check functions to NetworkStatsService" into rvc-dev am: 70731d4348 -s ours
am skip reason: Change-Id I837545b54f36c8f21c878cbb1fd028ff23be6cb8 with SHA-1 df2aef7c1d is in history

Change-Id: Ie92995d3a60e009aff0913f1e9c039972837fff5
2020-03-17 12:14:30 +00:00
junyulai
050c7de093 Fix typo in aosp/1242602
Test: m -j
Bug: 149652079
Change-Id: Ie023c8371785fc239c54eacbf056141c2e9e3444
Merged-In: Ie023c8371785fc239c54eacbf056141c2e9e3444
(cherry picked from aosp/1259461)
2020-03-17 12:08:59 +00:00
Automerger Merge Worker
e953a50e6b Add permission check functions to NetworkStatsService
This is shameless copied from ConnectivityService and plan to be
used in follow-up change. For long term perspective we should
have a permission util that contains those util in one place.

Test: m -j
Change-Id: If70e6e831c0386b604d0151cc0650f68457b6e5f
Merged-In: If70e6e831c0386b604d0151cc0650f68457b6e5f
Merged-In: I837545b54f36c8f21c878cbb1fd028ff23be6cb8
Bug: 149652079
(cherry picked from commit 4da7af7e7e4a0d3360cd41e98e4d6fa731d21515)
2020-03-17 09:33:11 +00:00
Automerger Merge Worker
940f7154cd Merge changes I801ddc49,Id1b8f41b am: 2395cf16b9 am: 14b1bb2401
Change-Id: Ib25ca9a843f19fb3791afbe23c065a0a7bb3b11f
2020-03-16 11:56:41 +00:00
Automerger Merge Worker
1c27e5a4cc Merge changes I801ddc49,Id1b8f41b am: 2395cf16b9 am: 14b1bb2401
Change-Id: Ibc0b7c74ce55198fc6804b5cf1ea414aad912a4f
2020-03-16 11:56:19 +00:00
Automerger Merge Worker
14b1bb2401 Merge changes I801ddc49,Id1b8f41b am: 2395cf16b9
Change-Id: I604bcfab22d7b26b84bf126d02d9be612fcb6d29
2020-03-16 11:41:19 +00:00
Treehugger Robot
2395cf16b9 Merge changes I801ddc49,Id1b8f41b
* changes:
  [SP24] Rename functions that add Entry unconditionally
  [SP23] Address misc API review comment about NetworkStats
2020-03-16 11:38:00 +00:00
Automerger Merge Worker
7730f7fe95 Merge "Fix typo in aosp/1242602" am: 1ae5516429 am: 934bb9fa9c
Change-Id: I3f1078dd2ea942860e43d5421fa44e438c9de21d
2020-03-16 08:52:50 +00:00
Automerger Merge Worker
e681bebdf8 Merge "Fix typo in aosp/1242602" am: 1ae5516429 am: 934bb9fa9c
Change-Id: Icd65f665812d14f23671be65d1d182d2a78ecf2f
2020-03-16 08:52:39 +00:00
Automerger Merge Worker
934bb9fa9c Merge "Fix typo in aosp/1242602" am: 1ae5516429
Change-Id: Ie617874be311e84e04d889f6c2069c77c25150b7
2020-03-16 08:36:03 +00:00
junyulai
9d4e21f0be Fix typo in aosp/1242602
Test: m -j
Bug: 149652079
Change-Id: Ie023c8371785fc239c54eacbf056141c2e9e3444
2020-03-16 15:00:24 +08:00
junyulai
e7c6c25653 [SP24] Rename functions that add Entry unconditionally
Currently, in NetworkStats, there are many methods to manipulate
the records. However, some methods are similar and ambiguous,
such as addEntry, addValues, setValues, addIfaceValues,
combineValues and combineAllValues.

Thus, properly grouping and renaming methods are necessary.
In this change, for methods that add one record unconditionally,
name them insertEntry.
  setIfaceValues -> insertEntry
  addEntry -> insertEntry

Test: atest FrameworksNetTests ImsPhoneCallTrackerTest TetheringTests
Test: m doc-comment-check-docs
Bug: 148895143
Change-Id: I801ddc49e283a254b9586700c9b597c0adb0d459
2020-03-16 14:27:45 +08:00
junyulai
c7e8100faa [SP23] Address misc API review comment about NetworkStats
This change add several javadoc for NetworkStats and its Entry
class. Also remove IFACE_ALL constant accordlingly.

Test: atest FrameworkNetTests
Test: m doc-comment-check-docs
Bug: 148895143
Change-Id: Id1b8f41be79f847ad73197ff0e18258b6ee8a730
2020-03-16 14:27:45 +08:00
Automerger Merge Worker
759f420024 [SP21] Address comments for API council review about aosp/1172143 am: 9a4eeaea2f am: 759155a3a3
Change-Id: I86cf3b57722f64c0989ce606fde71d6173f812bb
2020-03-16 03:14:01 +00:00
Automerger Merge Worker
610e81320d [SP21] Address comments for API council review about aosp/1172143 am: 9a4eeaea2f am: 759155a3a3
Change-Id: Ia5e64eb524a852539850f46df87a6b28d4910cbc
2020-03-16 03:13:45 +00:00
Automerger Merge Worker
759155a3a3 [SP21] Address comments for API council review about aosp/1172143 am: 9a4eeaea2f
Change-Id: I8634d6f6ed65ec6b10009a90b147881fe1fc4530
2020-03-16 03:03:51 +00:00
junyulai
9a4eeaea2f [SP21] Address comments for API council review about aosp/1172143
Test: atest FrameworksNetTests ImsPhoneCallTrackerTest
Test: atest TetheringTests NetworkStackTests
Test: m doc-comment-check-docs
Fix: 148552904

Change-Id: I141393f229e772d2eb9f7c156849e379bd71b845
2020-03-12 21:34:17 +08:00
Automerger Merge Worker
386e5150d4 Merge changes from topic "sp20-stats-provider-permission" am: 51bbefacf2 am: bf292288b6
Change-Id: Ifb7237d5cfaeed416ad1efb4f0c295fe846ab3b0
2020-03-12 09:00:33 +00:00
Automerger Merge Worker
3fd000536c Add permission check functions to NetworkStatsService am: df2aef7c1d am: ba550c1836
Change-Id: I6aa0be382bb273cc8cdf2308f737ad047463b870
2020-03-12 09:00:23 +00:00
Automerger Merge Worker
7de3ff8eda Merge changes from topic "sp20-stats-provider-permission" am: 51bbefacf2 am: bf292288b6
Change-Id: I765831bcb6059fa95cf59967becde4b9340cde39
2020-03-12 09:00:20 +00:00
Automerger Merge Worker
f43cef4969 Add permission check functions to NetworkStatsService am: df2aef7c1d am: ba550c1836
Change-Id: Ibd1d64edd72887961ee76a71df9c9b71c9727967
2020-03-12 09:00:17 +00:00
Automerger Merge Worker
bf292288b6 Merge changes from topic "sp20-stats-provider-permission" am: 51bbefacf2
Change-Id: I6111589d27501684b4c43711448a1fa08221a3f5
2020-03-12 08:39:54 +00:00
Automerger Merge Worker
ba550c1836 Add permission check functions to NetworkStatsService am: df2aef7c1d
Change-Id: Id2df1c6d5a5dc77f59f68772f5b46659fb956bc2
2020-03-12 08:39:48 +00:00
Junyu Lai
51bbefacf2 Merge changes from topic "sp20-stats-provider-permission"
* changes:
  [SP20] Check signature permission when accessing network stats provider
  Add permission check functions to NetworkStatsService
2020-03-12 08:19:24 +00:00
android-build-team Robot
ca4784ecb9 Snap for 6286840 from 6a781e90bda80da13816914cbdbfd686c860dd05 to rvc-release
Change-Id: I042a93be853413b2c0bd010aae493d8155f3dd97
2020-03-12 02:04:03 +00:00
Automerger Merge Worker
ccabfd0af6 [automerger skipped] Merge "Merge NetworkStatsService handler changes." into rvc-dev am: 48aff64f9b -s ours
am skip reason: Change-Id If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7 with SHA-1 1ff5f65f5b is in history

Change-Id: Ie58da93cd3a7876d8dc56bbcff90bcfd0a38c9d3
2020-03-11 06:36:38 +00:00
Lorenzo Colitti
48aff64f9b Merge "Merge NetworkStatsService handler changes." into rvc-dev 2020-03-11 06:19:18 +00:00
Benedict Wong
529e8aae25 Automatically set IPsec tunnel interface as up
This change makes IPsec tunnel interfaces automatically get brought up
once they are created. Originally this was considered to be an
additional safety check, as they would not be start routing traffic
until explicitly brought up. However, in the intervening time, the
NetworkManagementController now requires the NETWORK_STACK permission to
set an interface as up. Additionally, that call is a hidden API, and
thus not usable for use cases such as IWLAN.

Bug: 149348618
Test: FrameworksNetTests, CtsNetTestCases passing.
Change-Id: I55b63a748463a388e1e2991d2d5d6b3023545e60
2020-03-10 23:08:16 -07:00
Benedict Wong
7bcf9c28ac Relax IPsec resource count restrictions.
IPsec resource counts were selected to be conservative, due to unknowns
about device capabilities. Since then, it appears that we no longer need
such stringent quotas, and this can be relaxed.

Test: FrameworksNetTest passing
Change-Id: Id53d14e5698e5fcc410868424176b00350c7ae79
2020-03-10 23:08:13 -07:00
android-build-team Robot
c7e0dcbc87 Snap for 6282804 from 76182efa9fdc08d31a2f348932b6a2cfbc65fdbc to rvc-release
Change-Id: I3b38c8604044864ccc9958a3d769e12ad0689720
2020-03-11 02:04:28 +00:00
android-build-team Robot
7aadcb0394 Snap for 6279178 from 54df41a8815959772c8088e3a4da545edecbfd4e to rvc-release
Change-Id: I7a1f4f7a982cdba25cd9954cf4e2103bbcbe0621
2020-03-10 02:12:27 +00:00
Automerger Merge Worker
9a56a837de [automerger skipped] Merge "Add missing RequiresPermission to EthernetManager" into rvc-dev am: ad553fb634 -s ours
am skip reason: Change-Id I2af74cbcfa642f05f5e7bf85b2a8e8c38595f6ca with SHA-1 11f3924f18 is in history

Change-Id: Idaaaa1dbbad6e616a852253e1ace463385b3b24e
2020-03-10 02:00:40 +00:00
Automerger Merge Worker
3bc71e0d89 Add missing RequiresPermission to EthernetManager
The method requires NETWORK_STACK or MAINLINE_NETWORK_STACK permissions,
but the annotation was missing.

Test: m
Fixes: 150877670
Merged-In: I2af74cbcfa642f05f5e7bf85b2a8e8c38595f6ca
(cherry picked from commit e45d3ff849695977cb063cc59550c505b220bd6c)

Change-Id: Ia215b74df99ae60be2e380917be68a272d658ef4
2020-03-09 10:20:22 +00:00
Automerger Merge Worker
7400d9c846 Merge "Add missing RequiresPermission to EthernetManager" am: b3d7fe48ad am: 360c24f950
Change-Id: I82aa6c27748dab5835158f4a64c3d8efbc8e28b4
2020-03-09 08:24:38 +00:00
Automerger Merge Worker
ff5fdffdad Merge "Add missing RequiresPermission to EthernetManager" am: b3d7fe48ad am: 360c24f950
Change-Id: I03ba43bc3368241e260dbda25282af1fbef84260
2020-03-09 08:24:26 +00:00
Automerger Merge Worker
43759b76c3 [automerger skipped] Merge "Fix crash and duplicated ethernet tethering request" into rvc-dev am: 02ee003aa5 -s ours
am skip reason: Change-Id I7c5127e96d80d077735010d2e62c7227805ccb10 with SHA-1 c8e7d759be is in history

Change-Id: I8c338aedd21b50b412d600d165c1d0f63453d52a
2020-03-09 08:20:47 +00:00
Automerger Merge Worker
c0565de11f Merge NetworkStatsService handler changes.
=====
Remove the need of accessing handler in NSS unit test

Currently, to wait for handler becomes idle, specific message
is used and the test would wait for condition variable to be
open when the message is processed.

However, this is already done in the HandlerUtils. Thus,
there is no need to post such message manually in the handler.

Test: atest FrameworksNetTests
Bug: 150664039

Change-Id: Iab32b2dbab01634ca159dcb90fc9f929d1fed1a2
=====
Remove setHandler in NetworkStatsService

Currently, internal handler is set by setHandler after
constructing NSS object. This was introduced in ag/866187 to
access the handler in the unit test.

However, the design put NSS in a bad situation where all classes
that need handler or executor could not be final and need to be
dynamically allocated in order to get a valid handler.

Thus, since the usage of handler is removed in previous patch,
this change eliminate setHandler by initializing the handler in
the constructor.

Test: atest FrameworksNetTests
Bug: 150664039

Change-Id: I794a24d00b0ca9fdc78091e7b9ab7307e0f034b7
=====

Bug: 150664039
Change-Id: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
Merged-In: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
(cherry picked from commit 2a6439d7e2a3926e10a0b9a4dc730b1a022d8138)
2020-03-09 07:59:27 +00:00
Remi NGUYEN VAN
11f3924f18 Add missing RequiresPermission to EthernetManager
The method requires NETWORK_STACK or MAINLINE_NETWORK_STACK permissions,
but the annotation was missing.

Test: m
Fixes: 150877670
Change-Id: I2af74cbcfa642f05f5e7bf85b2a8e8c38595f6ca
2020-03-09 14:18:55 +09:00
Automerger Merge Worker
87aa2869fe Fix crash and duplicated ethernet tethering request
This change fix two things:
1. Handle ethernet callback in internal thread to avoid crash. IpServer
should be created from tethering thread, otherwise mIpNeighborMonitor of
IpServer would throw
   IllegalStateException("start() called from off-thread")
2. Ethernet tethering request may be duplicated if multiple
startTethering is called but no stopTethering

Bug: 130840861
Bug: 148824036
Test: ON/OFF ethernet tehtering manually
      atest TetheringTests

Change-Id: Ibd3ea6bc6751bd65647ff381f9b0124bc3395c09
Merged-In: I7c5127e96d80d077735010d2e62c7227805ccb10
Merged-In: Ibd3ea6bc6751bd65647ff381f9b0124bc3395c09
(cherry picked from commit 72702b979654234c18045f04270040056a74cf90)
2020-03-09 02:02:23 +00:00
Automerger Merge Worker
8297518d54 Merge "Merge stage-aosp-master to aosp-master - DO NOT MERGE" am: d11ef42169 am: f01b99332b
Change-Id: I3bc4f4e9dbe6e735c154338ab641b56e7c6ad027
2020-03-06 00:27:49 +00:00
Automerger Merge Worker
93e1e0c625 [automerger skipped] Merge "Merge stage-aosp-master to aosp-master - DO NOT MERGE" am: d11ef42169 am: f01b99332b -s ours
am skip reason: subject contains skip directive

Change-Id: I25e889bad69a7a3bfd819e7a75a69a16f29b92da
2020-03-06 00:26:36 +00:00
Bill Yi
d11ef42169 Merge "Merge stage-aosp-master to aosp-master - DO NOT MERGE" 2020-03-05 18:27:30 +00:00
Automerger Merge Worker
1ff5f65f5b Merge changes I794a24d0,Iab32b2db am: f46d3aa4bb am: ae7c0fddb7
Change-Id: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
2020-03-04 13:36:11 +00:00