Commit Graph

5569 Commits

Author SHA1 Message Date
Junyu Lai
e0f4a9bb6c Merge "Notify the keepalive is stopped after the slot has been released" am: 6d7c1854a8 am: b5e1feccbe am: 09ab7ad386 am: 4295a632b4 am: fcc06d418e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1112851

Change-Id: I86b9c01f99eaa9497acbd4e3e481c7330cf05667
2020-08-28 12:30:17 +00:00
Junyu Lai
09ab7ad386 Merge "Notify the keepalive is stopped after the slot has been released" am: 6d7c1854a8 am: b5e1feccbe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1112851

Change-Id: Icdd61fb39ebd14963f4ec6e591b3a245e6b999b2
2020-08-28 11:09:43 +00:00
Junyu Lai
6d7c1854a8 Merge "Notify the keepalive is stopped after the slot has been released" 2020-08-28 10:12:44 +00:00
Treehugger Robot
e30e470fab Merge changes I0faeda20,I726e74f5 am: 4cea2d3830 am: 363fe9d0b5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1397954

Change-Id: Ifa30f9611612523077a2b0c1c919e5035f5cd8e0
2020-08-20 04:06:51 +00:00
Treehugger Robot
4cea2d3830 Merge changes I0faeda20,I726e74f5
* changes:
  Add 5G NSA to collapsed RAT types list
  Add getAllCollapsedRatTypes to NetworkTemplate
2020-08-20 03:44:07 +00:00
junyulai
eed8c6bb26 Notify the keepalive is stopped after the slot has been released
Currently, the callbacks of stopping were fired when stop procedure
is started, because the upper layer apps only care about the reason
of stopping instead of stopping result. Thus, there is no need to
wait for the result comes back. However, this behavior generates
races if apps want to re-start keepalive immediately since the
resources are not released yet.

Fix: 134891441
Fix: 140305589
Test: atest com.android.server.ConnectivityServiceTest#testPacketKeepalives \
      --rerun-until-failure 1000

Change-Id: I987776a9211a50e964c4675b747bc10e203750f1
2020-08-20 11:00:08 +08:00
junyulai
bc3c15a6b2 Add 5G NSA to collapsed RAT types list
Currently, getAllCollapsedRatTypes is used to retrieve
all RAT types which will be recorded into NetworkStatsService.
However, there is a missing part that 5G NSA virtual RAT type
is not added into this list. This makes callers such as statsd
do not aware of 5G NSA RAT type and missed to collect data
usage of it.

Test: atest NetworkStatsSubscriptionsMonitorTest#test5g
Test: adb shell cmd stats pull-source 10082
Test: ./out/host/linux-x86/bin/statsd_testdrive 10082
Test: atest UidAtomTests#testMobileBytesTransfer \
      UidAtomTests#testMobileBytesTransferByFgBg \
      UidAtomTests#testDataUsageBytesTransfer
Bug: 163021464
Change-Id: I0faeda20f0506a48ac1131b234c5fc40d95dfbe0
Merged-In: I0faeda20f0506a48ac1131b234c5fc40d95dfbe0
(cherry-picked from ag/12355984)
2020-08-12 10:12:48 +00:00
junyulai
5cbd1a756d Add getAllCollapsedRatTypes to NetworkTemplate
This is a partial cherry-pick of ag/10293594

Test: TH
Bug: 129082217

Merged-In: I726e74f5c63a6ed456cb13ea259b58c7a33bec76
Change-Id: I726e74f5c63a6ed456cb13ea259b58c7a33bec76
2020-08-12 18:01:13 +08:00
junyulai
cd2ec0ea57 Add 5G NSA to collapsed RAT types list
Currently, getAllCollapsedRatTypes is used to retrieve
all RAT types which will be recorded into NetworkStatsService.
However, there is a missing part that 5G NSA virtual RAT type
is not added into this list. This makes callers such as statsd
do not aware of 5G NSA RAT type and missed to collect data
usage of it.

Test: atest NetworkStatsSubscriptionsMonitorTest#test5g
Test: adb shell cmd stats pull-source 10082
Test: ./out/host/linux-x86/bin/statsd_testdrive 10082
Test: atest UidAtomTests#testMobileBytesTransfer \
      UidAtomTests#testMobileBytesTransferByFgBg \
      UidAtomTests#testDataUsageBytesTransfer
Bug: 163021464
Change-Id: I0faeda20f0506a48ac1131b234c5fc40d95dfbe0
2020-08-12 05:20:54 +00:00
Chalard Jean
be00709344 Revert "Revert "Move Inet[4]AddressUtils to libs/net""
This patch is still needed and should go in now that the
error is fixed.
The patch was submitted into rvc-dev and is already in
rvc-dev-plus-aosp (patch in in ag/11923559, revert
skipped in ag/12072199). A follow-up will remove the
unused services.net-module-wifi target.

