Commit Graph

2772 Commits

Author SHA1 Message Date
junyulai
41c85f50c4 [FUI22] Support getAllNetworkStateSnapshot
Currently, ConnectivityService has getAllNetworkState but it is
not ideal to expose as system API since the plan is to get rid
of NetworkState. Thus, create a new one that returns
NetworkStateSnapshot to fulfill the needs.

Note the original getAllNetworkState cannot be deleted now since
it has @UnsupportedAppUsage annotation.

Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: Icddd434552b0e9ecbc8299e7242ec88cf3145aca
2021-03-04 18:41:09 +08:00
Paul Hu
1984fb1cb0 Merge "Replace ConnectivityManager hidden symbols on framework" 2021-03-04 03:07:08 +00:00
Xin Li
d60cc74f32 Merge "Merge RQ2A.210305.007" 2021-03-03 21:41:39 +00:00
Yan Yan
90b5d871e1 Merge "Use VERSION_CODES.S instead of VERSION_CODES.R + 1" 2021-03-03 18:04:52 +00:00
junyulai
f72320776d [FUI18] Expose notifyNetworkStatus as system API
Test: m -j doc-comment-check-docs
Bug: 174123988
Merged-In: I11d4c9ab24de87fb2ad120e3787b78b73133e874
Change-Id: I11d4c9ab24de87fb2ad120e3787b78b73133e874
  (cherry-picked from ag/13749978)
2021-03-03 20:01:46 +08:00
Yan Yan
ecc13abaa0 Merge "Support new IpSecAlgorithm AUTH_AES_CMAC" am: d3a444609a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1579251

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic9cc8508fb44e10371bc76bb31f20340f8663b18
2021-03-02 21:08:15 +00:00
Treehugger Robot
2f5b7f8155 Merge "[FUI09] Expose NetworkStateSnapshot as system API" am: c061f0053e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536708

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8eb6681328ad1f4a85bcc8c6c4b9446c23616b7a
2021-03-02 20:52:02 +00:00
Treehugger Robot
8e8f318c1f Merge "[FUI17] Migrate NetworkStatsService to use NetworkStateSnapshot" am: 1ad27ef2a1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556553

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2b19538843007e38e170163120f38477e4b76be8
2021-03-02 20:47:52 +00:00
Remi NGUYEN VAN
8819459e4a Merge "Move UidRange to connectivity" am: 5a81037576
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612295

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I672615b0804b9a9de4befa1ba5aea2efb9c962df
2021-03-02 20:24:20 +00:00
Yan Yan
d3a444609a Merge "Support new IpSecAlgorithm AUTH_AES_CMAC" 2021-03-02 18:24:27 +00:00
Treehugger Robot
c061f0053e Merge "[FUI09] Expose NetworkStateSnapshot as system API" 2021-03-02 16:08:03 +00:00
junyulai
7c17de401b [FUI09] Expose NetworkStateSnapshot as system API
This is needed by NetworkStatsService and
NetworkPolicyManagerService to utilize the snapshots of
information of networks that grabbed from ConnectivityService.

Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I7e974ef7b23ba9ba6ee775eed9899b0c0e2eca55
2021-03-02 23:09:16 +08:00
Treehugger Robot
1ad27ef2a1 Merge "[FUI17] Migrate NetworkStatsService to use NetworkStateSnapshot" 2021-03-02 13:21:32 +00:00
junyulai
125631330d [FUI17] Migrate NetworkStatsService to use NetworkStateSnapshot
This change migrates NetworkStatsService and related code to use
NetworkStateSnapshot which is used for replacing the NetworkState.

This patch also changes some formating which is suggested by
the linter.

Test: FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I547da8f411cb45bdadc376ac3cadf3f3c55bb282
2021-03-02 20:08:53 +08:00
Remi NGUYEN VAN
1bc09ccb14 Move UidRange to connectivity
UidRange is a data class that is an implementation detail of
Connectivity. Move it to the connectivity boundary.

Remaining usages of UidRange outside of Connectivity (in VPN) should be
migrated to other classes, like Range<Integer> or UidRangeParcel.

