Commit graph android_packages_modules_Co.../tests/net/java/com/android
Message SHA1
Implement INetworkMonitorCallbacks#notifyNetworkTestedWithExtras.
INetworkMonitorCallbacks defines notifyNetworkTestedWithExtras() for
notifying ConnectivityService of networks being tested along with a
PersistableBundle of extras. A new event is introduced for
NetworkStateTrackerHandler to notify the ConnectivityDiagnosticsHandler
before continuing with the normal processing for "network tested"
notifications. The event is also used in the
ConnectivityDiagnosticsHandler.

Bug: 143187964
Bug: 147391402
Test: compiles.
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: Iab29da790c0f5faae68227770bc3a84bbc94f124
(cherry picked from commit c5326407d592490783259a48a8ca653c4ff13122)

Cody Kesting   commited 2020-02-04 13:55:08 -08:00
c8e5bf6eff
Merge "Add separate user consent for Platform VPNs"
Benedict Wong   authored and   Android (Google) Code Review   commited 2020-02-04 21:04:01 +00:00
406c383aa1
Merge changes Icb062ffb,I66c4e8f5,I85247411,Id47c19b7,Ib713c4ae, ... am: 0b32981970 am: b4a492f581 am: 59c5f07871
Change-Id: I213d2cdca4187ed30293dc433cfee9e8af782b6e

Automerger Merge Worker   commited 2020-02-04 13:48:46 +00:00
365808dea8
[NS A36] Add a test for lost trusted capability
This bug will be drive-by fixed by the next refactoring, so
set up a test to see the difference.

Bug: 113554781
Test: this
Change-Id: Icb062ffbae904d1836a4a16fc5395687c3eda7b6

Chalard Jean   commited 2020-02-04 16:49:54 +09:00
b7ebc8a28f
Add separate user consent for Platform VPNs
This change adds a new VPN user consent flow (using the same text) for
granting the lesser OP_ACTIVATE_PLATFORM_VPN. A new
PlatformVpnConfirmDialog is created as a subclass to preserve all logic,
but ensure the right appop is granted for the relevant dialog.

Intent extras were considered, but are inherently unsafe, since the
caller may add any extras that they would want.

Bug: 144246835
Test: FrameworksNetTests passing
Change-Id: Ia6f36207d43c3748f938430c2780dcf29e5623f3

Benedict Wong   commited 2020-02-03 19:05:23 -08:00
5cb7ef9f08
Merge changes I446a8595,I68d2293f am: 3914abccce am: 3f8a000e5c am: dd8b4569b6
Change-Id: I99a531ab5ed8645d3eb3d15a3cd4ed6ef30c89ab

Automerger Merge Worker   commited 2020-02-03 22:53:15 +00:00
23976cad40
Merge changes I446a8595,I68d2293f
* changes:
  Add VpnManager calls to ConnectivityService
  Add basic logic for profile-based VPNs

Benedict Wong   authored and   Gerrit Code Review   commited 2020-02-03 22:31:37 +00:00
3914abccce
Merge "Add callback registration in ConnectivityService." am: 29edc0ecc9 am: 89a5e805f9 am: 7d4ebb11d6
Change-Id: I596d4788f6d35f1adf110d8edd390f5632b4dc06

Automerger Merge Worker   commited 2020-02-03 15:18:18 +00:00
e91b906438
Add callback registration in ConnectivityService.
ConnectivityDiagnosticsManager will send callbacks to
ConnectivityService for registering and unregistering them with the
system. ConnectivityService needs to do the processing for persisting
(and deleting) these callbacks on the ConnectivityService Thread, so
messages are sent to the Connectivity Diagnostics  Handler, which runs
on the ConnectivityService Thread.

Bug: 146444622
Bug: 143187964
Bug: 147848028
Test: compiles
Test: atest FrameworksNetTests
Change-Id: Ia5c8f90a60c050504e8676de9564a7607a9b03bc

Cody Kesting   commited 2020-01-31 09:42:05 -08:00
73708bff55
Merge "Add public fields to NetworkScore and make it @SystemApi"
Chalard Jean   authored and   Android (Google) Code Review   commited 2020-01-31 03:06:16 +00:00
9eece865c0
Add basic logic for profile-based VPNs
This change adds stubs for the Platform built-in VPNs, along with
implementing some basic permissions checks.

Bug: 144246837
Test: FrameworksNetTests passing, new tests added
Change-Id: I68d2293fc1468544f0d9f64d02ea7e1c80c8d18c

