Commit Graph

532 Commits

Author SHA1 Message Date
Anton Hansson
4dd8a42cff Merge "Add individual API tracking files for modules" 2020-03-20 12:47:52 +00:00
Junyu Lai
0fb2814388 Merge "Create a builder for NetworkCapabilities." into rvc-dev 2020-03-20 11:03:47 +00:00
Junyu Lai
cf99dc2717 Merge "Expose netId by adding getter API" into rvc-dev 2020-03-20 11:03:05 +00:00
Paul Hu
d685312245 [TNU1.1] Update tethering notification strings
Update string for no upstream and cellular roaming notification.

Bug: 145629001
Bug: 147818698
Test: atest TetheringTests
Change-Id: I7302cf351b0a9a42ad5a543f61ab084de189f282
Merged-In: I7302cf351b0a9a42ad5a543f61ab084de189f282
(cherry picked from aosp/1261866)
2020-03-20 10:05:57 +00:00
TreeHugger Robot
07bb07217a Merge "[TNU1.2] Add string for client number notification" into rvc-dev 2020-03-20 00:11:33 +00:00
Kumar Anand
74165f0b29 [TNU1.1] Update tethering notification strings
Update string for no upstream and cellular roaming notification.

Bug: 145629001
Bug: 147818698
Test: atest TetheringTests
Change-Id: I7302cf351b0a9a42ad5a543f61ab084de189f282
2020-03-19 15:57:33 -07:00
Mark Chien
9bfe7f7b3e Merge "TetheringManager API clean up" 2020-03-19 16:09:21 +00:00
Treehugger Robot
2dd2453ae0 Merge "Move NetworkCallback to last parameter for new exposed requestNetwork" 2020-03-19 15:51:32 +00:00
Treehugger Robot
4f0eb16c41 Release the interface request when Ethernet tethering is stopped.
When the Ethernet interface becomes unavailable (e.g., because
the cable was unplugged or the interface was removed), or when
setEthernetTethering(false) is called, release the Ethernet
interface request.

This ensures that:
- The Ethernet interface immediately becomes available for use in
  client mode.
- If an interface later becomes available, tethering is not
  automatically started. This is consistent with what happens for
  other downstream types such as wifi and USB. Evey time one of
  those downstreams goes down, tethering is stopped and will not
  be restarted.

Test: manual
Bug: 148824036
Change-Id: Iaf85e800569f2e08c39f7ebb96f8aa34f6e53133
Merged-In: Iaf85e800569f2e08c39f7ebb96f8aa34f6e53133
(cherry picked from commit e54c92e5657abe2ce5da9dcba76b89c5e540cc44)
2020-03-19 15:40:40 +00:00
Treehugger Robot
0cc7c00396 Merge "Release the interface request when Ethernet tethering is stopped." 2020-03-19 14:59:12 +00:00
Mark Chien
69a60ca655 Merge "Hide startTethering with type function to module-lib only" into rvc-dev 2020-03-19 14:55:09 +00:00
TreeHugger Robot
f80f541d16 Merge "Move NetworkCallback to last parameter for new exposed requestNetwork" into rvc-dev 2020-03-19 13:40:51 +00:00
Lorenzo Colitti
d44de5a624 Release the interface request when Ethernet tethering is stopped.
When the Ethernet interface becomes unavailable (e.g., because
the cable was unplugged or the interface was removed), or when
setEthernetTethering(false) is called, release the Ethernet
interface request.

This ensures that:
- The Ethernet interface immediately becomes available for use in
  client mode.
- If an interface later becomes available, tethering is not
  automatically started. This is consistent with what happens for
  other downstream types such as wifi and USB. Evey time one of
  those downstreams goes down, tethering is stopped and will not
  be restarted.

Test: manual
Bug: 148824036
Change-Id: Iaf85e800569f2e08c39f7ebb96f8aa34f6e53133
2020-03-19 22:35:28 +09:00
markchien
b1bfea5367 Hide startTethering with type function to module-lib only
Bug: 151918384
Test: m
Change-Id: Icef8b363aae97dd020d618bcb397f661aa6c4750
2020-03-19 21:04:04 +08:00
Chalard Jean
db3d568139 Create a builder for NetworkCapabilities.
Bug: 151322799
Test: FrameworksWifiTests
Change-Id: I06eb97e50d5583579b3c26d1365d2dbaec8bfc99
2020-03-19 21:55:57 +09:00
Paul Hu
9c9aeba98f [TNU1.2] Add string for client number notification
Add string for client number notification