Bug: 181512874
Test: m
Change-Id: I6f2e3685ad1c07171dd90480d1e546329de8732d
2021-03-02 15:35:36 +09:00
Junyu Lai
0cd3ebb43d Merge "[FUI08] Create NeworkStateSnapshot" am: 18f51bd23d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536328

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If6f0e981228ef886496f55626b499f9c487af320
2021-02-26 11:30:53 +00:00
Junyu Lai
18f51bd23d Merge "[FUI08] Create NeworkStateSnapshot" 2021-02-26 10:53:36 +00:00
junyulai
8f1eb24a94 [FUI08] Create NeworkStateSnapshot
Since NetworkState has UnsupportedAppUsage APIs that cannot
be changed, create another class for follow-up patches
to expose as system API.

Test: NetworkStateSnapshotTest
Bug: 174123988
Change-Id: I54ef872847f34166aa34a79f6178c90ac12b6c72
2021-02-26 11:57:06 +08:00
paulhu
da479fa1a4 Replace ConnectivityManager hidden symbols on framework
Connectivity is becoming a mainline module in S, so
ConnectivityManager hidden symbols can not be used for outside
components. Besides, most Tethering relevant methods or variables
on CM are migrated to TetheringManager. So replace all these
methods or variables from ConnectivityManager to TetheringManager
on Telephony on framework.

Bug: 180693313
Test: atest FrameworksNetTests
Change-Id: I14e032ad6f278a36e8756aa7045d73a403f8f059
2021-02-26 11:19:41 +08:00
Chris Weir
16e2ef942a Merge "Add support for tracking PANS data usage" am: dbedad0dd5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1578684

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If14211a988289a217c9eabb3cd43bc41959de346
2021-02-25 21:50:22 +00:00
Chris Weir
dbedad0dd5 Merge "Add support for tracking PANS data usage" 2021-02-25 21:37:42 +00:00
Yan Yan
272ee7c909 Use VERSION_CODES.S instead of VERSION_CODES.R + 1
Bug: 170424293
Test: IpSecAlgorithmTest
Change-Id: I4662b0d43c476b744536a41000d578e8b69286ef
2021-02-25 10:40:24 -08:00
Yan Yan
f72b01527f Support new IpSecAlgorithm AUTH_AES_CMAC
Bug: 161716062
Test: IpSecAlgorithmTest, verified with CTS
Change-Id: Ideaf4225bd851fad8c8072505c6ad99d85ba616e
2021-02-25 10:35:10 -08:00
Lucas Lin
d1f4d2881f Merge changes I852e3a53,I86755647,I0ed8b0c6 am: 1e70c22af9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553736

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0428b441b34d48157a28dfc0463976be135146f4
2021-02-23 22:27:15 +00:00
Lucas Lin
1e70c22af9 Merge changes I852e3a53,I86755647,I0ed8b0c6
* changes:
  Remove unused INetworkManagementService from IpSecService
  Use NetdUtils instead of NetworkManagementService in Vpn
  Use NetdUtils instead of NetworkManagementService in IpSecService
2021-02-22 06:49:39 +00:00
Xin Li
e9a1554fea Merge ab/7061308 into stage.
Bug: 180401296
Merged-In: I4bf82035631ccff6d5a6144d6d9b1d203b076851
Change-Id: I1b5f3a672a55eaabba0f5389bab110b395553559
2021-02-21 09:39:53 -08:00
Remi NGUYEN VAN
634c81f7e8 Merge "Split parcelable .aidl files to aidl-export" am: 09bbad130d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1589694

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I35bcfe8b6861b1fbf7eb7c7f43dafe84ec364634
2021-02-19 03:46:20 +00:00
Chris Weir
f8f291cb7b Add support for tracking PANS data usage
Adds support for tracking oemManagedNetwork types (OEM_PAID and
OEM_PRIVATE).

Bug: 174485293
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
NetworkStatsObserversTest NetworkStatsServiceTest NetworkIdentityTest
Test: verify that the bytes go up in PansTest app only when
`ping -I eth2 8.8.8.8` is run as root.

