Commit Graph

10988 Commits

Author SHA1 Message Date
Lucas Lin
1102259c8a Merge "Separate 2 tests to verify canBeSatisfiedBy()" am: 59c5a7ee61 am: 2fd5ddbffd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1495268

Change-Id: If94d24c57b5f982180b04bad236c524183e4c5af
2020-11-17 11:56:30 +00:00
Automerger Merge Worker
95fd9d13c5 Merge "Merge "Fix the comments left on aosp/1481197" am: 51a4f05ef8 am: ba157d8b07" into rvc-d1-dev-plus-aosp 2020-11-17 11:56:14 +00:00
Lucas Lin
34bf1ff904 Merge "Fix the comments left on aosp/1481197" am: 51a4f05ef8 am: ba157d8b07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494036

Change-Id: I6fca5804b1b70803cf0e3666da2870c299f089e5
2020-11-17 11:54:58 +00:00
Lucas Lin
2fd5ddbffd Merge "Separate 2 tests to verify canBeSatisfiedBy()" am: 59c5a7ee61
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1495268

Change-Id: I8b2d43d11570f90b1bfa23c27fccb592269b16c9
2020-11-17 09:22:34 +00:00
Lucas Lin
59c5a7ee61 Merge "Separate 2 tests to verify canBeSatisfiedBy()" 2020-11-17 08:38:07 +00:00
Lucas Lin
bae14aa611 Merge "Fix the comments left on aosp/1481197" am: 51a4f05ef8 am: ba157d8b07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494036

Change-Id: Iea77eb0ed2ca0b5603d1257496bd1e8a14ed0d77
2020-11-17 08:11:57 +00:00
Lucas Lin
ba157d8b07 Merge "Fix the comments left on aosp/1481197" am: 51a4f05ef8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494036

Change-Id: I7f13f380db5fe30e67be9cedc9429519b9fd4b6e
2020-11-17 07:47:54 +00:00
Lucas Lin
51a4f05ef8 Merge "Fix the comments left on aosp/1481197" 2020-11-17 07:06:46 +00:00
Junyu Lai
99b7bcd09c Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 38ec07ff9e am: 63fbab6e6a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: I11a56ed8d67f321a66fecc7550383db7d9f9c897
2020-11-12 09:35:38 +00:00
Junyu Lai
63fbab6e6a Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 38ec07ff9e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: I5545dddcb5c8499ac9c53325cbafd424124429e1
2020-11-12 09:02:13 +00:00
Junyu Lai
38ec07ff9e Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5
* changes:
  Remove unused variables
  Return offloaded traffic when querying from TrafficStats API
  Add hardware tethering traffic in testTethering test
  Remove unused getTetherStats
2020-11-12 08:45:15 +00:00
junyulai
2fae9c3667 Add hardware tethering traffic in testTethering test
Test: atest com.android.server.net.NetworkStatsServiceTest#testTethering
Bug: 162292214
Change-Id: Ifec6bde5fd3231f2135f12536c42e42ec6b707de
2020-11-12 14:22:31 +08:00
lucaslin
43e1a7971e Separate 2 tests to verify canBeSatisfiedBy()
In Android R, NetworkSpecifier#satisfiedBy() has changed to
NetworkSpecifier#canBeSatisfiedBy(), but its subclass -
MatchAllNetworkSpecifier hasn't.
In Android S, both of MatchAllNetworkSpecifier and
NetworkSpecifier has changed satisfiedBy() to canBeSatisfiedBy().
So if running the latest CTS on R device, it will verify
NetworkSpecifier#canBeSatisfiedBy() instead of
MatchAllNetworkSpecifier#satisfiedBy() and get the unexpected
result.
The fix is to separate 2 tests to verify canBeSatisfiedBy(), one
is for Android R or older version and the other is for Android
S+.

Bug: 172401624
Test: Run MatchAllNetworkSpecifierTest on Android R and S.
Change-Id: I1391bae9a0fc0298beb8fe80b5f388b492244566
2020-11-12 12:48:16 +08:00
Chiachang Wang
e7ef9769d1 Merge "Replace the way to add legacy routing" am: e94bf1bc3c am: 1b1c460be6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490244

Change-Id: I363c642663877d7ac521f8e9d5729040deca7f9a
2020-11-11 05:57:28 +00:00
Chiachang Wang
1b1c460be6 Merge "Replace the way to add legacy routing" am: e94bf1bc3c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490244

Change-Id: I6a278e3ae1ac4f5eaba92d28edf4a53d5381832e
2020-11-11 05:23:20 +00:00
Chiachang Wang
e94bf1bc3c Merge "Replace the way to add legacy routing" 2020-11-11 05:06:58 +00:00
James Mattis
25dfe8eb37 Merge "Updating network preference comments" am: 5aff64e718 am: c22a6a5cd0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490233

Change-Id: I6e73148769cc20edc1fa26ebd211472d46877ed0
2020-11-10 19:13:56 +00:00
James Mattis
c22a6a5cd0 Merge "Updating network preference comments" am: 5aff64e718
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490233

