Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Merge "Create service-connectivity.jar"
Aaron Huang   authored and   Gerrit Code Review   commited 2020-10-20 06:09:41 +00:00
a2d7ef0a8a
Create service-connectivity.jar
Create a new target service-connectivity to split
ConnectivityService from services.core.

Add ConnectivityServiceInitializer for initializing
ConnectivityService and add systemReady() in
ConnectivityManager so that SystemServer can call systemReady()
through ConnectivityManager which won't change current behavior.

Bug: 158268939
Test: make target-java, make host-java
      atest FrameworksNetIntegrationTests
      atest FrameworksNetTests
      make, device can boot,
      atest CtsStrictJavaPackagesTestCases
      wifi and mobile data work.
Change-Id: I99401772ba9c1c34adca20040da3c7c72d86ddd9
Merged-In: Ie732bfaf381404af0bb599ca2f421a96e7aa4257

Aaron Huang   commited 2020-10-16 22:46:14 +08:00
9601189364
Remove unused methods from LinkProperties.
LinkProperties.compare{Dnses,ValidatedPrivateDnses,AllRoutes,
AllInterfaceNames} actually have no users.

Test: LinkPropertiesTest
Change-Id: Ic54ab3c5520fbbc2be1309aeaf1e5a7857dbd194

Chalard Jean   commited 2020-10-16 15:32:19 +09:00
4d6c93d315
Fix a typo in a comment
Test: is not necessary for fixing typos in comments
Change-Id: Idf48d2649e728cafda5c1ca32d21102094cf23f5

Chalard Jean   commited 2020-10-14 04:56:20 +00:00
c9fc48652a
Move IpUtils to frameworks/libs/net
The utility classes are useful for mainline modules and their tests, for
example IpClientIntegrationTest.

Bug: 168868607
Test: m && atest NetworkStaticLibTests
Change-Id: If2b1613aa18a7990391e2d31cc2951ca93f1cf3c

Remi NGUYEN VAN   commited 2020-10-05 14:38:19 +09:00
7f3a7512b5
Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I53003332717baf57dc088b2f6b969cdb1863f65e

Jeff Sharkey   commited 2020-09-14 09:59:01 -06:00
4610b32762
Merge RP1A.200720.011
Bug: 167588565
Merged-In: Iec7a26ecd68aca9c7a38cc8f441197a8237b0c8c
Change-Id: Ia8f5f008bc1f77115b644ab996aedc892fab68e7

Xin Li   commited 2020-09-02 12:34:37 -07:00
37db1eb217
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2

Xin Li   commited 2020-08-31 21:21:38 -07:00
4afc1e6669
Merge "Notify the keepalive is stopped after the slot has been released"
Junyu Lai   authored and   Gerrit Code Review   commited 2020-08-28 10:12:44 +00:00
c4aaac8af6
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

junyulai   commited 2020-08-20 11:00:08 +08:00
75125f2131
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

Chalard Jean   commited 2020-08-07 03:31:04 +00:00
059356d83f
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
(cherry picked from commit a40ff70cad00a6c298e07c2c38e95d58074a7157)

Lorenzo Colitti   authored and   android-build-team Robot   commited 2020-07-29 04:04:42 +00:00
1c9c0c1514
Merge "Gracefully handle integer overflows."
Junyu Lai   authored and   Gerrit Code Review   commited 2020-07-29 01:19:07 +00:00
cdb1f03144
Merge "Update language to comply with Android's inclusive language guidance"
Chiachang Wang   authored and   Gerrit Code Review   commited 2020-07-28 10:51:53 +00:00
f702025bdf
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

Chiachang Wang   commited 2020-07-28 15:36:30 +08:00
3b9549f408
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

Pavan Kumar M   commited 2020-07-28 11:36:49 +05:30
e55ab87e5d
Merge "Remove ProxyInfo(String) and update callers to use ProxyInfo(Uri)" am: c36f17d32e am: 5463bbece5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1146757

Change-Id: If60a348768c507153c1a9038953b2f6c29fc8f03

Aaron Huang   authored and   Automerger Merge Worker   commited 2020-07-17 06:05:38 +00:00
8f98e732a0
Merge "Remove ProxyInfo(String) and update callers to use ProxyInfo(Uri)"
Aaron Huang   authored and   Gerrit Code Review   commited 2020-07-17 05:40:31 +00:00
c36f17d32e
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