Bug: 122085773
Test: atest TetheringTests
Change-Id: Icc4e59ce3b2d8d4c1c7883c2f9d040d3ce563f09
Merged-In: Icc4e59ce3b2d8d4c1c7883c2f9d040d3ce563f09
(cherry picked from aosp/1259995)
2020-03-19 12:04:51 +00:00
Mark Chien
8a0af9515d Merge "TetheringManager API clean up" into rvc-dev 2020-03-19 12:04:05 +00:00
markchien
ec0b68d491 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
8146b56d01 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
markchien
ac580f9826 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
Mark Chien
6223b8f4e8 Merge "Support static address configuration" into rvc-dev 2020-03-19 10:03:56 +00:00
Anton Hansson
65d1e30c0f Add individual API tracking files for modules
This adds metalava api tracking generation to the module
stub rules, to make sure we know exactly what API a
particular module stub exports.

Bug: 147768409
Test: m update-api check-api
Exempt-From-Owner-Approval: approved internally
Change-Id: Iaf2ef5b5751eb208d119ddbc74481239366fe581
Merged-In: Iaf2ef5b5751eb208d119ddbc74481239366fe581
(cherry picked from commit e7c52c7e3f)
2020-03-19 08:51:11 +00:00
markchien
f1332573bb 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
paulhu
1957e6a0fb [TNU1.2] Add string for client number notification
Add string for client number notification

Bug: 122085773
Test: atest TetheringTests
Change-Id: Icc4e59ce3b2d8d4c1c7883c2f9d040d3ce563f09
2020-03-19 15:48:23 +08:00
markchien
dc651f03da Expose netId by adding getter API
Bug: 151156820
Test: m
      atest TetetheringTests
Change-Id: Ieb1483c146aa2f7d8f251157e6e81d71c44ae899
(cherry picked from commit 8831c4b54178753013d568c0b76bbf7487db8122)
2020-03-19 15:57:31 +09:00
Automerger Merge Worker
9462a3c9f0 Support static address configuration
Application can specify static ipv4 server and client address to setup
tethering and this is one shot configuration. Tethering service would
not save the configuration and the configuration would be reset when
tethering stop or start failure.

When startTethering callback fired, it just mean tethering is requested
successful. Therefore, callers may call startTethering again if
startTethering successful but do not receive following tethering active
notification for a while. Tethering service never actually does anything
synchronously when startTethering is called:
  -startProvisioningIfNeeded just posts a message to the handler thread.
  -enableTetheringInternal doesn't do anything synchronously, it just
  asks the downstreams to get their interfaces ready and waits for
  callbacks.
If tethering is already enabled with a different request,
tethering would be disabled and re-enabled.

Bug: 141256482
Test: -build, flash, boot
      -atest TetheringTests
      -atest CtsTetheringTest

Change-Id: I2b2dd965a673e6f1626738d41b5d443f0f9fbd0e
Merged-In: I0399917e7cefa1547d617e688225544c4fc1a231
(cherry picked from commit 5d6723e24e21154bef3967585a8adc069e007f49)
2020-03-19 12:39:46 +08:00
Paul Hu
57e22c5ab9 [TNU1.1]Add tethering notification strings
Add string for no upstream and cellular roaming notification.

Bug: 145629001
Bug: 147818698
Test: atest TetheringTests
Change-Id: I30f68d83344f66fb3ef77abf3f8748c3eb1276f0
Merged-In: I30f68d83344f66fb3ef77abf3f8748c3eb1276f0
(cherry picked from aosp/1260112)
2020-03-19 02:55:03 +00:00
Paul Hu
09bc9bf0b9 Merge "[TNU1.1]Add tethering notification strings" 2020-03-19 01:33:01 +00:00
Remi NGUYEN VAN
06b45ca764 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
markchien
245352ed07 Assign specific client address to dhcp server
Bug: 141256482
Test: manual
      atest TetheringTests

Change-Id: Ief76c98c843ba5420224cbf0f34464f366c891b7
2020-03-19 01:47:25 +08:00
Anton Hansson
49bdf5615f Add individual API tracking files for modules
This adds metalava api tracking generation to the module
stub rules, to make sure we know exactly what API a
particular module stub exports.

Bug: 147768409
Test: m update-api
Exempt-From-Owner-Approval: Approved in master
Change-Id: Iaf2ef5b5751eb208d119ddbc74481239366fe581
Merged-In: Iaf2ef5b5751eb208d119ddbc74481239366fe581
2020-03-18 11:03:12 +00:00
Remi NGUYEN VAN
b8fecf4b32 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
Junyu Lai
2a17338e44 Merge "[SP25] Rename functions that add Entry conditionally" 2020-03-18 03:16:41 +00:00
paulhu
3355cc4f06 [TNU1.1]Add tethering notification strings
Add string for no upstream and cellular roaming notification.

