Commit Graph

8494 Commits

Author SHA1 Message Date
markchien
fac84a2be1 Move NetworkCallback to last parameter for new exposed requestNetwork
Bug: 151243698
Test: atest TetheringTests
Change-Id: I87ef1d451eefa6998b9793c4eacabae978376d24
Merged-In: I87ef1d451eefa6998b9793c4eacabae978376d24
2020-03-19 11:36:07 +00:00
markchien
f47d83448c 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: I45cb21d5bc919f6d32c42650326597d5173ea028
Merged-In: Idd041f0fbeca411ea23e49786a50dd7feb77ef45
2020-03-19 19:32:50 +08:00
Lorenzo Colitti
5b7eccf20d Merge "Make Ethernet interfaces more testable." am: cabe5e5615
Change-Id: I456acb05d548b3d0281e500cfd91d888441d7f94
2020-03-19 11:30:33 +00:00
Lorenzo Colitti
cabe5e5615 Merge "Make Ethernet interfaces more testable." 2020-03-19 11:12:09 +00:00
Junyu Lai
16b41c3ee1 Merge changes I7eaca623,Ic94da540,If330e853,Ie2d229be,Ic6b2f10f am: b3c511d028 am: 4a0f9fa336
Change-Id: If5e59645f5f5754b40da5a3cb945d34a14605062
2020-03-19 09:40:56 +00:00
junyulai
01223950a5 [SM07] Make combine subtype configurable from Settings am: 678befa63c am: 5d348ec90f
Change-Id: I65470e2ce4aae26308a395ce1e5465ac27914f60
2020-03-19 09:40:53 +00:00
junyulai
d27c14dd75 [SM05] Enable record mobile network stats by collapsed rat type am: 2632681cf0 am: 3b1ca8dbac
Change-Id: Ie23c2131349412d9dae04db122d7b3d14047b87f
2020-03-19 09:40:51 +00:00
Junyu Lai
4a0f9fa336 Merge changes I7eaca623,Ic94da540,If330e853,Ie2d229be,Ic6b2f10f am: b3c511d028
Change-Id: I091c93ba6b0001253e2b0679eee48293b4e51afc
2020-03-19 09:31:08 +00:00
junyulai
5d348ec90f [SM07] Make combine subtype configurable from Settings am: 678befa63c
Change-Id: I0c3f4a02f16eb6a4d9e48fa775bf456707d2b1bb
2020-03-19 09:31:02 +00:00
junyulai
3b1ca8dbac [SM05] Enable record mobile network stats by collapsed rat type am: 2632681cf0
Change-Id: If4bcfaefd2244be67449066ef54a6bdc0c00eb86
2020-03-19 09:31:00 +00:00
junyulai
b767c0b024 [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 10:10:07 +08:00
junyulai
678befa63c [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 and
 fix merge conflict in SettingsBackupTest)
2020-03-19 10:10:07 +08:00
junyulai
2632681cf0 [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-19 10:10:07 +08:00
Paul Hu
5124f9cf0d Merge "Kill ConnectivityManager.CONNECTIVITY_ACTION_SUPL" am: 57b993bfb5 am: 7ece6bb2be
Change-Id: Id52a6936a84d5ee1181dea78227eb8fface1fd33
2020-03-19 01:45:19 +00:00
Paul Hu
7ece6bb2be Merge "Kill ConnectivityManager.CONNECTIVITY_ACTION_SUPL" am: 57b993bfb5
Change-Id: I823ae84ac6f522400297d174ebfad5e61d4a6cd9
2020-03-19 01:30:58 +00:00
Paul Hu
57b993bfb5 Merge "Kill ConnectivityManager.CONNECTIVITY_ACTION_SUPL" 2020-03-19 01:10:55 +00:00
Lorenzo Colitti
965434afab Make Ethernet interfaces more testable.
This CL adds a setIncludeTestInterfaces method to EthernetManager
that, when called, causes the Ethernet service to recognize and
manage test interfaces created by TestNetworkManager.

Bug: 150644681
Test: Tested by EthernetTetheringTest in same topic
Change-Id: I86eef7a93267f800dbfc8eafd307effa76a344ca
2020-03-19 09:46:37 +09:00
Cody Kesting
5ab1f55d1f Change NetworkCapabilties 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
Merged-In: I2652a5b0f276b8944454af5cb4b1383a3e054cfa
2020-03-18 15:18:47 -07:00
Cody Kesting
47b41757f6 Merge "Restrict VPN Diagnostics callbacks to underlying networks." am: 4074c2d181 am: d48978e6b6
Change-Id: I02db7b5aaec0a5a735fc18cdae41e45c9e10b622
2020-03-18 20:26:51 +00:00
Cody Kesting
d48978e6b6 Merge "Restrict VPN Diagnostics callbacks to underlying networks." am: 4074c2d181
Change-Id: Ia163abffdacf74218f37db9c67372867c6fe1143
2020-03-18 20:14:44 +00:00
Cody Kesting
4074c2d181 Merge "Restrict VPN Diagnostics callbacks to underlying networks." 2020-03-18 20:07:52 +00:00
Junyu Lai
50e1dbf641 Merge "Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister" am: cc227f1df5 am: 8262d74f5c
Change-Id: Ia9c20c7ce560a06c393a1010e8a8220b67ce753e
2020-03-18 09:02:22 +00:00
Junyu Lai
8262d74f5c Merge "Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister" am: cc227f1df5
Change-Id: I93da1059a21adcf14f8c036c17963a07b1db964d
2020-03-18 08:55:01 +00:00
Junyu Lai
cc227f1df5 Merge "Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister" 2020-03-18 08:41:08 +00:00
Lorenzo Colitti
62304b595c Merge "mtu: Add MTU parameter to Routes" am: 9839a4311a am: 1f7c5afe8d
Change-Id: If67ccf671b2f2739bb4f01472c2f832c1f202cc5
2020-03-18 07:52:28 +00:00
Lorenzo Colitti
1f7c5afe8d Merge "mtu: Add MTU parameter to Routes" am: 9839a4311a
Change-Id: I3c730b35133c62db6723a58835e7f9d3874c124b
2020-03-18 07:34:11 +00:00
junyulai
80bf34b2af Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister
Test: atest ConnectivityServiceTest#testNetworkFactoryUnregister \
      --geneate-new-metrics 100
Bug: 151792032
Change-Id: Iece9e8ad5c51170cd404ac995d0005392d37fe0c
2020-03-18 15:22:54 +08:00
Lorenzo Colitti
9839a4311a Merge "mtu: Add MTU parameter to Routes" 2020-03-18 07:20:01 +00:00
Lucas Lin
9f50cbc926 Merge "Add version check to prevent test fail on Android Q" am: 30faad6d0f am: 58d17c3196
Change-Id: I5220ea9eb768e14a12b414f710e45179656cf361
2020-03-18 04:23:05 +00:00
Lucas Lin
58d17c3196 Merge "Add version check to prevent test fail on Android Q" am: 30faad6d0f
Change-Id: I61546d3dc488326a32386a7d6f4c87d857b29fbd
2020-03-18 04:10:21 +00:00
Junyu Lai
40f76ec791 Merge "[SP25] Rename functions that add Entry conditionally" am: 52ee59fb03 am: f672bdac52
Change-Id: I59d965fa3a67be4994fe19a2f91e30d2ef114f81
2020-03-18 04:02:41 +00:00
Lucas Lin
30faad6d0f Merge "Add version check to prevent test fail on Android Q" 2020-03-18 03:56:37 +00:00
Junyu Lai
f672bdac52 Merge "[SP25] Rename functions that add Entry conditionally" am: 52ee59fb03
Change-Id: I7e0698f0e60d4c26864ceb728b74a265351a8506
2020-03-18 03:45:41 +00:00
Junyu Lai
52ee59fb03 Merge "[SP25] Rename functions that add Entry conditionally" 2020-03-18 03:16:41 +00:00
junyulai
a896436ef2 [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
Merged-In: I9495a198cf247e6c79100f7ac1edcea370b071de
(cherry picked from ag/10700816)
2020-03-18 00:29:15 +00:00
Automerger Merge Worker
16cbab3d22 Merge "Update ConnectivityDiagnosticsCallback function name." am: 5596ba1619 am: 5767d83c67
Change-Id: Ie6123e8cb461f3803a7e88ebfced68e19c8e14b6
2020-03-17 19:28:26 +00:00
Automerger Merge Worker
5767d83c67 Merge "Update ConnectivityDiagnosticsCallback function name." am: 5596ba1619
Change-Id: I51d625ac3c086aceba9c06be7585e0e4f5022f1a
2020-03-17 19:13:39 +00:00
Cody Kesting
5596ba1619 Merge "Update ConnectivityDiagnosticsCallback function name." 2020-03-17 19:00:39 +00:00
Cody Kesting
fa1ef5eb1b Update ConnectivityDiagnosticsCallback function name.
API Council feedback suggests renaming ConnectivityDiagnosticsCallback
'onConnectivityReport' function to be 'onConnectivityReportAvailable'.

Bug: 150598997
Test: atest FrameworksNetTests
Change-Id: Ieea727ecee6cf358a53a215fd4b06233dfe967ea
Merged-In: Ieea727ecee6cf358a53a215fd4b06233dfe967ea
2020-03-17 17:10:38 +00:00
Automerger Merge Worker
9c36104867 Merge "Shorten the output of NetworkAgentInfo#toString()." am: d498a01647 am: d268beb59d
Change-Id: I480aefc8b072cb7f186690ca05b730244bd460d6
2020-03-17 15:55:07 +00:00
Automerger Merge Worker
d268beb59d Merge "Shorten the output of NetworkAgentInfo#toString()." am: d498a01647
Change-Id: I73e47e19588a758fbee07ae96670b126251a9b56
2020-03-17 15:42:42 +00:00
Treehugger Robot
d498a01647 Merge "Shorten the output of NetworkAgentInfo#toString()." 2020-03-17 15:29:39 +00:00
Lorenzo Colitti
08707366d0 Shorten the output of NetworkAgentInfo#toString().
Currently, printing a NetworkAgentInfo results in a very long
string. Make it a bit shorter by:

- Not printing a number of fields in NetworkInfo that are no
  longer used.
- Instead of printing flags regardless of whether they are true
  false, only print ones that are true. For example, this changes
    everCaptivePortalDetected{true} lastCaptivePortalDetected{false} captivePortalValidationPending{false}
  to:
    everCaptivePortalDetected
- Only printing clat information if clatd is started.

Also, put the long and variable-length fields lp and nc at the
end of the output.

Test: manual
Change-Id: I3312286be307ef1762890cbc6b717f12ce5b2b92
2020-03-17 22:29:37 +09:00
Automerger Merge Worker
138782816e Merge "Removing some of the API don't have to be @SystemApi" am: b0863e0f5b am: 3507c7d8c7
Change-Id: I1ac545b986a0e43f2da5a9008243d8b1df3f8fc4
2020-03-17 13:15:23 +00:00
Automerger Merge Worker
3507c7d8c7 Merge "Removing some of the API don't have to be @SystemApi" am: b0863e0f5b
Change-Id: I6687ba646982ea924feae7d8da6732a04184321e
2020-03-17 13:04:11 +00:00
Treehugger Robot
b0863e0f5b Merge "Removing some of the API don't have to be @SystemApi" 2020-03-17 12:51:25 +00:00
Automerger Merge Worker
d41fe1d25a Merge changes I97015365,Ic9db4b9b am: 4d08f370af am: d714cd3f6d
Change-Id: I8e7ea75661fad300057239d99c106c55a6bdf54d
2020-03-17 10:15:53 +00:00
Automerger Merge Worker
d714cd3f6d Merge changes I97015365,Ic9db4b9b am: 4d08f370af
Change-Id: Ic99385f58c7a0ee246d7dfeb12eb1723fda65c4b
2020-03-17 09:54:53 +00:00
Chiachang Wang
4d08f370af Merge changes I97015365,Ic9db4b9b
* changes:
  Add NattKeepalivePacketDataTest
  Add KeepalivePacketDataTest
2020-03-17 09:38:41 +00:00
Automerger Merge Worker
82b08b1ab9 Merge "services.net: Add a static library needed by wifi module" am: d7a6ba0cbb am: 98fd86ff4d
Change-Id: I87011f46dceed7cad38b2f858e5fdf39bba0d6a8
2020-03-17 09:35:35 +00:00