Commit Graph

71599 Commits

Author SHA1 Message Date
Patrick Rohr
fda02673e4 gn2bp: move jni_generator.py --jar_file to sanitizer
Test: none
Change-Id: I2a602a3b11304c3c4c8fe551890c7c16c73455bf
2022-11-30 16:07:11 -08:00
Patrick Rohr
9f439321d8 gn2bp: move jni_generator.py --prev_output_dir to sanitizer
Test: none
Change-Id: Id28d5ce912913d2a27dc5fb7aacb8021e7008028
2022-11-30 16:05:28 -08:00
Patrick Rohr
9e5a3c7c74 gn2bp: move jni_generator.py --includes to sanitizer
Test: none
Change-Id: Id8d04aae82c7e1bf169067fae30332b5dae8ca57
2022-11-30 16:05:28 -08:00
Patrick Rohr
4d74aedfb0 gn2bp: some functions should fail silently
It is helpful to have certain functions that deal with target.args fail
silently if the arg does not exist. This eliminates the need to
specifically check for the arg's existence.

Test: none
Change-Id: Ia424a25d0b910c9c0de73d3cefbae21cce598ca9
2022-11-30 16:05:28 -08:00
Patrick Rohr
3e374ef0f2 gn2bp: move jni_generator.py --output_dir to sanitizer
It would probably make sense for arg-related helpers to just fail
silently if an arg does not exist. That will eliminate the has_arg
check.

Test: none
Change-Id: Id04dbe1b5357b3e42e96f1c66ec1f939586113f8
2022-11-30 15:27:52 -08:00
Patrick Rohr
0e24c5fd51 gn2bp: try to put all common path operations in one function
This *might* just work. We'll see, I guess.

Test: none
Change-Id: Id78af8f1b1b7bc3b0e253e17c99049c72be49f08
2022-11-30 15:27:30 -08:00
Patrick Rohr
1bedf6ca4e gn2bp: add update value arg support
Allows for passing in a function that will be applied to transform the
arg value.

Test: none
Change-Id: Iff5c5ab62f8f93d15ff0fb36d740bb326b08655e
2022-11-30 15:12:57 -08:00
Patrick Rohr
2cad933ab6 gn2bp: name helper functions more consistently
Test: none
Change-Id: I84f14d804e206c638df4a61978601706e09c589a
2022-11-30 14:27:40 -08:00
Patrick Rohr
ef4f2bf7e4 gn2bp: rename _has_arg_value to _is_value_arg
Test: none
Change-Id: Id5f529a1d62bac6f1709681baae317aad83f2232
2022-11-30 14:22:40 -08:00
Patrick Rohr
7f11715cd4 gn2bp: move get_action_sanitizer below code it references
Putting definitions ahead of their use aids top-down readability.
This is a plain move without any other changes.

Test: none
Change-Id: I7c05b1bdae67e0db9d2e0b8f6eb89d7d037c0d89
2022-11-30 13:58:05 -08:00
Patrick Rohr
0242a3f996 gn2bp: add jni_generator.py sanitizer
Moves code for appending --javap to sanitizer.

Test: none
Change-Id: I5b3263ddf74a4f7561550eb9057bd54f7367c214
2022-11-30 13:48:59 -08:00
Patrick Rohr
1f7dd583bb gn2bp: add _append_arg helper
Decided to name it _append_arg as this works for value args and list
args, and we could technically overload it to support flags if needed.

Test: none
Change-Id: If44ad2ebb01bb3db86382dc02d5543838a70ede9
2022-11-30 13:45:35 -08:00
Patrick Rohr
3d37780e5d gn2bp: fix arg sanitization
I guess this is essentially a noop.

Test: none
Change-Id: I9524827ad8326737a6c3bd4330433da7b7c12611
2022-11-30 13:42:02 -08:00
Patrick Rohr
501af22acd gn2bp: rename _is_append_arg for clarity
I think _is_list_arg is a slightly better name, so it isn't going to be
confused with _append_arg (which will be introduced shortly).

Thought about naming some more, and in general we have 3 types of args:
- flags (arg without value)
- value arg (arg with value)
- list arg (multiple args with multiple values)

Will work on cleaning up the grammar.

Test: none
Change-Id: I40491b33780c7ab38e926efea2b28f1135c40e0c
2022-11-30 13:38:13 -08:00
Patrick Rohr
15aa692d20 gn2bp: fix _rebase_directory
So it actually does anything now. :)

Test: none
Change-Id: Ifa5169e7458b1b1ae4a068215072e9b83a74e117
2022-11-30 13:17:50 -08:00
Mohannad Farrag
aff60929e9 gn2bp: Add support for 'build/write_build_date_header.py' script am: 9ab1793ea7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2320203

Change-Id: I483a983543b98dc2e58c2cf943363df7c073551f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 21:01:49 +00:00
Mohannad Farrag
e513b386e1 gn2bp: Add getSanitizer factory method am: 71353f9f93
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2320202