Change-Id: I99561b2d7673c5f5f45ac793c453b4f10bd663e1
2020-11-10 18:35:28 +00:00
James Mattis
5aff64e718 Merge "Updating network preference comments" 2020-11-10 17:30:36 +00:00
lucaslin
684a06de6d Fix the comments left on aosp/1481197
Bug: 172040168
Test: atest FrameworksNetTests
Test: Manual test NO_INTERNET, SIGN_IN, PARTIAL_CONNECTIVITY,
      VPN_ALWAYS_ON notifications.
Change-Id: Ibd05366481e6ddadf8b323335c2c35d40d340d0d
2020-11-10 14:54:52 +08:00
Chiachang Wang
fd3fa0a549 Replace the way to add legacy routing
ConnectivityService is going to become a mainline module which
is not able to access hidden API. Thus, replace the usage from
NMS to INetd.

Bug: 170598012
Test: atest FrameworksNetTests ConnectivityManagerLegacyTest
Change-Id: Ice1bd1effab26555917bc1766354aeaebd41ad66
2020-11-10 14:53:55 +08:00
Lucas Lin
b2b8dc920d Merge changes I67e5fa23,I223b207c am: 3ae04504d6 am: 3d4fd4e946
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1483969

Change-Id: Idc58f24797aa1e3d24058a024b1ea31199f46353
2020-11-10 06:09:03 +00:00
Lucas Lin
3d4fd4e946 Merge changes I67e5fa23,I223b207c am: 3ae04504d6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1483969

Change-Id: I74209eccb2fd5473d65968f765f3eb54ee99954e
2020-11-10 05:47:18 +00:00
Lucas Lin
3ae04504d6 Merge changes I67e5fa23,I223b207c
* changes:
  Use hasIpv[4|6]DefaultRoute instead of hasIPv[4|6]DefaultRoute
  Use local defined constants for notification channels
2020-11-10 05:28:33 +00:00
James Mattis
dce028e5b5 Updating network preference comments
Updating comments for network preferences to better clarify that
preferences which include more than one network type will then rely on
scoring to determine which of those networks are chosen.

Bug: 171795464
Test: atest FrameworksNetTests
Change-Id: I9eb5683f2cd69281bbee9fb70028d45f07720914
2020-11-09 21:06:09 -08:00
Mathew Inwood
a6e533d62a Merge "Add maxTargetSdk restriction to unused APIs." am: d04f969c9d am: 96d3ff7659
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1468245

Change-Id: I60222cb1879651cf283e385519b5c4d156ab68a1
2020-11-09 15:24:20 +00:00
Mathew Inwood
96d3ff7659 Merge "Add maxTargetSdk restriction to unused APIs." am: d04f969c9d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1468245

Change-Id: I35f65987f7f9287cf03418e9feb27c81f4fd1878
2020-11-09 15:09:11 +00:00
Mathew Inwood
d04f969c9d Merge "Add maxTargetSdk restriction to unused APIs." 2020-11-09 14:41:20 +00:00
James Mattis
decb412854 Merge "Adding API stubs for application network routing" am: 20a9e59e25 am: d8cf074a43
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1478963

Change-Id: I7001e39dc59a509f10d7851cd9688b7b98ce0b95
2020-11-06 19:05:22 +00:00
James Mattis
d8cf074a43 Merge "Adding API stubs for application network routing" am: 20a9e59e25
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1478963

Change-Id: I293192102c800a9dd8f09c32f890728e802cc965
2020-11-06 17:32:56 +00:00
junyulai
10b443adbb Remove unused getTetherStats
Before Android R, getTetherStats were used to collect tethering
iface stats of all clients who extends ITetheringStatsProvider,
which typically contains NetdTetheringStatsProvider and
OffloadController.

However, this always returns 0 since Android R, because:
  1. OffloadController implemented NetworkStatsProvider and no
     longer reports stats through getTetherStats.
  2. NetdTetheringStatsProvider always return 0 by design since
     non-offloaded iface tethering stats are already included
     in native iface stats.

This change is a no-op refactoring to remove unused
getTetherStats and update test which is not pratical.
Fix for offloaded tethering stats will be in follow-up CLs.

Test: atest FrameworksNetTests TetheringTests
Bug: 162292214
Change-Id: Icd0717c5c2807ae3bd98626b897e4b148f142815
2020-11-06 19:02:44 +08:00
James Mattis
dcea9fb2d4 Adding API stubs for application network routing
Bug: 171795464
Test: atest FrameworksNetTests
Change-Id: Ib055aa37a7bf0c48c335307afc2258aa869c4267
2020-11-06 00:08:13 -08:00
James Mattis
bd74d7c875 Merge "Adding multilayered requests to NetworkRequestInfo" am: f2c37de2ba am: a5bd693f29
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1486199

Change-Id: I3d013dc1a3caf9c41fbc835f2eb92df4e40bed33
2020-11-06 05:47:26 +00:00
James Mattis
a5bd693f29 Merge "Adding multilayered requests to NetworkRequestInfo" am: f2c37de2ba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1486199

