Commit Graph

8676 Commits

Author SHA1 Message Date
TreeHugger Robot
56ff9e7969 Merge "Move NetworkCallback to last parameter for new exposed requestNetwork" into rvc-dev am: b6c84e985d
Change-Id: Iec20a7faa193e881193dbb5617f112f9dda5a8d8
2020-03-19 13:52:03 +00:00
TreeHugger Robot
b6c84e985d Merge "Move NetworkCallback to last parameter for new exposed requestNetwork" into rvc-dev 2020-03-19 13:40:51 +00:00
Mark Chien
d68910e42b Merge "TetheringManager API clean up" into rvc-dev am: 3da1e71044
Change-Id: I57808f2f1fd904e81f8c8f9c2c7254255f335acd
2020-03-19 12:07:10 +00:00
Mark Chien
3da1e71044 Merge "TetheringManager API clean up" into rvc-dev 2020-03-19 12:04:05 +00:00
markchien
0fe1140651 Move NetworkCallback to last parameter for new exposed requestNetwork
Bug: 151243698
Test: atest TetheringTests
Change-Id: I87ef1d451eefa6998b9793c4eacabae978376d24
2020-03-19 19:10:23 +08:00
Paul Hu
2800cd6ce8 Merge "Kill ConnectivityManager.CONNECTIVITY_ACTION_SUPL" into rvc-dev am: b1b08a0d45
Change-Id: Ia167028fdfe4e8ce8ea2a32d486fa7ba92f74198
2020-03-19 10:21:21 +00:00
markchien
68b6784942 TetheringManager API clean up
Per API review:
- @IntDef defined on the type integer parameter
- have getters on each parameter that is set in the
  TetheringRequest.Builder
- new added API should not be deprecated
Below APIs is moved from system-current to module-lib-current that only
plafrom code(e.g. ConnectivityManager and Settings) can use them.
TetheringRequest.
onTetherableInterfaceRegexpsChanged, TetheringInterfaceRegexps:
Only platform code can use them because interfaces by regular
expressions are a mechanism which is planning to be deprecated.

Also rename some constants for easier to understand.

Bug: 149858697
Bug: 151243337
Test: m doc-comment-check-docs
      atest TetheringTests
Change-Id: Idd041f0fbeca411ea23e49786a50dd7feb77ef45
2020-03-19 16:32:37 +08:00
Automerger Merge Worker
b5255d439e Kill ConnectivityManager.CONNECTIVITY_ACTION_SUPL
CONNECTIVITY_ACTION_SUPL is marked as a "temporary hack" and has
never been public. Remove this intent definition since no one is
receiving this intent and should use network callback to know the
connection change.

Bug: 109636544
Test: atest FrameworksNetTests
Change-Id: Ie9e5127742beba04f1c191e894e8a29fe1e704bb
Merged-In: Ie9e5127742beba04f1c191e894e8a29fe1e704bb
(cherry picked from aosp/1224697)
2020-03-19 06:53:04 +00:00
Junyu Lai
b423f917cf Merge changes I7eaca623,Ic94da540,If330e853,Ie2d229be,Ic6b2f10f into rvc-dev am: 7d06b09387
Change-Id: If7ab6d44f5289726fd90d26229807e989e7ab50a
2020-03-19 06:37:17 +00:00
junyulai
0ca4644389 [SM07] Make combine subtype configurable from Settings am: 8c526ea1bf
Change-Id: I7d4c29f713b56201c1407d51087a74043816f60f
2020-03-19 06:37:13 +00:00
junyulai
7ad17a73ab [SM05] Enable record mobile network stats by collapsed rat type am: 6d3c4ef6ee
Change-Id: I17067d7a3b2760afd7a164bc0735a858e3a91491
2020-03-19 06:37:10 +00:00
Junyu Lai
7d06b09387 Merge changes I7eaca623,Ic94da540,If330e853,Ie2d229be,Ic6b2f10f into rvc-dev
* changes:
  [SM08] Add NetworkTemplate unit test for fetching mobile data usage
  [SM07] Make combine subtype configurable from Settings
  [SM05] Enable record mobile network stats by collapsed rat type
  [SM04] Support fetching data with NetworkTemplate with subType
  [SM02] Support record mobile network stats by collapsed rat type
