Commit Graph

904 Commits

Author SHA1 Message Date
Paul Duffin
027e07d72d [automerger skipped] Merge "Switch framework-tethering to use java_sdk_library" am: b5bf211753 am: d65294b376 -s ours
am skip reason: Change-Id Id1c2e848430c49a2da7402244814cd084f5da77c with SHA-1 cbac8e0b63 is in history

Change-Id: I1f0759e84c6f7e17427165fc6db9dd7531284e8a
2020-05-28 15:29:34 +00:00
Paul Duffin
d65294b376 Merge "Switch framework-tethering to use java_sdk_library" am: b5bf211753
Change-Id: I9e5526a23087dd9d9610b4ce5e29e28a7dfdda4f
2020-05-28 15:18:36 +00:00
Paul Duffin
b5bf211753 Merge "Switch framework-tethering to use java_sdk_library" 2020-05-28 15:01:46 +00:00
Paul Duffin
2dae272903 Switch framework-tethering to use java_sdk_library
The names of the individual modules do not quite follow the pattern
that java_sdk_library uses so this temporarily sets the following:
    naming_scheme: "frameworks-modules"

That causes java_sdk_library to use a naming scheme that matches the
one used by the individual modules of this. It will be cleaned up
later.

Part of the purpose of the java_sdk_library is to hide the
implementation code and force users of the library to depend on stubs
for a well defined API. Ideally, it would allow access to the
implementation in those cases where it is safe, e.g. from within the
same APEX, or from tests for the implementation. Unfortunately, due to
limitations in the build it does not yet have enough information to
make that decision correctly which means that any code that needs to
compile against the implementation is broken which would prevent us
from converting the module to java_sdk_library.

However, the only way to provide the additional information to allow
the implementation to be correctly exposed is to convert the modules
to java_sdk_library; a cycle.

In order to break that cycle the java_sdk_library creates a special
<module>.impl target which is used directly by tests and any other code
that needs it. Once all the modules have been converted to a
java_sdk_library then we can resolve the limitations in the build and
remove the direct references to <module>.impl.

Test: m update-api
Bug: 155164730
Merged-In: If5c115f482751f9f4b5f047e9e401a18e36799ef
Merged-In: Id1c2e848430c49a2da7402244814cd084f5da77c
Change-Id: Id1c2e848430c49a2da7402244814cd084f5da77c
2020-05-28 13:14:52 +00:00
Paul Duffin
6216a6904e Merge "Switch framework-tethering to use java_sdk_library" into rvc-dev am: 5e988a656f
Change-Id: Icf8a3b8eed7e85065d54f2f48d8cb6f05974de00
2020-05-28 13:09:48 +00:00
Paul Duffin
cbac8e0b63 Switch framework-tethering to use java_sdk_library
The names of the individual modules do not quite follow the pattern
that java_sdk_library uses so this temporarily sets the following:
    naming_scheme: "frameworks-modules"

That causes java_sdk_library to use a naming scheme that matches the
one used by the individual modules of this. It will be cleaned up
later.

Part of the purpose of the java_sdk_library is to hide the
implementation code and force users of the library to depend on stubs
for a well defined API. Ideally, it would allow access to the
implementation in those cases where it is safe, e.g. from within the
same APEX, or from tests for the implementation. Unfortunately, due to
limitations in the build it does not yet have enough information to
make that decision correctly which means that any code that needs to
compile against the implementation is broken which would prevent us
from converting the module to java_sdk_library.

However, the only way to provide the additional information to allow
the implementation to be correctly exposed is to convert the modules
to java_sdk_library; a cycle.

In order to break that cycle the java_sdk_library creates a special
<module>.impl target which is used directly by tests and any other code
that needs it. Once all the modules have been converted to a
java_sdk_library then we can resolve the limitations in the build and
remove the direct references to <module>.impl.

Test: m Tethering InProcessTethering checkapi
Bug: 155164730
Merged-In: If5c115f482751f9f4b5f047e9e401a18e36799ef
Change-Id: Id1c2e848430c49a2da7402244814cd084f5da77c
2020-05-28 12:50:04 +01:00
Treehugger Robot
99466515f8 Merge "Extend timeout for requesting tethered interface" am: 95386f9ebd am: 0c71ef1a6f
Change-Id: I577127f79391a4859dc7324b8cc47729a807a165
2020-05-28 08:50:08 +00:00
Treehugger Robot
0c71ef1a6f Merge "Extend timeout for requesting tethered interface" am: 95386f9ebd
Change-Id: I2336a5aeeda958048d6e8b24ff0015ab45a66397
2020-05-28 08:34:24 +00:00
Treehugger Robot
95386f9ebd Merge "Extend timeout for requesting tethered interface" 2020-05-28 08:19:10 +00:00
markchien
908518d8e2 Extend timeout for requesting tethered interface
Extend the timeout to lower the EthernetTetheringTest flaky.