Change-Id: I29ed06c3c90e9f942d63d4ccbae77c6013f55e0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 21:01:47 +00:00
Mohannad Farrag
9226d8e0cb gn2bp: Change ActionSanitizer name am: 420c14eead
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2320201

Change-Id: I93ebaa91d81dcec5334640c15a87cb92df2cdb79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 21:01:45 +00:00
Patrick Rohr
77c4f5c602 gn2bp: rename _set_arg_positional_value for readability
We could argue about just getting rid of it altogether.

Test: none
Change-Id: I1cfe5657d0faeff044b4dcfefb568eb70e6b8813
2022-11-30 12:56:29 -08:00
Patrick Rohr
d7de3dd714 gn2bp: rename getSanitizer for consistency
Test: non
Change-Id: I7d090c46aa81c4a7e5e022dcf57c0b827e835c95
2022-11-30 12:53:26 -08:00
Mohannad Farrag
9ab1793ea7 gn2bp: Add support for 'build/write_build_date_header.py' script
Test: update_results.sh
Change-Id: I05447e5db63996cd75791d01166ad13c7d1833c0
2022-11-30 17:28:35 +00:00
Mohannad Farrag
71353f9f93 gn2bp: Add getSanitizer factory method
* This will return a sanitizer according to the script which the target uses.

Test: update_results.sh
Change-Id: I0b519ff39c3983c94a804766355b7051320d8961
2022-11-30 17:20:48 +00:00
Mohannad Farrag
420c14eead gn2bp: Change ActionSanitizer name
* Change the class name to Base which will allow other classes to extend from it.

Test: None
Change-Id: I96ad16765bdcae109970a863d8612f0966bbd955
2022-11-30 17:13:15 +00:00
Aaron Huang
859884a48f Make mMatchSubscriberIds as a NonNull variable
In current design, mMatchSubscriberIds can be null which has the
same meaning with empty set, and is not easy to maintain since it
need more checks for this variable when mSubscriberId is null.
Thus make mMatchSubscriberIds NonNull for the maintenance.

Bug: 238843364
Test: build, FrameworksNetTests
Change-Id: I6cfc529b5f4a39ded8598283ff968f2f4d1bc89f
2022-11-30 16:38:24 +00:00
Aaron Huang
a8a6da0db9 Remove unused methods from NetworkTemplate
NetworkTemplate.Builder was introduced in Android T and the callers
outside of Connectivity module should use this Builder to build a
template instead. Thus remove the buildTemplate* methods from
NetworkTemplate class. Also, deprecate the methods which are
annotated with @UnsupportedAppUsage and also use Builder to build
the template.

Bug: 238843364
Test: build, FrameworksNetTests
Change-Id: I3190325f6663e4771edf5c7a19bf5ecc7780bf12
2022-11-30 16:38:19 +00:00
Chidera Olibie
331ebc6d30 cronet: remove inner TestUrlRequestCallback class
Use the utility class

Test: atest CronetApiTest
Bug: 251012627
Change-Id: Id3a2bb2e0dc8cf52a357e56e256fb8e89df17cdb
2022-11-30 14:37:18 +00:00
Mohannad Farrag
bdfef05893 Merge changes I68f8d670,I122fd6bf,Iae1668a4,Ib31a0170,I56275f90, ... am: 8b98ae1dd6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2320982

Change-Id: I556a89fdf93ba16cf82b47cfcb5b941c50746e69
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 14:28:01 +00:00
Mohannad Farrag
8b98ae1dd6 Merge changes I68f8d670,I122fd6bf,Iae1668a4,Ib31a0170,I56275f90, ...
* changes:
  gn2bp: add helper function to rebase relative dirs
  gn2bp: add location tag helper
  gn2bp: ensure there are not multiple occurences of arg
  gn2bp: add write_buildflag_header support to ActionSanitizer
  gn2bp: move parameter sanitization to ActionSanitizer
  gn2bp: add basic outline of ActionSanitizer with helpers
2022-11-30 14:03:30 +00:00
Motomu Utsumi
f8d94488d2 gn2bp: Set the output name for libcronet.so am: ee47af6e0c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2319961

Change-Id: I0a6b81cbbfdea112180607828cc54f460712ed87
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 13:55:00 +00:00
Motomu Utsumi
06d1924a09 gn2bp: Set apex_available and min_sdk_version am: 8ca1241589
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2319960

Change-Id: I92513a18902665c9ddae3f4be8e2c47e776959d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 13:54:57 +00:00
Motomu Utsumi
ee47af6e0c gn2bp: Set the output name for libcronet.so
.so file name needs to match with CronetLibraryLoader.java
(e.g. libcronet.109.0.5386.0.so)