2020-03-19 06:29:38 +00:00
Lucas Lin
1417277140 Merge "Add version check to prevent test fail on Android Q" into rvc-dev am: f425a3103a
Change-Id: I817fdcddbcd48eb39771c23bce815328dd24ff02
2020-03-19 03:17:10 +00:00
Lucas Lin
f425a3103a Merge "Add version check to prevent test fail on Android Q" into rvc-dev 2020-03-19 03:09:46 +00:00
junyulai
e36b07b902 [SM08] Add NetworkTemplate unit test for fetching mobile data usage
Test: atest NetworkTemplateTest
Bug: 129082217

Change-Id: I7eaca623adf93f9b8d53c2e5857ecae90ea572ab
Merged-In: I7eaca623adf93f9b8d53c2e5857ecae90ea572ab
(cherry picked from commit 4670baace6c8dafe3a30330596c333d6b2389e4d)
2020-03-19 01:41:53 +00:00
junyulai
8c526ea1bf [SM07] Make combine subtype configurable from Settings
Note that enabling/disabling would not take effect until device
reboot. This will be addressed in follow-up patch.

Test: 1. atest NetworkStatsServieTest SettingsBackupTest
      2. adb shell settings put global netstats_combine_subtype_enabled 1|0
Bug: 146415925

Change-Id: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
Merged-In: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
(cherry picked from commit c4f77ac90bf2e48a655ad19b162fe74a23bf3fb0)
2020-03-19 01:40:55 +00:00
Remi NGUYEN VAN
c4392a1ba7 Merge "Move sensitive field parceling bool to constructor" into rvc-dev am: 9718cbefcf
Change-Id: I3e6e80e1405bcdaed8559be3442f5e7e8b7e3cfc
2020-03-19 01:37:36 +00:00
Remi NGUYEN VAN
dc383d0ad1 [automerger skipped] Merge "Make LinkPropertiesTest backwards compatible" into rvc-dev am: 7b1c3b760f -s ours
am skip reason: Change-Id I570efa4eb483a717d4204a18473d02653a69f46d with SHA-1 c36e187f84 is in history

Change-Id: Ibb4280d617c0daadb881b2605dad180b26236524
2020-03-19 01:37:11 +00:00
Automerger Merge Worker
5cf82b902a Move sensitive field parceling bool to constructor am: d93492e689
Change-Id: I0558b0614948945ddc4c4ded591b70657b1bdd78
2020-03-19 01:37:01 +00:00
Remi NGUYEN VAN
9718cbefcf Merge "Move sensitive field parceling bool to constructor" into rvc-dev 2020-03-19 01:32:48 +00:00
Remi NGUYEN VAN
7b1c3b760f Merge "Make LinkPropertiesTest backwards compatible" into rvc-dev 2020-03-19 01:32:17 +00:00
Remi NGUYEN VAN
d302c8753f Merge changes from topic "netstack_api_review" into rvc-dev am: 799e84ed01
Change-Id: Ieade72c400b11413fec2c6c7f2b3041b194efc19
2020-03-19 01:30:51 +00:00
Remi NGUYEN VAN
799e84ed01 Merge changes from topic "netstack_api_review" into rvc-dev
* changes:
  Remove usage of Context.NETWORK_STACK_SERVICE
  Remove NETWORK_STACK_SERVICE constant
2020-03-19 01:21:29 +00:00
Lorenzo Colitti
31e7822242 Merge "mtu: Add MTU parameter to Routes" into rvc-dev am: 27247d1f5d
Change-Id: I44b5596edff055567b5f322b0a90c2ddb1c68094
2020-03-19 00:58:33 +00:00
Lorenzo Colitti
27247d1f5d Merge "mtu: Add MTU parameter to Routes" into rvc-dev 2020-03-19 00:50:57 +00:00
Cody Kesting
bb1c456796 Merge "Change NetworkCapabilities administrator UIDs to be stored as int[]." into rvc-dev am: cb9847691f
Change-Id: Idda185ca62848f66bd1a08455db9e0df7fe964d5
2020-03-18 19:44:00 +00:00
Cody Kesting
cb9847691f Merge "Change NetworkCapabilities administrator UIDs to be stored as int[]." into rvc-dev 2020-03-18 19:40:39 +00:00
Cody Kesting
1043927267 Change NetworkCapabilities administrator UIDs to be stored as int[].
NetworkCapabilities#mAdministratorUids is used to track the UIDs that
are administrators of the given Network. This value was previously
stored as List<Integer>. However, general Android API Council guidelines
recommend using Arrays for primitive values. In order to be consistent
with the guidelines, updating the field to use an Array.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: I2652a5b0f276b8944454af5cb4b1383a3e054cfa
2020-03-18 17:40:24 +00:00
TreeHugger Robot
cbd17dab27 Merge "Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister" into rvc-dev am: 1d204ac218
Change-Id: I8b43f896064dddb84986b5a8d6edad1116028a5b
2020-03-18 12:08:46 +00:00
TreeHugger Robot
1d204ac218 Merge "Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister" into rvc-dev 2020-03-18 11:49:09 +00:00
Lorenzo Colitti
7d505a6436 mtu: Add MTU parameter to Routes
- Change route to update existing route
- MTU parameter added to AddRoute