Change-Id: I78660a835f16265ba8e44bb84332c6633dd72b84
2021-02-17 20:32:53 -08:00
Remi NGUYEN VAN
037a730efd Split parcelable .aidl files to aidl-export
The one-line "parcelable X" files need to be imported by targets that do
not build against SDK (the SDK has prebuilt definitions), so prepare a
dedicated directory for them.
This avoids having users of the classes include the whole src/
directory, which could contain definitions for classes that are not part
of the public API, so should not be imported.

Also move back to frameworks/base/core some .aidl definitions that
were separated from their associated class.

Bug: 171540887
Test: m
Merged-In: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
Change-Id: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
2021-02-18 01:17:04 +00:00
Yan Yan
488687d11f Merge changes Ifc8ad902,I6d1b8d0e am: 8d659bb1ec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1453730

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I12bd81925142b20a04448952de67cb72d77b4ccd
2021-02-12 21:41:59 +00:00
Yan Yan
441e35f612 [API] Expose IpSecTunnelInterface#setUnderlyingNetwork
This API is required to perform MOBIKE. This API allows an IPsec
peer to change the underlying network of its established IPsec
tunnel without re-establishing the tunnel.

Bug: 169855650
Test: atest IpSecManagerTunnelTest (new tests added)
Change-Id: Ifc8ad902cbfbe4ad07e715f2fef0faa1bf9d68f3
2021-02-10 14:52:18 -08:00
Yan Yan
a2f3b49f10 Update underlying network of IpSecTunnelInterface
Bug: 169855650
Test: atest IpSecManagerTunnelTest
Change-Id: I6d1b8d0e49f89c67ddc2caf4ba63fb0b1eb062c0
2021-02-10 14:51:43 -08:00
Junyu Lai
ecb34129dc Merge changes from topic "removeNI" am: 5e1ec81e2f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536707

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia7c6e3bf8f10b98fc2c4d83d41e65c64737753f0
2021-02-09 04:26:28 +00:00
Junyu Lai
5e1ec81e2f Merge changes from topic "removeNI"
* changes:
  [FUI07] Stop making NetworkState with NetworkInfo from external callers
  [FUI06] Stop using NetworkInfo in NetworkState from external callers
2021-02-09 03:37:59 +00:00
junyulai
64b1cfb7db [FUI06] Stop using NetworkInfo in NetworkState from external callers
This is achieved by:
  1. Use legacy network type inside NetworkState to replace the
     needs of referencing NetworkInfo.getType().
  2. Let getAllNetworkState only return networks with isConnected()
     equals true. This allows callers such as NPMS or NSS does not
     have to reference to NetworkInfo.isConnected().

Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I1c4eb08d18ca973eb8f41d06258872eabc0006b8
2021-02-08 21:40:49 +08:00
lucaslin
d66e608a5d Remove unused INetworkManagementService from IpSecService
IpSecService is no longer using any methods of
INetworkManagementService, so remove it from IpSecService
and related files.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I852e3a534e0ffd26b4b22420754f3ec8a6f153ad
2021-02-08 08:05:00 +00:00
lucaslin
ff6fe7ba53 Use NetdUtils instead of NetworkManagementService in IpSecService
NetdUtils has the same method(e.g. setInterfaceUp) as
NetworkManagementService so using the one inside NetdUtils instead
and try to remove NetworkManagementService from IpSecService in
the following commit.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I0ed8b0c678b067a655b51b938b6b40eadd985321
2021-02-08 16:01:56 +08:00
Treehugger Robot
e20d178f56 Merge "Add @Nullable to Object#equals()" am: 577fd4a912
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1574815

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I523eb00d30bfedeb6e7533a94868016171846a59
2021-02-05 10:01:23 +00:00
Roman Kalukiewicz
61a6c947ff Add @Nullable to Object#equals()
This is a partial cherry-pick of change:
I5eedb571c9d78862115dfdc5dae1cf2a35343580

for connectivity classes.