Test: originally tested in aosp/1324109
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Change-Id: I1074eedb0b0f156a1135e11210ec102de15ea674
Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b
2020-08-07 03:31:04 +00:00
Dan Zhang
fc155b1a93 Merge "Change the logic of getting ntp server" am: 7024d9205b am: bb601496d3 am: 19f12168d1 am: 4b188825f8 am: 0251d25fdd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1108155

Change-Id: I362e6d5bce64f60b2b1443e53a7a3566c5d747fc
2020-07-29 05:53:20 +00:00
Dan Zhang
19f12168d1 Merge "Change the logic of getting ntp server" am: 7024d9205b am: bb601496d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1108155

Change-Id: I77a3f9c3a1143934345c38bf982ae4507e06c238
2020-07-29 04:56:48 +00:00
Dan Zhang
7024d9205b Merge "Change the logic of getting ntp server" 2020-07-29 04:29:11 +00:00
Junyu Lai
62b56d26ef Merge "Gracefully handle integer overflows." am: a308f79353 am: aeddf47458 am: a2a1e552cf am: 85c6bdbbeb am: 076ffecd31
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1316217

Change-Id: I7c04b66f75f64c214bd0c8d27bb5dbeda13094ce
2020-07-29 02:58:33 +00:00
Junyu Lai
a2a1e552cf Merge "Gracefully handle integer overflows." am: a308f79353 am: aeddf47458
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1316217

Change-Id: I0bba17d0367ebf4e1c868a8cc7471366bc7a4408
2020-07-29 01:55:23 +00:00
Junyu Lai
a308f79353 Merge "Gracefully handle integer overflows." 2020-07-29 01:19:07 +00:00
Lorenzo Colitti
148ef8860d Set the NetworkInfo subtype to 0. am: a40ff70cad am: 4034ddfa74 am: e90c22ad7b am: b40e2d2048
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12246826

Change-Id: I829b9435343efbe04dcf50e26e86bee8b9276247
2020-07-28 19:03:24 +00:00
Lorenzo Colitti
e90c22ad7b Set the NetworkInfo subtype to 0. am: a40ff70cad am: 4034ddfa74
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12246826

Change-Id: I8a54c8fa4c51d74f6e8b1dc98dad71208f4e3836
2020-07-28 18:27:25 +00:00
Lorenzo Colitti
7d9a9213fb Set the NetworkInfo subtype to 0. am: a40ff70cad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12246826

Change-Id: Ida8cd0788ae34f4861fbcb958163b5074258c6ac
2020-07-28 18:05:15 +00:00
Chiachang Wang
bf875c99aa Merge "Update language to comply with Android's inclusive language guidance" am: 19c3b6dd6c am: 55c0d6e638 am: 41d7c54142 am: 7583a24fd3 am: c08f23849a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1373160

Change-Id: Ideecaaaa12e82c5771e75d0c743228f6478e1ca3
2020-07-28 12:03:04 +00:00
Chiachang Wang
41d7c54142 Merge "Update language to comply with Android's inclusive language guidance" am: 19c3b6dd6c am: 55c0d6e638
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1373160

Change-Id: I9318abb0233e7b8847466914724eeaae769ea9c8
2020-07-28 11:19:47 +00:00
Chiachang Wang
19c3b6dd6c Merge "Update language to comply with Android's inclusive language guidance" 2020-07-28 10:51:53 +00:00
Lorenzo Colitti
a40ff70cad Set the NetworkInfo subtype to 0.
For non-telephony networks, this was always set to 0 before R.
In R, it is currently set to the same value as the network type.
This is incorrect because the two have different namespaces.
or example, currently, any network of type WIFI (==1) will have
a subtype of NETWORK_TYPE_GPRS (==1). Similarly, all ETHERNET
networks will have subtype NETWORK_TYPE_1XRTT, all VPN networks
will have a subtype of NETWORK_TYPE_TD_SCDMA, etd.

Bug: 161653721
Test: builds, boots
Change-Id: I07e111c1762e0021c931cefc27f193f78578748b
2020-07-28 09:20:19 +00:00
Chiachang Wang
9da868b59a Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code
for reference.

Bug: 161896447
Test: m
Change-Id: I6c3c03c0c2d1302af6d5245486823c13a3432900
2020-07-28 15:36:30 +08:00
Pavan Kumar M
3708b68405 Gracefully handle integer overflows.
Avoid recording negative data by doing integer-based
math as much as possible, but switch to double-based
math if we detect that we'd end up causing an overflow.

