Commit graph android_packages_modules_Co.../framework-t/src/android
Message SHA1
Merge "Fix NullPointerException happens in dumpCheckin"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-04-19 11:43:21 +00:00
6b7e457988
Merge "Fix NetworkTemplate generates non-metered carrier template"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-04-19 10:18:26 +00:00
481b2649f7
Fix NullPointerException happens in dumpCheckin
Currently dumpCheckin passes a null object to create
the contructor of NetworkStatsCollection.Key but the
constructor requires non-null object. Thus, it caused
the NPE in dumpCheckin. To fix this exception, create
an NetworkIdentitySet() object instead of using an
null object.

Bug: 225131008
Bug: 226539404
Test: dumpsys netstats --checkin is fine
      FrameworksNetTests
Change-Id: I7f2dadf0647b3f42e0f667d96291d2ae37e23faf

Aaron Huang   commited 2022-04-19 17:49:30 +08:00
c3a43b4063
Fix NetworkTemplate generates non-metered carrier template
From current design, NetworkPolicyManagerService should only
creates metered carrier/mobile templates. However, if someone
calls the hidden API interface or the template was created
before NetworkTemplate#Builder is published. The caller may
create a non-metered carrier template and persist into the
storage.

This CL elimates this possibility and mark non-metered carrier
template non-persistable, so devices could auto-recover from
this symptom after reboot.

Fix: 222382637
Test: TH
Change-Id: I5265e371b0126ce65c32fb09a6e04223afb3d286

Junyu Lai   commited 2022-04-18 16:41:54 +08:00
74f7c8c907
Make some NetworkStats APIs system-current
Move iterator and NetworkStats.Entry getters to system-current
according to API council feedback. This reverts parts of
ag/17117903.

Test: TH
Fix: 225168182
  (cherry-picked from ag/17397294)
Change-Id: Ia7fdf8d31a96a26b0bf1682f462292b051560477
Merged-In: Ia7fdf8d31a96a26b0bf1682f462292b051560477

junyulai   commited 2022-04-11 18:45:36 +08:00
0f54d64db2
[MS83.1] Make some APIs module-lib instead of system current
Some of the internal classes are not available for priv-apps.
Thus, make them module-lib instead.

This change also adds some nullability annotations for existing
APIs according to go/android-api-guidelines.

Test: m
Test: m frameworks-base-api-system-current-compat
Fix: 217479745
  (cherry-picked from ag/17117903)
Change-Id: I18de46b11df7232ab82b9465856fdde621283156
Merged-In: I18de46b11df7232ab82b9465856fdde621283156
Merged-In: Ief3f2304f11b7940a18b98b8533fbca85ffa4dc1

junyulai   commited 2022-04-11 18:44:20 +08:00
44e61e2140
Merge changes from topic "MDns_AIDL"
* changes:
  Use MDns aidl on NsdService
  Add MDnsManager

Paul Hu   authored and   Gerrit Code Review   commited 2022-04-07 02:06:35 +00:00
09475308b7
Use MDns aidl on NsdService
- Use MDns aidl to communicate with mdns service and register
  event listener to receive callback.
- Remove all NDC relevant code on NsdService.
- Use MDns aidl on NsdServiceTest.

Bug: 209894875
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I65929dee3838fef753396e86c665abd66b6fec81

paulhu   commited 2022-04-04 15:18:27 +00:00
2b9ed95ae5
Add MDnsManager
- Have MDnsManager to manage mdns native service binder call.
- Register it as a system service for NsdService.
- NsdService will use aidl to communicate with mdns, so add the
  relevant lib to framework-connectivity
- Add jarjar rule for mdns-aidl-interface classes.

Bug: 209894875
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: Ibc8b726c01a15015b450caf94d0afed570117b7f

paulhu   commited 2022-04-04 15:02:17 +00:00
541b72d03b
Address EthernetManager javadoc review comments
Test: TH
Change-Id: Iafa8979d8e96ea4d078b017e56ee61334d33b5f5

Patrick Rohr   commited 2022-04-04 14:59:42 +02:00
50c470e308
Update javadoc to match expectation for UnsupportedOperationException
Test: builds
Change-Id: I44eac15972ed099fc12599a78a71557a7b16d593

Patrick Rohr   commited 2022-04-04 14:59:42 +02:00
0f2cbe92f1
Merge "Add getInterfaceList module-lib API in EthernetManager."
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-24 06:15:43 +00:00
e38626a4a2
Merge "Fix ethernet enable / disable API"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-24 06:09:28 +00:00
95738f7c18
Add getInterfaceList module-lib API in EthernetManager.
Bug: 171872016
Test: m
Merged-In: Ib0e6c8f67c6ded7d17bb9e0ff49e7ff495c8819d
Change-Id: I94fd147d0f8cf09cb7445fd2b5bc8e4528e8390e