Besides, also explicitly exempt entitlement check in
EtetherntTetheringTest because it do not test tethering upstream
currently. Thus, the tests would not be interrupted by entitlement
check if test SIM is entitlement required.

Bug: 156713866
Test: TetheringCoverageTests, CtsTehteringTest

Change-Id: I45e8e8d737486def9d0de8943ec7f09ca0942a0b
2020-05-28 12:13:14 +08:00
Mark Chien
967f044f83 [automerger skipped] Merge "Remove platform cert from Tethering tests" into rvc-dev am: 041f00f991 -s ours
am skip reason: Change-Id I7c539f1f4a447b5913164b222601c6113c6fe645 with SHA-1 e79e02e5c4 is in history

Change-Id: Ib11ad54c4a32b96ca60530c0ea0806fe2f24b67b
2020-05-27 12:16:59 +00:00
Treehugger Robot
369fd25f79 Remove platform cert from Tethering tests
Bug: 156866746
Test: atest TetheringTests, TetheringCoverageTests
Merged-In: I7c539f1f4a447b5913164b222601c6113c6fe645
Change-Id: I7c539f1f4a447b5913164b222601c6113c6fe645
2020-05-27 09:27:27 +00:00
Treehugger Robot
b4d272b13e Merge "Remove platform cert from Tethering tests" am: a5e8d3f73d am: e88c5146da
Change-Id: I51317f3769d60393a21ced8a194f253f97ef9ffd
2020-05-27 04:17:44 +00:00
Treehugger Robot
e88c5146da Merge "Remove platform cert from Tethering tests" am: a5e8d3f73d
Change-Id: If2177a9f24a9074ede3b90e083dbf6f3c88c1775
2020-05-27 04:07:39 +00:00
Mark Chien
ec52d43f0b [automerger skipped] Merge "Adjust TTL for ipv6 tethering" into rvc-dev am: d0355d7d40 -s ours
am skip reason: Change-Id I7f2696a642f96c6aafb5613b980bf5bcdd08bbda with SHA-1 d63c4f35de is in history

Change-Id: I76feb39b69ebb2d45873807a878e4d6c364b0a9b
2020-05-26 01:38:10 +00:00
markchien
e79e02e5c4 Remove platform cert from Tethering tests
Bug: 156866746
Test: atest TetheringTests, TetheringCoverageTests
Change-Id: I7c539f1f4a447b5913164b222601c6113c6fe645
2020-05-26 09:31:16 +08:00
Mark Chien
cd309138ce Adjust TTL for ipv6 tethering
If upstream is cellular, set the TTL in Router Advertisements to
"network-set TTL - 1" for carrier requirement. For other non-cellular
upstream, set TTL as "network-set TTL + 1" to preventing arbitrary
distinction between tethered and untethered traffic.

Bug: 154776299
Test: atest TetheringTests

Merged-In: I7f2696a642f96c6aafb5613b980bf5bcdd08bbda
Change-Id: I7f2696a642f96c6aafb5613b980bf5bcdd08bbda
2020-05-25 13:27:35 +00:00
Mark Chien
6cd572faa2 [automerger skipped] Merge "TetheringServiceTest: test caller permission" into rvc-dev am: 5026370372 -s ours
am skip reason: Change-Id I7beea3f011d930e433443ed62d772a3f8cce5d78 with SHA-1 2a1656d3f8 is in history

Change-Id: I5a2a86de03bc825057445d8caa26b4ba30e91f48
2020-05-25 10:51:48 +00:00
Mark Chien
5026370372 Merge "TetheringServiceTest: test caller permission" into rvc-dev 2020-05-25 10:40:03 +00:00
Xiao Ma
0071dfee6e [automerger skipped] Merge "Support MirrorLink DHCPDECLINE." into rvc-dev am: 3ab17953c6 -s ours
am skip reason: Change-Id If2871bf899cb5890bbfee18063a194c92b6f474e with SHA-1 4455d6b1bd is in history

Change-Id: I69ac4260782960199c08369c6fb99f62251e7222
2020-05-25 09:15:37 +00:00
markchien
5232658de2 TetheringServiceTest: test caller permission
Bug: 154869719
Test: atest TetheringTests
Original-Change: https://android-review.googlesource.com/1288503

Fix TetheringServiceTest test WRITE_SETTINGS permission failure

AdoptShellPermissionIdentity can not pass permission check by
Settings#checkAndNoteWriteSettingsOperation. It would compare the caller
uid and its package name. See error below:
1. java.lang.SecurityException:
Specified package com.android.shell under uid 10239 but it is really 2000
2. java.lang.SecurityException:
uid 10245 does not have android.permission.UPDATE_APP_OPS_STATS.