Change-Id: I57d85884e4bf6039cf645ed58e2c7b0c8fd404a2
2020-11-06 05:19:47 +00:00
James Mattis
7835f74bac Adding multilayered requests to NetworkRequestInfo
Updating NetworkRequestInfo for "multilayered requests" functionality so that
requests can support a network hierarchy. I.e., requests network
with capability A first and if not available, request network with
capability B. This CL is the first step in adding that support by
updating the request object from a single request to a collection.

Bug: 171991028
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: I64a124802986e4cf4aa7de158c6690fdf9851cb2
2020-11-05 13:55:50 -08:00
Paul Hu
fe50f2ab24 Merge "Replace Context @hide APIs" am: f021a81854 am: 8fabfb25c3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1458063

Change-Id: Iea56458847be39665e7660f048eec88147be27c3
2020-11-05 09:14:59 +00:00
Paul Hu
35e3902531 Merge "Replace AppOpsManager @hide APIs" am: 12e9b2ecb5 am: 0631c7bc98
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1469126

Change-Id: I9548c666d528e025b71f5d3b12b0c5ff2265eb23
2020-11-05 09:14:46 +00:00
Paul Hu
8fabfb25c3 Merge "Replace Context @hide APIs" am: f021a81854
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1458063

Change-Id: I914ee12abdcba7c53fb868425592d6458a797e23
2020-11-05 08:53:01 +00:00
Paul Hu
0631c7bc98 Merge "Replace AppOpsManager @hide APIs" am: 12e9b2ecb5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1469126

Change-Id: I6222db7e8f966d7df17de9c46b5e26e715ecccf2
2020-11-05 08:45:52 +00:00
Paul Hu
f021a81854 Merge "Replace Context @hide APIs" 2020-11-05 08:05:09 +00:00
Paul Hu
12e9b2ecb5 Merge "Replace AppOpsManager @hide APIs" 2020-11-05 08:03:55 +00:00
James Mattis
57675a19e0 Merge "Adding @IgnoreUpTo for testOemPrivate" am: df86206d82 am: b15efe2545
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1487452

Change-Id: Ic5b96ccbba713327c70a62ba584129ab20f35db6
2020-11-05 05:49:10 +00:00
James Mattis
b15efe2545 Merge "Adding @IgnoreUpTo for testOemPrivate" am: df86206d82
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1487452

Change-Id: I92bd7437dede4ae4a4bb27dfbf68a5ae74553811
2020-11-05 05:24:33 +00:00
James Mattis
082528f4b6 Adding @IgnoreUpTo for testOemPrivate
Adding @IgnoreUpTo for NetworkCapabilitiesTest.testOemPrivate so that
this test can run on previous releases.

Bug: 172400600
Bug: 171505922
Test: atest CtsNetTestCasesLatestSdk:NetworkCapabilitiesTest
Change-Id: Ibc728c986ad6faeed78c631ca2675956b95c6ac1
2020-11-04 16:52:11 -08:00
Eran Messeri
262771be94 DO NOT MERGE: Introduce DPMS shim for active DO/PO check am: 5c91bdecce am: 84ca530ba7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1486196

Change-Id: I467120ce7e419a75749efac109609bb30cc35eff
2020-11-04 12:46:45 +00:00
Eran Messeri
84ca530ba7 DO NOT MERGE: Introduce DPMS shim for active DO/PO check am: 5c91bdecce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1486196

Change-Id: I79e090d92c5bf17993f8e4f710581675eb72f2a9
2020-11-04 12:24:40 +00:00
Eran Messeri
5c91bdecce DO NOT MERGE: Introduce DPMS shim for active DO/PO check
Introduce a shim into DevicePolicyManagerInternal &
DevicePolicyManagerService so that NetworkStatsAccessTest would not
diverge from internal development branches.

The DevicePolicyManagerService refactoring on the internal branch
removed isActiveAdminWithPolicy in favour of isActiveDeviceOwner and
isActiveProfileOwner.

These methods are being made available in AOSP for
NetworkStatsAccessTest.

Bug: 170459325
Test: atest NetworkStatsAccessTest
Change-Id: Ic7e0898989fb8222aaba2b35436765c04eb3250c
2020-11-04 10:07:06 +00:00
Mathew Inwood
5a09a71012 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
lucaslin
62bc2b0f24 Use hasIpv[4|6]DefaultRoute instead of hasIPv[4|6]DefaultRoute
ConnectivityService is going to be a mainline module, it can only
use formal APIs or @SystemApi. So use @SystemApi
hasIpv4DefaultRoute and hasIpv6DefaultRoute instead of
hasIPv4DefaultRoute and hasIPv6DefaultRoute.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: I67e5fa234fbb6d0b9739ae3295eb0b0ea108f582
2020-11-04 01:29:53 +00:00
paulhu
fa229ae8a5 Replace Context @hide APIs
Connectivity service module is using some Context @hide APIs but
they are not able to call after CS becomes a mainline module.
Thus, replace them with similar System APIs.

Bug: 170593746
Test: atest FrameworksNetTests
Test: Manully check that receiving intent and starting activity
      can work normally.
Change-Id: I0f5b53ce0da4e3fc0f927896e9a9e444048401bd
2020-11-04 00:02:42 +08:00