Bug: 145629001
Bug: 147818698
Test: atest TetheringTests
Change-Id: I30f68d83344f66fb3ef77abf3f8748c3eb1276f0
2020-03-18 09:49:51 +08:00
junyulai
36a172910e [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
junyulai
abb0596a0a [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
4aa86b782b [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
Mark Chien
6d175120a0 Merge "Support static address configuration" 2020-03-17 13:26:09 +00:00
Remi NGUYEN VAN
677a3b5e92 Merge "Cleanup the TetheredClients API" into rvc-dev 2020-03-17 04:49:06 +00:00
Paul Hu
517ca12acd Merge "[TNU01] Add Tethering notification updater" into rvc-dev 2020-03-17 01:38:03 +00:00
markchien
f053e4b6f5 Support static address configuration
Application can specify static ipv4 server and client address to setup
tethering and this is one shot configuration. Tethering service would
not save the configuration and the configuration would be reset when
tethering stop or start failure.

When startTethering callback fired, it just mean tethering is requested
successful. Therefore, callers may call startTethering again if
startTethering successful but do not receive following tethering active
notification for a while. Tethering service never actually does anything
synchronously when startTethering is called:
  -startProvisioningIfNeeded just posts a message to the handler thread.
  -enableTetheringInternal doesn't do anything synchronously, it just
  asks the downstreams to get their interfaces ready and waits for
  callbacks.
If tethering is already enabled with a different request,
tethering would be disabled and re-enabled.

Bug: 141256482
Test: -build, flash, boot
      -atest TetheringTests
      -atest CtsTetheringTest

Change-Id: I0399917e7cefa1547d617e688225544c4fc1a231
2020-03-17 00:11:16 +08:00
Anton Hansson
064ed493ce Create all variants of stubs for tethering
Add separate publicapi, systemapi and module_libs stubs for tethering.

Bug: 147768409
Test: m
Test: m framework-tethering-stubs-{public,system,module_libs_}api
Change-Id: I0ed44691b4e7080818442a9d0eb37d874f707195
Merged-In: I0ed44691b4e7080818442a9d0eb37d874f707195
2020-03-16 15:54:19 +00:00
Automerger Merge Worker
0010ca0c70 Cleanup the TetheredClients API
Add comments to getters as requested in API review, and remove the
expirationTime private field that was planned to be replaced with
LinkAddress expiration.

Test: atest TetheringTests
Fixes: 150878126
Change-Id: Iecf65859cdeeaac2fa7b817b4f505c510424ac89
Merged-In: Iecf65859cdeeaac2fa7b817b4f505c510424ac89
(cherry picked from commit 594d0eae38c13e2bb03de0b3ae1f8781991c321e)
2020-03-16 10:11:29 +00:00
Automerger Merge Worker
943fb5b686 Change TetheringConstants class to final
Bug: 151322331
Test: m doc-comment-check-docs

Change-Id: Ieca36d81b7799988b8dbb9c0d22de690136303ab
Merged-In: Ia02be3d1d91a08ae4a56b25560ed448c96a693db
(cherry picked from commit 5e2740b24658ba340a6b47a46c89cfd642afe394)
2020-03-16 07:43:05 +00:00
Mark Chien
0c5f387efe Merge "Change TetheringConstants class to final" 2020-03-16 05:25:40 +00:00
Mark Chien
1d68778a35 Merge "Give tethering bluetooth privilege permission" 2020-03-16 04:46:44 +00:00
Junyu Lai
12b21035c4 Merge "[SP21] Address comments for API council review about aosp/1172143" 2020-03-16 02:41:19 +00:00
markchien
4b896ba32b Change TetheringConstants class to final
Bug: 151322331
Test: m doc-comment-check-docs
Change-Id: Ia02be3d1d91a08ae4a56b25560ed448c96a693db
2020-03-15 22:54:57 +08:00
Remi NGUYEN VAN
dfdf750417 Cleanup the TetheredClients API
Add comments to getters as requested in API review, and remove the
expirationTime private field that was planned to be replaced with
LinkAddress expiration.

Test: atest TetheringTests
Fixes: 150878126
Change-Id: Iecf65859cdeeaac2fa7b817b4f505c510424ac89
2020-03-13 19:01:15 +09:00
markchien
db2a16b8c4 Give tethering bluetooth privilege permission
Permisssion of PanService#setBluetoothTethering is change from
BLUETOOTH_ADMIN to BLUETOOTH_PRIVILEGED.
Tethering service need bluetooth privilege permission to enable
bluetooth tethering.

Bug: 146045934
Test: on/off bluetooth tethering
Change-Id: Ib87a5d5a5bb49390aa55e52713bb3539d4a52348
2020-03-13 07:06:58 +00:00