Benedict Wong   commited 2020-01-30 18:41:12 -08:00
df936cf1a7
Add public fields to NetworkScore and make it @SystemApi
Bug: 113554781
Bug: 146583853
Test: FrameworksNetTests
Change-Id: I19d965c0146196cb67b3417eb1790ccd90ce3233

Chalard Jean   commited 2020-01-30 18:45:52 +09:00
511f7e3792
Merge "Add API for apps to check if they are the network owner" am: 78433a68ee am: 3836f2f7cb am: 091626b927
Change-Id: Ibe4cc2bd1d588dcbccd83f53ee3da9d067ae85b6

Automerger Merge Worker   commited 2020-01-24 18:47:28 +00:00
ca9f47ace7
Add API for apps to check if they are the network owner
This CL extends NetworkCapabilities#mEstablishingVpnAppUid
to the network owner app UID and introduces a new public API
to get this owner app's UID.

Bug: 142072839
Test: atest FrameworksNetTests
Change-Id: Id83cdea62b89b586aff74e51e3fee60e53d37d4c

Qingxi Li   commited 2020-01-24 17:28:23 +00:00
bb8da980ae
Merge changes from topic "add-ikev2-vpn-types" am: adb79e3b39 am: 6e1557d8ca am: 53133f708e
Change-Id: I4ff406efcaada5a9306afc79290cb37bdeef71f2

Automerger Merge Worker   commited 2020-01-24 07:59:53 +00:00
11cb1537b4
Add additional fields to VpnProfile for profile-based IKEv2/IPsec VPNs
This commit adds the fields required to support IKEv2/IPsec VPNs. Other
fields will be reused where possible.

Bug: 143221465
Test: Compiles, new tests written for parcel/unparcel, encode/decode
Change-Id: I4c0e8fb934e75548424a15bbfb35c2ea9a3a57bc

Benedict Wong   commited 2020-01-22 19:23:00 -08:00
d439f790c3
Merge "Add API for CaptivePortalData" am: 1c42b174ed am: 12ad1433c1 am: f807f17797
Change-Id: I951f2eb2a0e2550f65ac87a84b76ea68c2449423

Automerger Merge Worker   commited 2020-01-22 16:27:53 +00:00
fe136ea5cf
Merge "Add API for CaptivePortalData"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-01-22 15:55:17 +00:00
1c42b174ed
Add API for CaptivePortalData
CaptivePortalData will be used to hold data advertised by the network
following RFC7710bis.

To fetch the CaptivePortalData, the API URL is added to LinkProperties,
to be provided by the NetworkAgent.

Because CaptivePortalData can be used to guess user location (especially
from the URLs provided by the portal), it is only exposed to
applications that have privileged permissions.

Test: atest FrameworksNetTests
Bug: 139269711
Change-Id: I341175b5fece8ee00e19898af5e8eabe66cefbf3

Remi NGUYEN VAN   commited 2020-01-22 22:27:44 +09:00
0a65eeda32
Add a Builder to NetworkAgentConfig, and make it SystemApi.
Currently, only support the three elements in the config that are
known to be used.

Bug: 138306002
Test: builds, boots
Test: atest FrameworksTelephonyTests
Change-Id: I1d231ec2ddcff97c039bcbc815a39c1d3e26c410
Merged-In: I1d231ec2ddcff97c039bcbc815a39c1d3e26c410

Lorenzo Colitti   authored and   Chiachang Wang   commited 2020-01-21 13:12:15 +00:00
8f304608c7
Rename NetworkMisc to NetworkAgentConfig.
NetworkMisc is not really an appropriate name for a system API.

Bug: 138306002
Test: builds, boots, wifi works, telephony works
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I621cfbe165996c67b201ca2dd2f95a5ab9af10ee
Merged-In: I621cfbe165996c67b201ca2dd2f95a5ab9af10ee

Lorenzo Colitti   authored and   Chiachang Wang   commited 2020-01-21 12:57:27 +00:00
ab2fed7241
Have registerNetworkAgent return a Network.
This is more useful.

Bug: 135998869
Test: FrameworkNetTests FrameworksWifiTests
Change-Id: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669
Merged-In: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669

Chalard Jean   authored and   Chiachang Wang   commited 2020-01-20 16:22:06 +08:00
f78c964538
Move NetworkAgent#register to a new method.
Calling IPC in a constructor is unusual and confusing, and can be
considered bad form. There are multiple reasons for this :
• Users can't obtain an instance of the class without calling the
  constructor, but they can't always afford an IPC where they need
  this, forcing them to know about the implementation detail and
  sometimes design around it.