Chalard Jean   commited 2020-07-08 09:38:37 +00:00
9aa3127449
Merge "Add some more public doc for MacAddress" am: a9c0a7e2e2 am: 3b3c6ffdc2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354447

Change-Id: I5c9061fa832c75c9e0476c54bacec3deb114a96d

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-07-08 05:38:59 +00:00
074d5a8e8a
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

Aaron Huang   commited 2020-07-06 11:59:27 +00:00
ffb76492e0
Add some more public doc for MacAddress
Bug: 140807677
Test: doc-only change
Change-Id: I0f6e59eda42fd92ec34db0e9bc2d26d2e83d41d0

Chalard Jean   commited 2020-07-04 09:01:58 +09:00
ded38fda42
Revert "Move Inet[4]AddressUtils to libs/net"
This reverts commit c98e38195d.

Reason for revert: Breaks the build b/160390899

Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b
Change-Id: Ie10e66f61393602f17fbb61bf17230b176bf1f44

Chalard Jean   authored and   Remi NGUYEN VAN   commited 2020-07-02 23:47:35 +00:00
064d18d188
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

Remi NGUYEN VAN   commited 2020-07-02 10:52:31 +09:00
c98e38195d
Merge "Disable sockets and DNS if process lacks INTERNET permission."
Luke Huang   authored and   Gerrit Code Review   commited 2020-06-24 18:42:08 +00:00
9f5ade331a
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

Luke Huang   commited 2020-06-24 11:58:57 +00:00
caaee1d0ec
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

Luke Huang   commited 2020-06-24 11:32:26 +00:00
ff0dc5cf49
Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: 6e5b6b612d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11846903

Change-Id: Icd141a992c46290c74929785e261a1cd57bc001b

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2020-06-19 01:08:48 +00:00
7007e35032
Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2020-06-19 00:49:29 +00:00
6e5b6b612d
Merge "Move DnsPacket to libs net" into rvc-dev am: 81f0fe48d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: Ia19cb44ad56e4358c63564261d481459d1386542

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-06-18 10:34:11 +00:00
1ff1653dbb
Merge "Move DnsPacket to libs net" into rvc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2020-06-18 10:14:47 +00:00
81f0fe48d2
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

Luke Huang   commited 2020-06-18 16:17:04 +08:00
51221efa45
Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: I7c285a848ac947e0acf1acc8bc32f3ece3456412

Luke Huang   authored and   Automerger Merge Worker   commited 2020-06-18 03:23:46 +00:00
f12eff79db
Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev
Luke Huang   authored and   Android (Google) Code Review   commited 2020-06-18 03:03:06 +00:00
bbcd3b326b
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
Change-Id: If002280fbad493dfc2db3d9d505c0257d49a9056
Exempt-From-Owner-Approval: OWNERS already approved identical patchset 5

Luke Huang   commited 2020-06-18 03:02:06 +00:00
5a42a4132f
Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2020-06-17 15:26:22 +00:00
65efcc84a0
Treat RouteInfo with different interfaces as different routes
On Android different interfaces usually use different routing tables.
As a result, a change in interface should not be treated as route
update, but rather a remove and an add.

This change fixes a bug in VPN seamless handover where routes
failed to be updated when a new tunnel interface replaces the existing
one within the same network.

Bug: 158696878
Test: atest com.android.cts.net.HostsideVpnTests
Test: atest NetworkStackTests
Test: atest CtsNetTestCases
Test: atest FrameworksNetTests
Original-Change: https://android-review.googlesource.com/1331916
Merged-In: I57987233d42a0253eaee2e1ca5f28728c2354620
Change-Id: I57987233d42a0253eaee2e1ca5f28728c2354620

Treehugger Robot   authored and   Lorenzo Colitti   commited 2020-06-17 13:34:11 +00:00
58897cc491
Merge "Treat RouteInfo with different interfaces as different routes" am: d77e15c125 am: 157191f50f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331916

Change-Id: I2f4d88aa74588e8ed27c5d0abcb9a6919f26f27d

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-06-17 13:21:06 +00:00
7a49a3b538
Merge "Treat RouteInfo with different interfaces as different routes"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-06-17 12:51:08 +00:00
d77e15c125
Treat RouteInfo with different interfaces as different routes
On Android different interfaces usually use different routing tables.
As a result, a change in interface should not be treated as route
update, but rather a remove and an add.

This change fixes a bug in VPN seamless handover where routes
failed to be updated when a new tunnel interface replaces the existing
one within the same network.