Xiao Ma   commited 2022-03-22 13:59:40 +00:00
1edd4554e5
Add setEthernetEnabled and its listener API
Bug: 171872016
Test: atest EthernetServiceTests

Merged-In: Iefd24d955572589c5bd3ca9a8139ea6e44979e8a
Change-Id: Iefd24d955572589c5bd3ca9a8139ea6e44979e8a

markchien   authored and   Xiao Ma   commited 2022-03-22 13:58:14 +00:00
5912ab6906
Merge "Fix proto invalid write type"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-03-22 12:18:39 +00:00
286f4e2c88
Fix ethernet enable / disable API
The ethernet APIs connectNetwork() / disconnectNetwork() are
inaccurately named. Physical link state cannot be changed by calling an
API. This change renames these functions to enableInterface and
disableInterface, respectively, to better reflect their intention and
behavior.

Test: atest EthernetManagerPermissionTest
Merged-In: I3361ad0e01e761ffd77faf6c55924fa4612ede90
Change-Id: I3361ad0e01e761ffd77faf6c55924fa4612ede90

Patrick Rohr   commited 2022-03-22 12:12:48 +00:00
3879cf1a78
Merge "Revert^2 "Change Ethernet API to use OutcomeReceiver""
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-22 10:00:08 +00:00
4e6570c359
Merge "Add Executors to NSD callbacks"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-03-22 08:33:48 +00:00
8d0fa1c2ad
Add Executors to NSD callbacks
Add Executor variants to all methods with callbacks.

Bug: 218752665
Test: atest NsdManagerTest
Change-Id: I4c31e2d7ae601ea808b1fd64df32d116c6fff97f

Remi NGUYEN VAN   commited 2022-03-18 09:26:11 +00:00
c7aa9e3c62
Revert^2 "Change Ethernet API to use OutcomeReceiver"
369c79bca4

Merged-In: I7c46545a47034be409071c2ec007d9e1480c6ed0
Change-Id: If9b055e0862755f1d33b5ba6e026fd827bc1d0ea

Patrick Rohr   authored and   markchien   commited 2022-03-18 12:06:27 +08:00
d6156a930e
Revert "Change Ethernet API to use OutcomeReceiver"
Revert "Change network management listener to outcome receiver"

Revert submission 2028203-ethernet-outcomereceiver

Reason for revert: BuildMonitor investigating b/225169800
Reverted Changes:
I4c204a848:Change Ethernet API to use OutcomeReceiver
I7c46545a4:Change Ethernet API to use OutcomeReceiver
Id8fadfed9:Change network management listener to outcome rece...

Change-Id: I45af594f7233ed89113f4cf7f977092271980672

Quentin Perret   commited 2022-03-17 15:20:53 +00:00
369c79bca4
Change Ethernet API to use OutcomeReceiver
This change addresses API review feedback. In addition, it changes the
returned result from Network to the interface name. The current API
returning a Network object is racy and cannot be implemented correctly.
Users should instead use the ConnectivityManager#requestNetwork() API to
get hold of the Network for a given interface.

Bug: 220017952
Test: TH
Change-Id: I7c46545a47034be409071c2ec007d9e1480c6ed0

Patrick Rohr   commited 2022-03-17 08:20:45 +01:00
cf01b8a4f7
Add Nullable IpConfiguration to ethernet update request
This is not currently used by anyone, but will allow us to only update
NetworkCapabilities in the future. This could be useful for testing.

Test: atest EthernetServiceTests
Bug: 220017952
Change-Id: I9697399bad2bfe66c6f328064be75f4dfa10af81

Patrick Rohr   commited 2022-03-16 20:28:45 +01:00
746d082279
Merge "Split out the ethernet API surface and use framework-connectivity-t"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-16 16:03:30 +00:00
112f3762bb
Merge "[DU04-2]Appropriate changes to the NetworkPolicyManager API"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-16 12:28:24 +00:00
62bfe3e882
[DU04-2]Appropriate changes to the NetworkPolicyManager API
Divide the NetworkPolicyManager API
notifyStatsProviderWarningOrLimitReached into the following two APIs:
1. notifyStatsProviderWarningReached()
2. notifyStatsProviderLimitReached()