Override the method and test if caller hold WRITE_SETTINGS directly.

Bug: 154869719
Test: TetheringTests, TetheringCoverageTests, NetworkStackNextTests,
NetworkStackCoverageTests
Original-Change: https://android-review.googlesource.com/1313806

Change-Id: I7beea3f011d930e433443ed62d772a3f8cce5d78
Merged-In: I7beea3f011d930e433443ed62d772a3f8cce5d78
2020-05-25 12:07:06 +08:00
Mark Chien
916f0d9420 Merge "Adjust TTL for ipv6 tethering" am: 6d0a178a6b am: 23450e1fd1
Change-Id: I73c02d9ad80080a76e8d04d1d61467b434a68732
2020-05-25 02:04:59 +00:00
Mark Chien
23450e1fd1 Merge "Adjust TTL for ipv6 tethering" am: 6d0a178a6b
Change-Id: I80491fd3f1f344d17617aa238128cee39ce8e79f
2020-05-25 01:55:01 +00:00
Mark Chien
6d0a178a6b Merge "Adjust TTL for ipv6 tethering" 2020-05-25 01:42:36 +00:00
markchien
d63c4f35de Adjust TTL for ipv6 tethering
If upstream is cellular, set the TTL in Router Advertisements to
"network-set TTL - 1" for carrier requirement. For other non-cellular
upstream, set TTL as "network-set TTL + 1" to preventing arbitrary
distinction between tethered and untethered traffic.

Bug: 154776299
Test: atest TetheringTests

Change-Id: I7f2696a642f96c6aafb5613b980bf5bcdd08bbda
2020-05-24 22:52:44 +08:00
Mark Chien
0454f82509 Merge "Fix TetheringServiceTest test WRITE_SETTINGS permission failure" am: 7e8b14abee am: b46dcf8317
Change-Id: I82825eeded51f779325291cc1142cb1d6111915b
2020-05-21 08:31:37 +00:00
Mark Chien
b46dcf8317 Merge "Fix TetheringServiceTest test WRITE_SETTINGS permission failure" am: 7e8b14abee
Change-Id: If9674488fca6833556733efc8fbda230b93e798a
2020-05-21 08:11:47 +00:00
markchien
f4394e83f8 Fix TetheringServiceTest test WRITE_SETTINGS permission failure
AdoptShellPermissionIdentity can not pass permission check by
Settings#checkAndNoteWriteSettingsOperation. It would compare the caller
uid and its package name. See error below:
1. java.lang.SecurityException:
Specified package com.android.shell under uid 10239 but it is really 2000
2. java.lang.SecurityException:
uid 10245 does not have android.permission.UPDATE_APP_OPS_STATS.

Override the method and test if caller hold WRITE_SETTINGS directly.

Bug: 154869719
Test: TetheringTests, TetheringCoverageTests, NetworkStackNextTests,
NetworkStackCoverageTests

Change-Id: I2a60c4d66ef30028f9663159f85464ea815248e2
2020-05-20 16:56:33 +08:00
Treehugger Robot
8592480922 Merge "TetheringServiceTest: test caller permission" am: 366eae572d am: e46a70cbfe
Change-Id: Ia1c0ec986750a04290d3125882d00c18f4213ae7
2020-05-19 03:21:42 +00:00
Treehugger Robot
e46a70cbfe Merge "TetheringServiceTest: test caller permission" am: 366eae572d
Change-Id: I5064eb5e27d7803c0f86b75c391b56f1e3cb4d7d
2020-05-19 03:07:55 +00:00
Treehugger Robot
366eae572d Merge "TetheringServiceTest: test caller permission" 2020-05-19 02:40:03 +00:00
markchien
2a1656d3f8 TetheringServiceTest: test caller permission
Bug: 154869719
Test: atest TetheringTests
Change-Id: I7beea3f011d930e433443ed62d772a3f8cce5d78
2020-05-19 09:04:43 +08:00
Xiao Ma
654013479b Support MirrorLink DHCPDECLINE.
Add the specific implementation of onNewPrefixRequest callback
on IpServer side, also refactor some common code.

Bug: 130741856
Test: atest TetheringTests
Merged-In: If2871bf899cb5890bbfee18063a194c92b6f474e
Change-Id: If2871bf899cb5890bbfee18063a194c92b6f474e
2020-05-18 14:23:13 +00:00
Mark Chien
2326aa2bde [automerger skipped] Merge "Fix READ_DEVICE_CONFIG permission denied problem in TetheringTests" into rvc-dev am: 1c65357c4b -s ours
am skip reason: Change-Id Id9c0397306f3872fc23520d1354f338035a96dc9 with SHA-1 74174690d1 is in history