Test: m, atest CtsCronetTestCases
Change-Id: I82285c32e82fc27ba5233e1bef7195ec57c35bea
2022-11-30 16:41:15 +09:00
Motomu Utsumi
8ca1241589 gn2bp: Set apex_available and min_sdk_version
This is required to add cronet_aml_components_cronet_android_cronet to
the tethering apex

Test: ./update_results.sh
Change-Id: I88460c74da344f62e3de1916714d91d963cf0cb9
2022-11-30 16:27:30 +09:00
Patrick Rohr
3227689a59 gn2bp: add helper function to rebase relative dirs
Test: none
Change-Id: I68f8d670e90c70520355c62ae1b868ce0567156a
2022-11-29 22:42:29 -08:00
Patrick Rohr
73ef7ae8ab gn2bp: add location tag helper
This is a very common operation.

Test: none
Change-Id: I122fd6bfa4b7fcabc012c8e69050c241083dd8a1
2022-11-29 22:42:29 -08:00
Patrick Rohr
3a2c3ddc42 gn2bp: ensure there are not multiple occurences of arg
As we do not deal with this yet...

Test: none
Change-Id: Iae1668a4cf7441d06265c6146b8a3819df6b299c
2022-11-29 22:42:28 -08:00
Patrick Rohr
48fa74d1e4 gn2bp: add write_buildflag_header support to ActionSanitizer
Test: none
Change-Id: Ib31a0170f18e419cde2a8c4462caafff3d688292
2022-11-29 22:42:28 -08:00
Patrick Rohr
9e414b59fb gn2bp: move parameter sanitization to ActionSanitizer
Test: none
Change-Id: I56275f902186266bfbbeb839f40bedad1206f938
2022-11-29 22:42:28 -08:00
Patrick Rohr
f6de33f21f gn2bp: add basic outline of ActionSanitizer with helpers
The goal is to make create_action_module more readable and easier to
work with. ActionSanitizer provides some basic helper functions that
should make the implementation of script-specific hacks a lot more
readable.

Test: none
Change-Id: I07772e336fb1d3879f6b50df1ea720e2a98cef72
2022-11-29 22:42:25 -08:00
Patrick Rohr
7ba2f6dd8c Merge "gn2bp: Refactor and code clean up" am: efbd7cc67f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2318771

Change-Id: I873988c4ee5abe11b713988e2c9e3ea13971f133
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 05:35:00 +00:00
Patrick Rohr
efbd7cc67f Merge "gn2bp: Refactor and code clean up" 2022-11-30 05:03:26 +00:00
Patrick Rohr
0a569b3fbe Merge "TestNetworkInterface: improve documentation of newly added methods" am: c856f0e543
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2308361

Change-Id: I2f5c985ab3109989adb4f67ac5cd86128f38ba13
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 03:56:27 +00:00
Patrick Rohr
c856f0e543 Merge "TestNetworkInterface: improve documentation of newly added methods" 2022-11-30 03:31:10 +00:00
Chidera Olibie
05859c12ee cronet: Add expectation to TestUrlRequestCallback am: bf274dbb1d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2320150

Change-Id: I1634a658f8197b34a5954ada9e2cdaf9d9ef9e77
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 19:19:31 +00:00
Chidera Olibie
bf274dbb1d cronet: Add expectation to TestUrlRequestCallback
This should simplify the test code

Test: None for test util class
Bug: 251012627
Change-Id: I6240b57485093cc4580bdfcdc77568410bd95e4c
2022-11-29 18:31:17 +00:00
Mohannad Farrag
f2391cc1e7 gn2bp: Refactor and code clean up
Test: m cronet_aml_components_cronet_android_cronet
Change-Id: I20b9d12c0a66555914760a766995629399c76a1c
2022-11-29 17:18:41 +00:00
Chidera Olibie
9200405c9a Merge "cronet: add TestUrlRequestCallback util" am: 65735f130b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2318821

Change-Id: I8bcc7339cb005ae0a3727139367fbb8cc649eeed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 16:38:56 +00:00
Chidera Olibie
65735f130b Merge "cronet: add TestUrlRequestCallback util" 2022-11-29 15:58:11 +00:00
Chidera Olibie
23d61fe699 cronet: add TestUrlRequestCallback util
This is a copy of the TestUrlRequestCallback class
in the chromium codebase with semantic changes:
https://source.chromium.org/chromium/chromium/src/+/main:components/cronet/android/test/javatests/src/org/chromium/net/TestUrlRequestCallback.java

Test: to be added in follow-up cl
Change-Id: If5210662ab13aa97df00216c478fc9790d9b6bb4
2022-11-29 11:40:03 +00:00
Remi NGUYEN VAN
683a519fa3 Merge "Add MdnsPacketRepeater" am: 97c5d09e10
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2297297

Change-Id: I5c32bb9b588f1216f48a4f3a63128cfc3f63b5f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 08:07:09 +00:00
Remi NGUYEN VAN
97c5d09e10 Merge "Add MdnsPacketRepeater" 2022-11-29 07:51:22 +00:00