Bug: 142892223
Test: unit test
Change-Id: I2164808ef628eb7c12e875f0bde7f5151bf6a5b5
Merged-In: Ie339d0cee5be12c2232a4631fed61219a0facc64
(cherry picked from commit e521f07e8b03102f1b510a3fb401993513d9c127)
2020-03-18 11:18:37 +00:00
Chiachang Wang
ac1cb7ea7d Merge changes I97015365,Ic9db4b9b into rvc-dev am: 13097923fa
Change-Id: Iadb42d352270a053e3fb5682c65ec9feb3d1b4b0
2020-03-18 10:31:22 +00:00
Chiachang Wang
50a55f9440 Add KeepalivePacketDataTest am: 62de8657e2
Change-Id: I1bff4ae03f4b56376d28514dc232b528dca99603
2020-03-18 10:31:18 +00:00
Chiachang Wang
13097923fa Merge changes I97015365,Ic9db4b9b into rvc-dev
* changes:
  Add NattKeepalivePacketDataTest
  Add KeepalivePacketDataTest
2020-03-18 10:15:15 +00:00
Junyu Lai
6d4e01e422 Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister
Test: atest ConnectivityServiceTest#testNetworkFactoryUnregister \
      --geneate-new-metrics 100
Bug: 151792032

Change-Id: I1ee7a26186885d3a79a32ec9e45f5bcd656a6680
Merged-In: I1ee7a26186885d3a79a32ec9e45f5bcd656a6680
Merged-In: Iece9e8ad5c51170cd404ac995d0005392d37fe0c
(cherry picked from commit 31c26cdbeb35a6fd6a53a1c25cce6d36b825bf41)
2020-03-18 10:09:44 +00:00
Remi NGUYEN VAN
ccea0bb385 Remove usage of Context.NETWORK_STACK_SERVICE
The NetworkStack.getService() API should be used instead.

Bug: 151243982
Test: atest FrameworksNetTests TetheringTests
      Manual tethering test
Change-Id: I7855090bffbe895c8349ad4903b8f2eb55515f0b
2020-03-18 18:31:39 +09:00
Lucas Lin
fbec7b571f Add version check to prevent test fail on Android Q
Include androidx.core_core for androidx.core.os.BuildCompat.

Bug: 151293251
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest

Change-Id: I8356aed1bdf2646671d045e10c9d0c8115c10ca5
Merged-In: I73ef7eececec757a6e9683b231bf73fcd8d49f8d
2020-03-18 09:31:26 +00:00
Automerger Merge Worker
d93492e689 Move sensitive field parceling bool to constructor
This addresses API review comments recommending to use a copy
constructor with additional parameters instead of a dedicated method.
makeSensitiveFieldsParcelingCopy becomes LinkProperties(base, true).

Bug: 150877475
Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests
Merged-In: Ib145ca7f36dcbee6ef47d09862a181fc04a28f03
(cherry picked from commit bf091021d332804e875d7fd3424340e32b896cce)

Change-Id: I98449430ca5b11f5a62ba43683663bd82650e817
2020-03-18 09:00:34 +00:00
Automerger Merge Worker
c36e187f84 Make LinkPropertiesTest backwards compatible
LinkPropertiesTest must be backwards compatible with Q for CTS.

In Q 4 fields were added: DhcpServerAddress, WakeOnLanSupported,
CaptivePortalApiUrl, CaptivePortalData. The new test only tests these
fields on R and above.
testLinkPropertiesParcelable_Q still verifies that there are 14 fields
on Q, so the 4 extra fields can be ignored.

The changes use androidx.core.os.BuildCompat.isAtLeastR(), so
androidx.core_core is added as a dependency to FrameworksNetCommonTests.

Test: atest CtsNetTestCasesLatestSdk:android.net.LinkPropertiesTest
        on Q and R devices
