Commit graph android_packages_modules_Co.../staticlibs/device/android/net
Message SHA1
Add null check for mProvider
mProvider is null before register is called.
But toString call mProvider.getProviderId() without null check
and caused NullPointerException.
This commit add null check and fix this issue.

Bug: 228796405
Test: m
Change-Id: Ic8e23b21d11705219f1a8fddd544941fbddb183e

Motomu Utsumi   commited 2022-04-27 11:25:11 +00:00
4caf337991
Replace clearAll with withoutDefaultCapabilities
Update the method to clearer naming as the feedback from API
review.

Bug: 184735772
Test: m
Change-Id: Id0b1df83926352969049a50b3f1af111a4ac603c
Ignore-AOSP-First: Parts of the topic are only available in internal

Chiachang Wang   commited 2021-05-14 08:49:57 +00:00
3468c1fc8b
Support both R and S+ in NetworkFactory
NetworkFactory needs to be backwards compatible as
it is statically linked by the Wifi module, which
needs to run on both R and S.

To achieve this, maintain 2 separate implementations
called NetworkFactoryImpl (S+) and
NetworkFactoryLegacyImpl (R). NetworkFactory itself
becomes a shim that delegates to one of these
implementations depending on the device's SDK version.

Ignore-AOSP-First: Merge in internal first to fix
                   S-on-R test breakages.
Bug: 183902758
Test: ClientModeImplTest
      OemWifiNetworkFactoryTest
      TelephonyNetworkFactoryTest
      UntrustedWifiNetworkFactoryTest
      WifiNetworkFactoryTest
Change-Id: I6a08f39ad1633dd7c1582c362c97821e24ce6683

Chalard Jean   authored and   David Su   commited 2021-05-03 23:09:41 -07:00
2522de86a3
[NS05] Implement NetworkScore in NetworkFactory
Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Change-Id: I6ec7b49bef74b030687c16bce14c2522431018ab

Chalard Jean   commited 2021-03-25 21:06:22 +09:00
d1fc0809d8
Remove unused methods
Ignore-AOSP-First: mainline-prod in the critical path
Test: FrameworksNetTests NetworkStackTests
Bug: 167544279
Change-Id: If1b23e27d8fb2b3b484466245268eb6787e58818

Chalard Jean   commited 2021-03-23 21:50:52 +09:00
59d2bf3ad2
Fix an embarrassing bug... again.
For the same reason as aosp/1549479, the old method
needs to call the new one. It's not enough that they have
the same implementation ; when NF calls the old one, it
needs to indeed call the overridden new version.

Test: TH
Change-Id: I5e8700fc7455317da382f2328e3f548b3392ca41

Chalard Jean   commited 2021-01-15 14:36:44 +09:00
312b5519a2
[NS01.5] Fix an embarrassing bug
The existing implementations override the function with the
int, so the default impl of the function with the int has
to call the new one, not the other way around. Otherwise,
when implementations are migrated to overriding the new one
the old code continues to call the function with the int
and that wouldn't work as expected if it didn't call the
newly overridden method.

Test: TH
Change-Id: Ic31cec6481781e0185a0ba150be52390597737e7

Chalard Jean   commited 2021-01-13 08:04:26 +00:00
5b76d8d7dc
[NS01] Add scoreless methods for non-score users
Test: FrameworksNetTests NetworkStackTests
Change-Id: I9ebd5cf17ec96b3e7c09ff041d65ee88d0b37cbf

Chalard Jean   commited 2021-01-12 16:31:12 +09:00
6f99e869ef
Merge "Move util classes to their destination package"
Chalard Jean   authored and   Gerrit Code Review   commited 2020-12-21 05:35:09 +00:00
1aadbb0afd
Move Struct.java to com.android.net.module.util package.
Bug: 163492391
Test: atest NetworkStaticLibTests
Change-Id: If7d54f0356ce4d6426011914df0a2e85784daebd

Xiao Ma   commited 2020-12-17 15:36:23 +00:00
ce033d4824
Move util classes to their destination package
Test: FrameworksWifiTests FrameworksNetTests
Change-Id: I93e9cfd968e08f983e3fd9f7196c455c79a0f32d
Merged-In: Id19c650246a8f3d55d7b6a874840a6eebcd9eb17

Chalard Jean   commited 2020-12-16 08:50:20 +09:00
ceaf7d0edc
Add new APIs writeToByteBuffer/writeToBytes for generic Struct class.
Split the original U64/UBE64 into two groups: U63/UBE63 which could be
represented by long primitive directly and U64/UBE64 which should be
represented by BigInteger class.

Also fix the endianness-related issue to support both of big-endian or
little-endian input ByteBuffer, and writeToBytes API outputs the bytes
array in appropriate order then.

Bug: 163492391
Test: atest android.net.util.StructTest --rerun-until-failure
Change-Id: Ie9c07fac6dcfceb8efdf1d6b56ce6ff1e845f477

Xiao Ma   commited 2020-12-07 17:35:03 +09:00
f4cb6d6789
Introduce cache schema for generic Struct class.
Bug: 163492391
Test: atest android.net.util.StructTest --rerun-until-failure
Change-Id: Idffad7d3b907d8853ed7d296808a2e0e2736cbbe

Xiao Ma   commited 2020-11-24 18:03:07 +09:00
a76690a3b7
Improve code style in Struct.java and add tests for Type.U64 represented
by long primitive.

Bug: 163492391
Test: atest android.net.util.StructTest --rerun-until-failure
Change-Id: I0120d7ab063d9d170e8b6e6a6077f8f86db93d67

Xiao Ma   commited 2020-10-13 06:59:51 +00:00
ea53144db0
Define a generic class to parse structured message.
Bug: 163492391
Test: atest android.net.util.StructTest --rerun-until-failure
Change-Id: I1848984d80998d87acccc52287a351d27708dedc

Xiao Ma   commited 2020-10-09 18:25:34 +09:00
6f95cefd38
Move utilities to libs/net
These files used to be in the network stack directory, but the libs
directory is a much more suitable place for them.

Also fix a typo : ConcurrentIntepreter → ConcurrentInterpreter

Also move {FdEvents,Packet}Reader to internal annotations. That's
what they should have been using in the first place anyway.

Note that this does not fix preupload issues reported by
checkstyle to make review easier. The fixes are in a followup
patch to this one.

Test: checkbuild
Change-Id: I675077fd42cbb092c0e6bd56571f2fc022e582fd

Chalard Jean   commited 2020-07-30 22:10:51 +09:00
48c6c7d838