Bug: 216474563
Test: atest NetworkStatsServiceTest NetworkPolicyManagerTest
            NetworkPolicyManagerServiceTest OffloadControllerTest
Change-Id: Ic413eb532b5e24d4a7e2afabdcf643ab6607b1ed

Frank   commited 2022-03-16 14:23:50 +08:00
b9bacae1fc
Merge "Rename setUidForeground to noteUidForeground"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-03-15 23:33:26 +00:00
2a4a56b004
Merge "Let docs tool to list the newly-visible IntDef values"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-03-15 03:55:41 +00:00
1b60475d2b
Split out the ethernet API surface and use framework-connectivity-t
Ethernet framework and service source code is going to be moved to
Connectivity mainline module, this CL contains below corresponding
changes to adapt the migration in f/b side:

1. Split out ethernet module-lib APIs to Connectivity module.
   Add the ethernet resource filegroup to tiramisu-updatable-sources
   filegroup as well, build them together. Also update the module-lib
   and system api txt to reflect the APIs change. Remove the hidden
   APIs which are moved to Connectivity module. This removal fixes the
   api inconsistent issue with Tethering/apex/hidden/.

2. Remove EthernetService from SystemServer which will be registered
   from ConnectivityServiceInitializer.

3. Replace the BackgroundThread class(imported from f/b/core/java)
   with the one in the modules-utils-backgroundthread lib, which is
   visible to Connectivity module.

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I3e13cb9c0e348333af295c2537d459aa6700ff17
Merged-In: I1956848d3248cc56e9841d221e5e4c160bed65a4

Xiao Ma   commited 2022-03-14 13:47:01 +00:00
dbc8e0fb2b
Merge "[DU09-2]Modify the NetworkStatsCollection Builder API"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-14 02:36:08 +00:00
96189e9851
Let docs tool to list the newly-visible IntDef values
Some *_ALL constants are exposed in T and they should be mentioned
in documentation. Because there are already defined InDef values
for this kind of constants. Thus, remove the list in the javadoc
and leave these up to the doc tool to list the InDef values.

Bug: 222291452
Test: m doc-comment-check-docs
Change-Id: Ibbaee5389a85bb3d696a518deea0897845553bfa

Aaron Huang   commited 2022-03-11 01:28:59 +08:00
0619e29450
Rename setUidForeground to noteUidForeground
This patch addresses API review about the naming of
NetworkStatsManager#setUidForeground and it would be
more appropriate to rename it to noteUidForeground.

Bug: 222291301
Test: atest FrameworksNetTests
Change-Id: I952762872850889609c9808aa6e3cdfc04317806

Aaron Huang   commited 2022-03-10 18:31:21 +08:00
cdc5fe2b2b
Merge "Remove restriction that limits updateConfiguration API to Auto"
Xiao Ma   authored and   Gerrit Code Review   commited 2022-03-10 03:40:54 +00:00
2560006257
Merge "Allowing for null net caps in updateConfiguration"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-09 09:16:29 +00:00
5ba470eded
Remove restriction that limits updateConfiguration API to Auto
Test: TH
Change-Id: Ibd1b6493778b98fc765e6eebdfe8f9c1fef29a73

Patrick Rohr   commited 2022-03-08 16:13:48 +00:00
d1dccf83fc
Allowing for null net caps in updateConfiguration
Marking NetworkCapabilities as nullable in updateConfiguration and
updating where needed to support this. This will allow callers of the
ethernet network management updateConfiguration API to use it primarily
for setting an ethernet network's IP configuration.

Bug: 222565654
Bug: 220017952
Bug: 210485380
Test: atest EthernetNetworkUpdateRequestTest

Change-Id: I1f80e950acbd078a6b3378e1fa5f1e4173112e79

James Mattis   authored and   Patrick Rohr   commited 2022-03-08 16:50:35 +01:00
6869c411fc
Fix proto invalid write type
While dumpProtoLocked is called, InvalidProtocolBufferException
occurred because types are mismatched between platform side and
module side.

netstats.proto was moved into connectivity module, both the
platform(incident.proto) and the module uses protoc-gen-javastream
to generate the Java classes from it. It should be fine since
platform includes the source of the proto, and jarjar the generated
classess in the module to avoid conflict with platform.

Bug: 218566849
Test: adb shell incident 3001
      adb shell dumpsys netstats --proto
      atest CtsIncidentHostTestCases:IncidentdTest#testIncidentReportDumpAuto
Change-Id: I4654350a59dc1ca1a925785ad37f34aa7b481235
Merged-In: I4654350a59dc1ca1a925785ad37f34aa7b481235