• On a related but generalized note, constructors should usually
  be fast for the same range of reasons.
• Having a separate method to register the agent simply gives more
  flexibility to the app.
• It's also a lot easier to test.
But also we can't fix it without an update to the API, so here it is.

Another reason for doing this is consistency with the NetworkProvider
API.

Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I1ee5c7b1353d581e487c8a8a159009bebd781643

Chalard Jean   commited 2020-01-20 12:54:52 +09:00
01b6ba4053
Merge "Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer" am: b2ff467a3a am: b5d058e25d am: 0fee898931
Change-Id: I9aee20185e189e51d537b6b0895fdc31c31d0ea2

Automerger Merge Worker   commited 2020-01-15 18:39:33 +00:00
db2f8836de
Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer
StringNetworkSpecifier is widely used to specify subscription id for
the NetworkRequest. The raw string field introduce ambiguity and leave
large space for bugs. With TelephonyNetworkSpecifer, we are able to
settle down the type and value of the fields (although currently only
one) and introduce validation to detect the bug in the beginning.

Bug: 145993724
Test: atest FrameworksNetTests FrameworksTelephonyTests &
      make offline-sdk-docs
Change-Id: Iefbad9b1deb3de2c0b262d9ce5ae0704a50d08a6

Rambo Wang   commited 2020-01-14 10:51:11 -08:00
582ba554de
Merge "Have registerNetworkAgent return a Network."
Chalard Jean   authored and   Android (Google) Code Review   commited 2020-01-14 07:06:37 +00:00
1426060355
Merge "Add a Builder to NetworkAgentConfig, and make it SystemApi."
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2020-01-14 05:01:06 +00:00
640fa9a6ac
Have registerNetworkAgent return a Network.
This is more useful.

Bug: 135998869
Test: FrameworkNetTests FrameworksWifiTests
Change-Id: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669

Chalard Jean   commited 2020-01-14 13:59:55 +09:00
b0a42f7284
Add a Builder to NetworkAgentConfig, and make it SystemApi.
Currently, only support the three elements in the config that are
known to be used.

Bug: 138306002
Test: builds, boots
Test: atest FrameworksTelephonyTests
Change-Id: I1d231ec2ddcff97c039bcbc815a39c1d3e26c410

Lorenzo Colitti   commited 2020-01-14 11:43:53 +09:00
5b2e000f6d
[SP04] add unit test for NetworkStatsProvider am: 276921b6e1 am: 85f2dd96fc am: 7d46ce14c9
Change-Id: Ic48609b113a7174204eaa2207901c8110d76f65f

Automerger Merge Worker   commited 2020-01-13 14:48:10 +00:00
d34181656c
[SP04] add unit test for NetworkStatsProvider
am: 276921b6e1

Change-Id: Icd440ff9086604cb0baaa4cb3e8e458dcda3bb97