Bug: 150918852
Change-Id: I570efa4eb483a717d4204a18473d02653a69f46d
Merged-In: I570efa4eb483a717d4204a18473d02653a69f46d
(cherry picked from commit b4c981c7c683564dde0693fa05bd02618f7dcba3)
2020-03-18 08:56:51 +00:00
junyulai
6d3c4ef6ee [SM05] Enable record mobile network stats by collapsed rat type
Switch on the recording in device side. Metrics will be
collected in follow-up patches which can be independently
enabled/disabled.

This change also fix the fail in NetworkStatsCollectionTest
which caused by enabling this feature, where the rounding
problem happened when records are distributed into smaller
buckets and categorized into more NetworkIdentity.

Test: atest FrameworksNetTests
Bug: 129082217
Change-Id: If330e85330a4ff713dd420c98d42fa741eabd90a
Merged-In: If330e85330a4ff713dd420c98d42fa741eabd90a
(cherry picked from commit 2d4fa2c0fae8c2d79a25093d9f732a33c2f91dd4)
2020-03-18 08:08:01 +00:00
Chiachang Wang
30a0107d13 Add NattKeepalivePacketDataTest
Add test for constructor and parcel

Test: atest CtsNetTestCasesLatestSdk:android.net.NattKeepalivePacketDataTest
      on both Q and R devices
Bug: 151402211
Change-Id: I97015365604be1846e3ecbaf60ac99e334705565
Merged-In: I97015365604be1846e3ecbaf60ac99e334705565
2020-03-18 05:44:26 +00:00
Chiachang Wang
62de8657e2 Add KeepalivePacketDataTest
Add test for constructor of KeepalivePacketData and
InvalidPacketException

Bug: 151109466
Test: atest CtsNetTestCasesLatestSdk:android.net.KeepalivePacketDataTest
      on both Q and R devices
Change-Id: Ic9db4b9b83ff96c87f41c5f381763c3ee8dd27c8
Merged-In: Ic9db4b9b83ff96c87f41c5f381763c3ee8dd27c8
2020-03-18 05:43:42 +00:00
Junyu Lai
53bdd05439 Merge changes from topics "am-ad04c8ad832c4674be35bfc5fe4280dd-rvc-dev", "sp21-api-review-feedback", "sp25-networkstats-rename" into rvc-dev am: 3e09da5d5d
Change-Id: I8b2ee860681bc161e0256ad4273cefbe316df4d1
2020-03-17 23:37:11 +00:00
junyulai
69e146bbc5 [SP25] Rename functions that add Entry conditionally am: 5d89df732b
Change-Id: Ie34fa0421b619af8479ca254bc6a895792a993d0
2020-03-17 23:35:53 +00:00
junyulai
bf8e5cf064 [SP24] Rename functions that add Entry unconditionally am: 9f288e6990
Change-Id: I983a448c1556b86fdf79c4989b2b0c579730837b
2020-03-17 23:35:50 +00:00
junyulai
43ff860cf2 [SP21] Address comments for API council review about aosp/1172143 am: 2cb4c9359a
Change-Id: I77a249ad66acf360ec1b0acfe14f9db704040c11
2020-03-17 23:35:40 +00:00
Junyu Lai
3e09da5d5d Merge changes from topics "am-ad04c8ad832c4674be35bfc5fe4280dd-rvc-dev", "sp21-api-review-feedback", "sp25-networkstats-rename" into rvc-dev
* changes:
  [SP25] Rename functions that add Entry conditionally
  [SP24] Rename functions that add Entry unconditionally
  [SP23] Address misc API review comment about NetworkStats
  [SP21] Address comments for API council review about aosp/1172143
  [SP20] Check signature permission when accessing network stats provider
2020-03-17 23:11:34 +00:00
Automerger Merge Worker
cbc2ca4681 Merge "Add support for registering test networks with administrators." into rvc-dev am: d95e6de42f
Change-Id: Id6e807272dca79a2e02974a7e6985eb6e7515326
2020-03-17 15:49:07 +00:00
Automerger Merge Worker
579c2bd4af Merge "Protect ConnectivityService from SecurityException in permission check." into rvc-dev am: 6e0d458d63
Change-Id: I5b44ff9afedcf40d82ba0c4666b2b16e72583383
2020-03-17 15:48:48 +00:00
Automerger Merge Worker
5bc1ba2198 Merge "Update ConnectivityDiagnosticsCallback function name." into rvc-dev am: b0dc78e311
Change-Id: I8c016464f6ba4b3237332bb2148183cb5d755ec4
2020-03-17 15:48:20 +00:00