Bug: 158696878
Test: atest com.android.cts.net.HostsideVpnTests
Test: atest NetworkStackTests
Test: atest CtsNetTestCases
Test: atest FrameworksNetTests
Change-Id: I57987233d42a0253eaee2e1ca5f28728c2354620

Rubin Xu   commited 2020-06-17 12:01:41 +01:00
bc4c5caa4f
Set correct owner UID for VPN agentConnect()
This commit changes agentConnect to set the owner UID as the mOwnerUid
field instead of the Binder.getCallingUid().

Binder.getCallingUid() can return incorrect results for platform VPNs,
as agentConnect() is called under a clean calling UID.

Additionally, this relaxes the ownerUid sanitization check to allow a
VPN network's owner to see it's own ownership information.

Vpn.mOwnerUid is guaranteed to be correct, as all VPNs MUST have called
prepareInternal() at some previous point, which sets mOwnerUid as the
package's UID (or SYSTEM_UID if this is legacy VPN).

Bug: 150135470
Test: CTS tests showing ownership information
Merged-In: Ic979dad73983d722365849fbfb0becfd432b894c
Change-Id: Ic979dad73983d722365849fbfb0becfd432b894c
(cherry picked from commit e29bf99a7fc1067c546d7fa6cbcb9001fb110d16)

Benedict Wong   commited 2020-06-16 01:42:48 +00:00
b001522433
Merge "Set correct owner UID for VPN agentConnect()" am: 2f7bb517fd am: bab1782868
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1326493

Change-Id: I5ff673d97fe4558da77575b2cc8c43b87e3673f6

Benedict Wong   authored and   Automerger Merge Worker   commited 2020-06-15 17:33:33 +00:00
d01a9458ed
Merge "Set correct owner UID for VPN agentConnect()"
Benedict Wong   authored and   Gerrit Code Review   commited 2020-06-15 17:09:46 +00:00
2f7bb517fd
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.

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

Remi NGUYEN VAN   commited 2020-06-12 17:04:06 +09:00
c3884937e1
Document the limitation to a hundred callbacks.
Some developers have been surprised by this limitation and had trouble
figuring out what the issue was. Add documentation to address this.

This also includes a drive-by removal of a duplicate check.

Bug: 149867479
Test: doc-only change
Original-Change: https://android-review.googlesource.com/1313813
Merged-In: I5911d01984695550b6c9afe7a8eb535bf5e320a1
Change-Id: I5911d01984695550b6c9afe7a8eb535bf5e320a1

Chalard Jean   commited 2020-06-12 00:35:39 +00:00
cece40543e
Cleanup config_mobile_hotspot_provision_app usage
config_mobile_hotspot_provision_app would be move out of framework and
only private for tethering only.
enforceTetherChangePermission is no longer needed because its only
caller PanService already gate by other privileged permission
(BLUETOOTH_PRIVILEGED).

Bug: 146918263
Test: m

Change-Id: I030871c2bc46bc09c4e52970b4995f98d31bb90e
Merged-In: I030871c2bc46bc09c4e52970b4995f98d31bb90e

markchien   authored and   Mark Chien   commited 2020-06-11 13:32:12 +00:00
f949ec251f
Merge "Document the limitation to a hundred callbacks." am: f60ed54d33 am: 363fb9fef9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1313813

Change-Id: I84b1e39503feddc914b61d4e8bd35953e92ac270

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-06-11 13:03:37 +00:00
1fa0eab021
Merge "Document the limitation to a hundred callbacks."
Chalard Jean   authored and   Gerrit Code Review   commited 2020-06-11 12:31:09 +00:00
f60ed54d33
Document the limitation to a hundred callbacks.
Some developers have been surprised by this limitation and had trouble
figuring out what the issue was. Add documentation to address this.

This also includes a drive-by removal of a duplicate check.

Bug: 149867479
Test: doc-only change
Change-Id: I5911d01984695550b6c9afe7a8eb535bf5e320a1

Chalard Jean   commited 2020-06-11 12:30:21 +00:00
a5ff113bff
Merge "Cleanup config_mobile_hotspot_provision_app usage" am: 443092b9a8 am: 921d8c0fb5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1329014

Change-Id: Ib3bb0129419ffd55df6c2c53cce3ad7e9155e854

Mark Chien   authored and   Automerger Merge Worker   commited 2020-06-11 08:03:56 +00:00
b4e92e60f1