Test :

    - Builds, Boots
    - High data throughput scenarios
    - NetworkStatsHistoryTest, NetworkStatsCollectionTest,
      NetworkStatsTest

Bug: 119527458
Change-Id: I55d4aa649bea3ae201ad513074ff2b71cb918dad
2020-07-28 11:36:49 +05:30
Xevi Miro Bruix
00260600ab Merge "Update language to comply with Android’s inclusive language guidance" am: c61b2279f0 am: 3c8639d035 am: 940fab9a0f am: 5b83be6103 am: f6a4e6796e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1371800

Change-Id: I8f67cd866c8732749dd07a6d6e40b3057642ac1c
2020-07-27 19:09:31 +00:00
Xevi Miro Bruix
940fab9a0f Merge "Update language to comply with Android’s inclusive language guidance" am: c61b2279f0 am: 3c8639d035
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1371800

Change-Id: I5e58e4f12230f48f4c0a28fd91cafd45d72fe662
2020-07-27 18:26:26 +00:00
Xevi Miro Bruix
2a362baf04 Update language to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

inclusivefixit

Bug: 161896447

Test: Change to documentation
Change-Id: I0fab8501af39dbe2acc70f1a32bb82cdc5e0b06e
2020-07-23 18:17:15 +00:00
Aaron Huang
d07f2fc343 Merge "Remove ProxyInfo(String) and update callers to use ProxyInfo(Uri)" am: d8b9f9fc07 am: 251d68487e am: ef48aef3ac am: 6350508edd am: 64bb3e63f7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1146757

Change-Id: I7965efe61d17ad96d1ff409b57c126e3c8f7fc78
2020-07-17 06:49:40 +00:00
Aaron Huang
ef48aef3ac Merge "Remove ProxyInfo(String) and update callers to use ProxyInfo(Uri)" am: d8b9f9fc07 am: 251d68487e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1146757

Change-Id: If60a348768c507153c1a9038953b2f6c29fc8f03
2020-07-17 06:05:38 +00:00
Aaron Huang
d8b9f9fc07 Merge "Remove ProxyInfo(String) and update callers to use ProxyInfo(Uri)" 2020-07-17 05:40:31 +00:00
Treehugger Robot
2c50b0efd7 Merge "Attribute data usage to virtual RAT type for 5G non-standalone mode" am: 88f47d4d32 am: 416911a122
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1364497

Change-Id: Idef0dd6e0e0486b76c0067540e580d444e97d6a0
2020-07-16 12:09:04 +00:00
junyulai
20b027ed2b Attribute data usage to virtual RAT type for 5G non-standalone mode
Test: atest NetworkStatsSubscriptionsMonitorTest#test5g
Bug: 160727498
Change-Id: I8753e68140c0993773017c9a49bd8a666a364071
Merged-In: I8753e68140c0993773017c9a49bd8a666a364071
(cherry-picked from ag/12167624)
2020-07-16 18:22:09 +08:00
junyulai
232afa51d9 Attribute data usage to virtual RAT type for 5G non-standalone mode
Test: atest NetworkStatsSubscriptionsMonitorTest#test5g
Bug: 160727498
Change-Id: I8753e68140c0993773017c9a49bd8a666a364071
Merged-In: I8753e68140c0993773017c9a49bd8a666a364071
(cherry-picked from ag/12167624)
2020-07-16 15:33:35 +08:00
junyulai
1b6ad1403b Attribute data usage to virtual RAT type for 5G non-standalone mode
Test: atest NetworkStatsSubscriptionsMonitorTest#test5g
Bug: 160727498
Change-Id: I8753e68140c0993773017c9a49bd8a666a364071
2020-07-16 15:32:01 +08:00
Chalard Jean
7af09d002d Add some more public doc for MacAddress
Bug: 140807677
Test: doc-only change
Original-Change: https://android-review.googlesource.com/1354447
Merged-In: I0f6e59eda42fd92ec34db0e9bc2d26d2e83d41d0
Change-Id: I0f6e59eda42fd92ec34db0e9bc2d26d2e83d41d0
2020-07-08 09:38:37 +00:00
Chalard Jean
36469bed89 Merge "Add some more public doc for MacAddress" am: 758d6bd8d0 am: 28d7770303 am: 3b04eba16b am: 526dc71822 am: 855b3be204
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354447

Change-Id: Id60a21828c8c711392b8f0b960920fd0b07df650
2020-07-08 06:09:49 +00:00
Chalard Jean
3b04eba16b Merge "Add some more public doc for MacAddress" am: 758d6bd8d0 am: 28d7770303
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354447