Change-Id: I847a1160b72c8ab384a369f7be73a237f94c8d85
2020-05-15 16:03:17 +00:00
Mark Chien
72856af566 [automerger skipped] Merge "Make members final in TetheringService" into rvc-dev am: 73260a5564 -s ours
am skip reason: Change-Id I5a82a6347f62d3a7031db5c56e8e0c8530dafd8f with SHA-1 bd2cbe6c73 is in history

Change-Id: I5e957bffc276a3d2c0917ae61ec180fa4256f875
2020-05-15 15:46:43 +00:00
Treehugger Robot
91b2bda682 Fix READ_DEVICE_CONFIG permission denied problem in TetheringTests
Bug: 156557122
Test: atest TetheringTests

Merged-In: Id9c0397306f3872fc23520d1354f338035a96dc9
Change-Id: Id9c0397306f3872fc23520d1354f338035a96dc9
2020-05-14 17:16:39 +00:00
Treehugger Robot
dd8e64609a Merge "Fix READ_DEVICE_CONFIG permission denied problem in TetheringTests" am: fb2caff580 am: 61aba704a9
Change-Id: I246e4f0d90e95418cbf55db5b802997faf4eae66
2020-05-14 16:33:30 +00:00
Treehugger Robot
61aba704a9 Merge "Fix READ_DEVICE_CONFIG permission denied problem in TetheringTests" am: fb2caff580
Change-Id: Id517f4122c4b078d16035274e8979247bc0b40f8
2020-05-14 16:18:24 +00:00
Treehugger Robot
fb2caff580 Merge "Fix READ_DEVICE_CONFIG permission denied problem in TetheringTests" 2020-05-14 16:00:27 +00:00
markchien
74174690d1 Fix READ_DEVICE_CONFIG permission denied problem in TetheringTests
Bug: 156557122
Test: atest TetheringTests

Change-Id: Id9c0397306f3872fc23520d1354f338035a96dc9
2020-05-14 16:42:22 +08:00
Xiao Ma
cad22f9192 Merge "Support MirrorLink DHCPDECLINE." am: cc755bf9fc am: b80b1e09bc
Change-Id: I415ba816492a329d5632e49025284d700b3c14da
2020-05-14 06:52:59 +00:00
Xiao Ma
b80b1e09bc Merge "Support MirrorLink DHCPDECLINE." am: cc755bf9fc
Change-Id: I7082734a50da23488d1369dd6390f7c0ec2c1e0b
2020-05-14 06:41:36 +00:00
Xiao Ma
cc755bf9fc Merge "Support MirrorLink DHCPDECLINE." 2020-05-14 06:27:16 +00:00
Mark Chien
73260a5564 Merge "Make members final in TetheringService" into rvc-dev 2020-05-14 05:48:24 +00:00
Treehugger Robot
41a5e3114a [automerger skipped] Merge "Make members final in TetheringService" am: 7e2180f019 am: 6636efb050 -s ours
am skip reason: Change-Id I5a82a6347f62d3a7031db5c56e8e0c8530dafd8f with SHA-1 bd2cbe6c73 is in history

Change-Id: I521d758718b53c2e455e84acc69f703a082dddf2
2020-05-13 16:29:13 +00:00
Treehugger Robot
6636efb050 Merge "Make members final in TetheringService" am: 7e2180f019
Change-Id: I64e0d2512a31310948cdd106943d9f7345209fb7
2020-05-13 16:14:28 +00:00
Treehugger Robot
7e2180f019 Merge "Make members final in TetheringService" 2020-05-13 16:04:58 +00:00
Mark Chien
997648de38 Merge "Make members final in TetheringService" into rvc-dev-plus-aosp 2020-05-13 15:54:16 +00:00
Nucca Chen
e49e3dd8d6 [automerger skipped] Merge "A minor followup change for BPF offload device option stuff" into rvc-dev am: 8517d037e5 -s ours
am skip reason: Change-Id If9c8bc6f785fa80575db56de4e223292e9807ace with SHA-1 5bc3af9a57 is in history

Change-Id: I3db1b057e79f59a653d925e9e2116d3415d5307d
2020-05-13 15:19:44 +00:00
markchien
bd2cbe6c73 Make members final in TetheringService
1. Move isTetheringSupport logic from TetheringService to Tethering.
2. Small readability improvement in TetheringTest. Also change
config_tether_upstream_automatic from false to true in TetheringTest.
So TetheringTests would default run automatic select upstream flow
instead of selecting by legacy perferred network type list.

Bug: 153609486
Test: atest TetheringTest
Change-Id: I5a82a6347f62d3a7031db5c56e8e0c8530dafd8f
Merged-In: I5a82a6347f62d3a7031db5c56e8e0c8530dafd8f
(cherry picked from commit 569870320a)
2020-05-13 15:07:00 +00:00