junyulai   authored and   android-build-merger   commited 2020-01-13 06:12:48 -08:00
85f2dd96fc
Merge changes from topic "sp04"
* changes:
  [SP05] add unit test for onStatsProviderLimitReached in NPMS
  [SP04] add unit test for NetworkStatsProvider
  [SP03] support registerNetworkStatsProvider API
  [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull

Junyu Lai   authored and   Gerrit Code Review   commited 2020-01-13 14:09:52 +00:00
429d86ae3c
[SP04] add unit test for NetworkStatsProvider
Test: atest NetworkStatsServiceTest
Bug: 130855321
Change-Id: I0c19d8bedcb9398da3f464efe01e775fde9f8a78

junyulai   commited 2020-01-13 14:43:06 +08:00
276921b6e1
Rename NetworkMisc to NetworkAgentConfig.
NetworkMisc is not really an appropriate name for a system API.

Bug: 138306002
Test: builds, boots, wifi works, telephony works
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I621cfbe165996c67b201ca2dd2f95a5ab9af10ee

Lorenzo Colitti   commited 2020-01-13 15:01:52 +09:00
8dd13a8109
Merge changes I7ea39b80,I6b9979f3 am: 310d1dac0d am: 3efc93af3d am: 243e5f21ea
Change-Id: I97bd2471b04d9a6291b03a989ccd618c2dc70c6e

Automerger Merge Worker   commited 2020-01-13 04:51:33 +00:00
8ae3471952
Stop using NetworkFactory in connectivity code.
Bug: 138306002
Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: I6b9979f343108c0c077abd86ae1c21e5ece0cccc

Lorenzo Colitti   commited 2020-01-12 17:40:02 +09:00
a86fae785a
Merge "[SP01] Add NetworkStats to system API" am: c494e23773 am: 02a936a9ad am: 2687f35f34
Change-Id: I1bb272727cbaec0102669b3f3b8141994f8e1f9a

Automerger Merge Worker   commited 2020-01-09 09:37:50 +00:00
d64d982de9
[SP01] Add NetworkStats to system API
In order to let external module report their network stats,
expose necessary APIs to construct NetworkStats object.

Test: atest FrameworksNetTests CtsUsageStatsTestCases
Test: m doc-comment-check-docs
Bug: 130855321
Change-Id: Id3ec8aaff3df67948c25eac2319a74cf33a27979

junyulai   authored and   Junyu Lai   commited 2020-01-09 03:11:22 +00:00
9b292c2c1f
[Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e

markchien   commited 2019-12-20 10:31:31 +08:00
be9b5e5eea
[Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
Merged-In: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e

markchien   commited 2019-12-19 20:53:06 +08:00
5776f96096
Merge changes Ie756b9aa,I38110f3a am: e38a525a05 am: 08c816b3f0
Change-Id: I884650a0a0fbf1a96f81ca927886eb2a563f4e28

Automerger Merge Worker   commited 2019-12-04 19:56:21 +00:00
515f11f5d8
Merge "Replace the permission of internal connectivity checks"
Paul Hu   authored and   Gerrit Code Review   commited 2019-12-04 05:59:59 +00:00
032c3c3e30
Merge "Replace the permission of internal connectivity checks"
Paul Hu   authored and   Android (Google) Code Review   commited 2019-12-04 05:52:01 +00:00
f9ed2de1dd
Replace the permission of internal connectivity checks
A number of connectivity checks that protect system-only methods
check for CONNECTIVITY_INTERNAL, but CONNECTIVITY_INTERNAL is a
signature|privileged permission. We should audit the permission
checks, and convert checks that protect code that should not be
called outside the system to a signature permission. So replace
all CONNECTIVITY_INTERNAL to other proper permissions.

Bug: 32963470
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Change-Id: I8f2dd1cd0609056494eaf612d39820e273ae093f

paulhu   commited 2019-12-04 11:45:51 +08:00
e031948c1a
Replace the permission of internal connectivity checks
A number of connectivity checks that protect system-only methods
check for CONNECTIVITY_INTERNAL, but CONNECTIVITY_INTERNAL is a
signature|privileged permission. We should audit the permission
checks, and convert checks that protect code that should not be
called outside the system to a signature permission. So replace
all CONNECTIVITY_INTERNAL to other proper permissions.

Bug: 32963470
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Change-Id: I8f2dd1cd0609056494eaf612d39820e273ae093f
Merged-In: I8f2dd1cd0609056494eaf612d39820e273ae093f

paulhu   commited 2019-12-04 11:44:45 +08:00
8e96a75543
Merge changes Ie756b9aa,I38110f3a
* changes:
  [NS A19] Inline updateCapabilities in rematch.
  [NS A18] Reverse listens and request-availables

Treehugger Robot   authored and   Gerrit Code Review   commited 2019-12-04 02:07:45 +00:00
e38a525a05
Merge "Disable a flaky test" am: 932dda858a am: c8ce461f68
Change-Id: Ia3596b558fb09600e7d9a16f0dce03d4402ee653

Automerger Merge Worker   commited 2019-12-03 16:51:32 +00:00
9029839020
Disable a flaky test
Bug: 145513323
Test: FrameworkNetTests
Change-Id: I66e02fdaab2969b77db4a0f0e6fb8b1a981d9350

Chalard Jean   commited 2019-12-03 16:13:22 +09:00
54ef9299c7
[NS A18] Reverse listens and request-availables
This is a long standing bug that happens to now be trivial
to fix, and also be beneficial for refactoring

Test: FrameworksNetTests NetworkStackTests
Change-Id: I38110f3a4a75936ea755788e7f9fee67863e14be

Chalard Jean   commited 2019-12-02 18:44:10 +09:00
9127f03a5c
Merge changes I0613c23f,Ibeab8d0a,I8bd668ad,I7d3a16be am: a1a975e149 am: 0d6211b065
am: fece8eceef

Change-Id: I4540ad08fbb1ccabf0a19f73bc36611194ef8bfa

Chalard Jean   authored and   android-build-merger   commited 2019-12-01 21:37:03 -08:00
a5b0d0bbab