Aaron Huang   commited 2022-03-07 08:44:25 +00:00
cf97f22cdc
[DU09-2]Modify the NetworkStatsCollection Builder API
1. Adding the bucketDuration with unit as bucketDurationmillis
2. make the Key class be final
3. The Key set parameter be marked with an IntDef

Bug: 220153505
Test: atest NetworkStatsCollectionTest
Change-Id: Iab32b8fc129b77d6786c2f1f2339e515f2eb55f7

Frank   commited 2022-03-07 16:28:55 +08:00
1e0da21bfe
Merge "[MS68.3] Address comments at aosp/1958144"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-03 02:26:53 +00:00
ef6f50b007
Merge "[SUBID01-0]Grow NetworkIdentity to include a new mSubId field"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-02 12:26:11 +00:00
9de9a8b2de
[SUBID01-0]Grow NetworkIdentity to include a new mSubId field
In the previous design of NSS and NPMS, those only had IMSI to identify
the cell network. Now the telephony has created the "subId" handle,
which is the preferred mechanism for identifying subscribers.

This commit adds NetworkStats support for subscriberId as a part of
the network identity key

Bug: 80526261
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
            NetworkStatsServiceTest NetworkIdentityTest
            NetworkStatsDataMigrationUtilsTest

 (cherry-picked from ag/16825721)

Change-Id: Ie1fe81006555dbcca4b62457fa6c319f04b4576d
Merged-In: Ie1fe81006555dbcca4b62457fa6c319f04b4576d

lifr   authored and   Frank   commited 2022-03-02 11:20:09 +08:00
7c9fde88d6
[MS68.3] Address comments at aosp/1958144
Test: atest TrafficStatsTest NetworkUsageStatsTest FrameworksNetTests
Bug: 204830222

(cherry-picked from ag/16813003)

Change-Id: I5a54b44294021d64d8506eeb570db0db8544472a
Merged-In: I5a54b44294021d64d8506eeb570db0db8544472a

Frank   commited 2022-03-02 03:05:53 +08:00
e20ff88e34
[DU03-4]Add NETWORK_STACK Permission check for NetworkStatsService API
1. getUidStatsForTransport API

Bug: 210066922
Test: atest BatteryStatsImplTest WifiPowerCalculatorTest
            MobileRadioPowerCalculatorTest NetworkStatsServiceTest

(cherry-picked from ag/16816095)

Change-Id: I022c34b5af87fe3ff6857ea264bac2f7098eaed4
Merged-In: I022c34b5af87fe3ff6857ea264bac2f7098eaed4

Frank   commited 2022-03-02 02:30:51 +08:00
350414997d
Merge "Updating Eth Update Request to use Builder"
James Mattis   authored and   Gerrit Code Review   commited 2022-02-28 16:55:49 +00:00
fbb8986a58
Merge changes from topic "ms52-movenetstats"
* changes:
  Expose MATCH_PROXY as a module-lib API.
  Add setPollForce to module API
  Move networkstats JNI to connectivity module
  [MS54.1] Move NetworkStats to updatable sources
  [MS62.1] Start NetworkStatsService from the module

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-28 05:32:23 +00:00
46d003e258
Updating Eth Update Request to use Builder
Updating EthernetNetworkUpdateRequest to use a builder for
creation and also changing to use IpConfiguration instead of
StaticIpConfiguration.

Bug: 220017952
Bug: 210487893
Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I78b002c12cf927c075671b75f0fe0d7878443b56

James Mattis   commited 2022-02-24 13:38:04 -08:00
aa2202c220
Merge "Check iface by TextUtils.equals"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-02-22 09:48:08 +00:00
6b1e9e63cb
Expose MATCH_PROXY as a module-lib API.
It is used by clockwork.

Test: m update-api
  (cherry-picked from ag/16786203)
Change-Id: I5676f883141afca1511c425b7c36683a6c6bfb9f
Merged-In: I5676f883141afca1511c425b7c36683a6c6bfb9f

Lorenzo Colitti   authored and   junyulai   commited 2022-02-18 16:20:48 +08:00
8868c1ef52
Add setPollForce to module API
The API was test API in S, but this is not supported in module API
surfaces. Make it module API instead.

Bug: 197717846
Test: Tests already using this API
  (cherry-picked from ag/16780943)
Change-Id: I9d44b761572f94b08b269478c4a0c20c1171343c
Merged-In: I9d44b761572f94b08b269478c4a0c20c1171343c

Remi NGUYEN VAN   authored and   junyulai   commited 2022-02-18 16:20:47 +08:00
6dff4abc88