Change-Id: I5c9061fa832c75c9e0476c54bacec3deb114a96d
2020-07-08 05:38:59 +00:00
Chalard Jean
758d6bd8d0 Merge "Add some more public doc for MacAddress" 2020-07-08 05:15:20 +00:00
Aaron Huang
6cca3d719e Remove ProxyInfo(String) and update callers to use ProxyInfo(Uri)
Update all callers to use ProxyInfo(Uri) and remove ProxyInfo(String).

Bug: 160557668
Test: build pass
      atest FrameworksNetTests

Change-Id: I4c980764c8839c48acf03208bb68cd53eb910121
2020-07-06 11:59:27 +00:00
Chalard Jean
ab8bdc0b89 Add some more public doc for MacAddress
Bug: 140807677
Test: doc-only change
Change-Id: I0f6e59eda42fd92ec34db0e9bc2d26d2e83d41d0
2020-07-04 09:01:58 +09:00
Treehugger Robot
3e1ada0817 Merge "ITetheredInterfaceCallback is a oneway interface" am: d29edf9d83 am: 91a7404270 am: 51c383fe49 am: 774faa4955 am: 3d5030e138
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354662

Change-Id: I6a507b8c1fb4694bde8132c20a31a11f3a620163
2020-07-03 10:30:13 +00:00
Treehugger Robot
51c383fe49 Merge "ITetheredInterfaceCallback is a oneway interface" am: d29edf9d83 am: 91a7404270
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354662

Change-Id: Id0aae634967288a68cc80d0de79a42ab09c06a59
2020-07-03 09:43:09 +00:00
Treehugger Robot
d29edf9d83 Merge "ITetheredInterfaceCallback is a oneway interface" 2020-07-03 09:17:58 +00:00
Chalard Jean
a35580e0dd Revert "Move Inet[4]AddressUtils to libs/net"
This reverts commit 57d68e3c55.

Reason for revert: Breaks the build b/160390899

Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b
Change-Id: Ie10e66f61393602f17fbb61bf17230b176bf1f44
2020-07-02 23:47:35 +00:00
Robin Lee
d3bde87895 ITetheredInterfaceCallback is a oneway interface
This is sent from the system server, and the system server doesn't like
being blocked by apps.

Change-Id: I603be3038831974baf1dc392ff0d062e9db91b63
Test: atest CtsTetheringTest
Bug: 160389275
2020-07-02 17:59:28 +02:00
Remi NGUYEN VAN
57d68e3c55 Move Inet[4]AddressUtils to libs/net
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.

Also refine comments in DhcpResults following feedback in previous
change.

(cherry-pick from internal branch skipping wifi classes; no other
conflict)

Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Merged-In: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f

Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
2020-07-02 10:52:31 +09:00
Tobias Thierer
939ec99700 Merge "android.net.Uri: Move NOT_CACHED constant to holder class." 2020-06-26 09:33:23 +00:00
Tobias Thierer
8924b3cd20 android.net.Uri: Move NOT_CACHED constant to holder class.
Commit b639ce9e47 (May 2019) introduced a
reference from PathPart.<init> to Uri.NOT_CACHED. If this happened before
Uri.<clinit> had first run, this led to an inconsistently constructed
Uri.EMPTY since that instance's path is PathPart.EMPTY, which at that
point would still have been null.

This issue was found in an environment where Zygote initializations and
preloaded classes had not been run, and the unit test included in this
CL already passes before the CL. This suggests that Uri.<clinit> already
ran in the correct order in Android Q and that the bug was only
observable on other platforms that do not perform this initialization.
Nonetheless, to avoid a fragile dependence on a particular
initialization order, this CL fixes the issue such that calling
Uri.Builder.path() prior to Uri.<clinit> is now safe.

Specifically, this CL moves the NOT_CACHED instance into its own holder
class. This way, accessing NOT_CACHED no longer triggers Uri.<clinit>.
This also makes an earlier comment (from 2009) obsolete which warned
that NOT_CACHED must be initialized before Uri.EMPTY.

I've made the holder class and its field package private to avoid the
overhead of a synthetic accessor method.

Note: This CL was uploaded with --no-verify to avoid complaints about
pre-existing style issues (private non-static fields whose name does
not start with "m").

Bug: 159907422
Test: atest FrameworksCoreTests:android.net.UriTest
Test: Manually checked that a corresponding change fixed the issue
      in an environment not forked from a Zygote process where
      the issue was previously observable.

Change-Id: I067a6c108aa8befd056818a8231930693f55d8cf
2020-06-25 22:41:07 +01:00
Luke Huang
bea02c1460 Merge "Disable sockets and DNS if process lacks INTERNET permission." 2020-06-24 18:42:08 +00:00