Commit Graph

5559 Commits

Author SHA1 Message Date
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
Luke Huang
3cd122f485 Disable sockets and DNS if process lacks INTERNET permission.
This is a Client-only solution.
  - Add to NetdClient a per-process std::atomic_boolean
    similar to netIdForProcess and netIdForResolv.
  - The boolean says whether the process should be
    allowed Internet connectivity.
  - Add an @hide method to NetUtils.java to set the boolean;
    call it from the initialization code of the new
    process just after forking from zygote.
  - Make netdClientSocket and dnsOpenProxy check the
    boolean. If the boolean is false, return EPERM from
    socket calls.

Bug: 150028556
Test: atest NetworkUtilsTest
Test: atest CtsAppSecurityHostTestCases:UseProcessTest
(cherry-pick from internal branch, ag/11881939)
Merged-In: If002280fbad493dfc2db3d9d505c0257d49a9056
Change-Id: If002280fbad493dfc2db3d9d505c0257d49a9056
2020-06-24 11:58:57 +00:00
Luke Huang
f08f9d4bd7 Move DnsPacket to libs net
This class might be used by some mainline modules.

Bug: 151052811
Test: atest DnsPacketTest
Test: atest DnsResolverTest
(clean cherry-pick from internal branch)
Merged-In: I8841d91456952ded5efbf8ea221289aecc7746ad
Change-Id: I8841d91456952ded5efbf8ea221289aecc7746ad
2020-06-24 11:32:26 +00:00
Remi NGUYEN VAN
c4cb0330aa Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: 6555756e90 am: deae676127 am: af0fe2e715 am: b232961fb8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11846903

Change-Id: I9791fe78ecbe5c91f00225c13db7f9ed9f5823d4
2020-06-19 01:57:56 +00:00
Remi NGUYEN VAN
deae676127 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: 6555756e90
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11846903

Change-Id: Icd141a992c46290c74929785e261a1cd57bc001b
2020-06-19 01:08:48 +00:00
Remi NGUYEN VAN
6555756e90 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev 2020-06-19 00:49:29 +00:00
Lorenzo Colitti
30370c23d4 Merge "Move DnsPacket to libs net" into rvc-dev am: db056d4043 am: 7f7e19eda5 am: a9095c04b9 am: ac253d354f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: Ida1e72cf4d56b175ba2121fd8ed06b3701aad770
2020-06-18 11:23:50 +00:00
Lorenzo Colitti
7f7e19eda5 Merge "Move DnsPacket to libs net" into rvc-dev am: db056d4043
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: Ia19cb44ad56e4358c63564261d481459d1386542
2020-06-18 10:34:11 +00:00
Lorenzo Colitti
db056d4043 Merge "Move DnsPacket to libs net" into rvc-dev 2020-06-18 10:14:47 +00:00
Luke Huang
c1a52b82c9 Move DnsPacket to libs net
This class might be used by some mainline modules.

Bug: 151052811
Test: atest DnsPacketTest
Test: atest DnsResolverTest
Change-Id: I8841d91456952ded5efbf8ea221289aecc7746ad
2020-06-18 16:17:04 +08:00
Luke Huang
7c117370e3 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: 7144459282 am: dae5d3f223 am: d996337c91 am: 4e4f6a89c3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: I945b061484a7a2da22043103b7102e16fceff930
2020-06-18 04:24:37 +00:00