Bug: 170883422
Test: m
Merged-In: I5eedb571c9d78862115dfdc5dae1cf2a35343580
Change-Id: I7dc661863b73f4198ddb4f3a1566583d0f07db3c
2021-02-05 07:28:44 +00:00
Junyu Lai
21f732e67c Merge "[FUI21] Move scrubSubscriberId to utils class" am: f6c7f61d27
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1565195

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7afe5684997a5c47bcee269d2310fc61715ec13a
2021-02-03 09:36:38 +00:00
Junyu Lai
3a36e9affb Merge "[FUI20] Expose UnderlyingNetworkInfo as system Api" am: 75b50a5c73
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1563496

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icbc3c9f8e1ac8064e2e006587b4d4870d74cee2d
2021-02-03 03:03:01 +00:00
junyulai
b17ea56d30 [FUI21] Move scrubSubscriberId to utils class
This patch also removes the functionality of returning
original subscriberId in eng build since it is not really useful.

Test: atest NetworkIdentityUtilsTest
Bug: 174123988
Change-Id: I721457e571aa9403a2200b3e4261b4895e4f7a3e
2021-02-02 23:45:54 +08:00
junyulai
005f79c2d7 [FUI20] Expose UnderlyingNetworkInfo as system Api
Test: atest android.net.UnderlyingNetworkInfoTest
Bug: 174123988
Change-Id: Id602fbe744669f472d27fb466d00dcc601bd8f17
2021-02-02 23:12:10 +08:00
Lorenzo Colitti
99c7e943ca Merge "Revert "Expose IPsec tunnel APIs from @SystemApi to public APIs"" am: 32141be3dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1564979

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I147a86d5252f29a88d3a0fdb5c27d4c101791e7c
2021-02-01 16:04:06 +00:00
Lorenzo Colitti
32141be3dd Merge "Revert "Expose IPsec tunnel APIs from @SystemApi to public APIs"" 2021-02-01 15:33:11 +00:00
Lorenzo Colitti
388f41621f Revert "Expose IPsec tunnel APIs from @SystemApi to public APIs"
This reverts commit 160aac3fa0.

Reason for revert: not necessary, since VCN already has access to system APIs

Bug: 174606949
Test: revert with no conflicts
Change-Id: Ife2d0fc08c540265d52cdf930d0b6df005990ac8
2021-02-01 08:13:32 +00:00
Remi NGUYEN VAN
811b4c6ffc Merge "Move module sources to packages/Connectivity" am: 3d70ab73eb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552656

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I42989abf6e81a4c0e7bed6b0890a1ee4f2c30191
2021-02-01 06:09:33 +00:00
Remi NGUYEN VAN
b71fc45e17 Move module sources to packages/Connectivity
Files that are planned to be part of the connectivity module are grouped
in packages/Connectivity, so they can be built separately and moved in
one operation with their history into packages/modules/Connectivity.

This places the files in the existing framework-connectivity-sources
filegroup instead of the current framework-core-sources filegroup. Both
are used the same way in framework-non-updatable-sources.

Bug: 171540887
Test: m
Change-Id: I62d9d91574ace6f5c4624035d190260c3126b91e
2021-02-01 11:52:14 +09:00
Junyu Lai
a109d80a47 Merge "[FUI04] Refactor VpnInfo" am: 561626b20d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1537211

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I59054bfe1761e28cdfb8e8e6d67e4aabda399adc
2021-01-29 22:55:54 +00:00
junyulai
0592b920cb [FUI04] Refactor VpnInfo
As a preparation of exposing system API. This patch does some
harmless refactoring, which includes:
  1. Change raw arrays into lists according to API guidelines.
  2. Write test.
  3. Rename class to UnderlyingNetworkInfo.
  4. Rename vpnIface to iface.
  5. Make underlyingIfaces @NonNull in order to adapt new
     unparceling code.
  6. implement equals and hashCode for testing.

Test: atest android.net.UnderlyingNetworkInfoTest
Bug: 174123988

Change-Id: I405c21e57c4af8a12a9dd0a1749b9e6690f87045
2021-01-29 17:44:32 +08:00