Commit Graph

8646 Commits

Author SHA1 Message Date
TreeHugger Robot
2be798f0e5 Merge "Add a test to check unusual home activities" into rvc-dev am: 71c1cb3e18
Change-Id: Ib1f7f87839870919cac8a136996b25e9e017f18b
2020-05-15 17:39:40 +00:00
TreeHugger Robot
71c1cb3e18 Merge "Add a test to check unusual home activities" into rvc-dev 2020-05-15 17:28:24 +00:00
TreeHugger Robot
417f6f8053 Merge "Make sure uibench test app load list content" into rvc-dev am: 54dd86ac12
Change-Id: I23300aa022c70fcd9c9899890464225be40c08da
2020-05-15 16:05:36 +00:00
Isaac Chen
c8607a3a5b Add a test to check unusual home activities
Framework's SystemUserHome and Shell's NullHome activities have no real
Home function and should only be used in bootable CSI products. They
should not exist or be enabled on normal products.

This test can help to find if they exist in the system without needing
to find them via Settings manually.

Bug: 149307007
Bug: 149780604
Bug: 154723738
Test: # On aosp_crosshatch with Shell's NullHome activity
      $ atest NullHomeTest
      ...
      arm64-v8a NullHomeTest
      ----------------------
      com.android.test.nullhome (1 Test)
      [1/1] com.android.test.nullhome.NullHomeTest#checkNullHome: FAILED (127ms)
      # On aosp_crosshatch without Shell's NullHome activity
      $ atest NullHomeTest
      ...
      arm64-v8a NullHomeTest
      ----------------------
      com.android.test.nullhome (1 Test)
      [1/1] com.android.test.nullhome.NullHomeTest#checkNullHome: PASSED (2ms)
Change-Id: I6f190ae33fc9e724adc0e53d07107e9a1ae0291f
2020-05-15 18:42:05 +08:00
Treehugger Robot
bb72b5360d Merge "Address nit from aosp/1301317" am: f0edf03f5b am: b1f5f8d5fe
Change-Id: I7ae9b80954309b18eb6923da3aeaab3d1b8e3231
2020-05-15 07:14:29 +00:00
TreeHugger Robot
54dd86ac12 Merge "Make sure uibench test app load list content" into rvc-dev 2020-05-15 06:51:26 +00:00
Treehugger Robot
f0edf03f5b Merge "Address nit from aosp/1301317" 2020-05-15 06:43:42 +00:00
Benedict Wong
d84c77544b Merge "Add methods for IKEv2/IPsec test mode profiles" am: f44b90fdc4 am: 8b0b9d8a26
Change-Id: I353d999ebcdd108a900abfe20be232e83147b6d2
2020-05-15 02:51:43 +00:00
Benedict Wong
f44b90fdc4 Merge "Add methods for IKEv2/IPsec test mode profiles" 2020-05-15 02:18:02 +00:00
Cody Kesting
3fdb1831a4 Merge "Set owner and administrator UIDs for test networks." into rvc-dev 2020-05-14 18:56:16 +00:00
Riddle Hsu
3b0ceec95b Make sure uibench test app load list content
If the test app is relaunched by configuration change (e.g. the
testing device is put in landscape), the fragment will be kept
but its content needs to reload. Otherwise it will show a loading
animation that causes unexpected frame count.

This change makes ShadowGridActivity, ClippedListActivity,
MainActivity inherit CompatListActivity that sets new list adapter
to the existing fragment. So the list can show correct content.

Bug: 156473870
Test: atest UiBenchJankTests
Change-Id: Ie608baa7362642554c014f805c797d09f4cf3117
2020-05-14 20:44:19 +08:00
Remi NGUYEN VAN
f20a14a0d3 Use the new NetworkStackConnector constructor
The constructor was changed to allow for unit tests.

Bug: 137328719
Test: atest FrameworksNetIntegrationTests
Original-Change: https://android-review.googlesource.com/1295360
Merged-In: I46f247268310e12d420531745a22e93cf3550e89
Change-Id: I46f247268310e12d420531745a22e93cf3550e89
2020-05-13 09:18:52 +00:00
Benedict Wong
63d2bfd257 Add methods for IKEv2/IPsec test mode profiles
This change adds the ability for IKEv2/IPsec VPN profiles to run on Test
Networks. If enabled, the IKEv2/IPsec VPN profiles will request ONLY
test networks.

Bug: 148582947
Test: FrameworksNetTests passing
Test: Added for testing
Change-Id: I2511b39b27a1e29ae97907cdb12728d13fb1628f
2020-05-12 22:55:55 -07:00
Cody Kesting
0d8d6acd5b Set owner and administrator UIDs for test networks.
This change sets the owner and administrator UIDs for test networks when
their initial values match the UID for the app creating the test
network. This ensures that apps registering test networks can only make
themselves owners / administrators of the network.

Bug: 153449964
Test: atest NetworkAgentTest
Change-Id: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
Merged-In: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
(cherry picked from commit 35782280a2)
2020-05-12 20:33:42 +00:00
TreeHugger Robot
0cd6d1cb70 Merge changes I37dd459d,I1959f308 into rvc-dev
* changes:
  Add tests for Tunnel, Transport mode application with released SPIs
  Use TransformRecord to get SPI instead of SpiRecord
2020-05-12 20:30:03 +00:00
Cody Kesting
b07eaa5015 Merge "Set owner and administrator UIDs for test networks." am: b54e6b4377 am: 9f62246445
Change-Id: I7af702ff5eafbd0f5bb2247e0debf975e51accd1
2020-05-12 17:26:44 +00:00
Cody Kesting
b54e6b4377 Merge "Set owner and administrator UIDs for test networks." 2020-05-12 16:52:07 +00:00
Charles Chen
8a1786f075 Merge "Add WindowMetricsHelper" into rvc-dev am: 5681f3e796
Change-Id: Ic4d54316e06b545d7a0467f412c89bd776ea7e89
2020-05-11 10:20:16 +00:00
Charles Chen
5681f3e796 Merge "Add WindowMetricsHelper" into rvc-dev 2020-05-11 10:17:37 +00:00
Chalard Jean
983f827366 Merge "Fix a bug where VPNs start out suspended on cellular" am: bd3a7f994d am: c84f5a0713
Change-Id: I368308ded731b221be7fae6ddf1723c587ae4d20
2020-05-11 04:59:35 +00:00
Chalard Jean
1f6f7241ec Address nit from aosp/1301317
Test: atest ConnectivityServiceTest#testVpnSetUnderlyingNetworks
Bug: 150570873
Change-Id: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
2020-05-11 13:25:16 +09:00
Chalard Jean
bd13c96a69 Fix a bug where VPNs start out suspended on cellular
As NetworkAgent is in a transition where all agents need
to include the NOT_SUSPENDED capability as part of their
migration to the system API, ConnectivityService adds it
forcefully to all agents that don't have the CELLULAR
transport. This doesn't include VPNs when VPNs have some
cellular network as their underlying network.

The best way to solve this is to make sure the VPN
capabilities reflect those of the underlying networks as
far as the NOT_SUSPENDED capability is concerned. This
is how they work for other similar capabilities.

This also happens to contain a drive-by fix for an issue
with a spurious capabilities callback is triggered when
a VPN connects and it has any underlying network (which
means almost always, because it will take the default
network if it doesn't declare any). Fixing this was
necessary to have a cogent test of this issue, but it
could be moved to another patch or it could stay unfixed
with some minor ajustment to the tests if judged too
dangerous to include in R at this point.

Test: New tests in this patch. Also manually tested with
      tcpdump as described in b/150570873.
Bug: 150570873
Change-Id: I3e4ff990c0d4825b21c7679be29a482a2d1324ec
2020-05-11 10:44:50 +09:00
Benedict Wong
e696390fee Add tests for Tunnel, Transport mode application with released SPIs
This change adds tests to validate that both transport and tunnel mode
transforms continue to work even after the SPI resource has been
released. Specifically, since SPI resources are effectively subsumed by
the creation of a Transform, the SPI resource is still "alive", but
removed from the user-tracking sparse arrays.

Bug: 142072071
Test: Added these new tests. Failing prior to aosp/1133555, passes with.
Change-Id: I37dd459d08b57b14f72f3b28ea80fa231b152f10
Merged-In: I37dd459d08b57b14f72f3b28ea80fa231b152f10
(cherry picked from commit 4d3f871a94)
2020-05-08 00:01:59 -07:00
Benedict Wong
963502faa3 Use TransformRecord to get SPI instead of SpiRecord
IpSecService.applyTunnelModeTransform() currently does not take an
SpiRecord instance, yet implicitly requires that the SpiRecord instance
is still alive based on the stored SpiRecord resourceId in
the TransformRecord's IpSecConfig.

This check is unnecessary, as the SpiRecord has been subsumed into the
TransformRecord, and the kernel resources are kept alive whether or
not the SpiRecord is still held by the user.

This allows users of the IpSecManager API to allocate short-lived SPIs
during the creation of an IpSecTransform, without having to keep track
of both of them (even though the SPI is no longer usable).

The TransformRecord.getSpiRecord() call is already used in
multiple other places in the same method.

Bug: 142072071
Test: New tests added, passing.
Change-Id: I1959f3080946267243564459ff4207647922566e
Merged-In: I1959f3080946267243564459ff4207647922566e
(cherry picked from commit 5258b1b82f)
2020-05-08 00:01:45 -07:00
Chalard Jean
8add478ef7 Merge "Fix a bug where a spurious capabilities callback is sent." am: 9ef70c4bd6 am: fd3eac2fdf
Change-Id: Ied089ed5ca553b206bdb3f7195f9e623aaabfa00
2020-05-08 01:33:13 +00:00
Chalard Jean
9ef70c4bd6 Merge "Fix a bug where a spurious capabilities callback is sent." 2020-05-08 00:49:33 +00:00
Chalard Jean
d584c263b3 Fix a bug where a spurious capabilities callback is sent.
When a VPN connects and it has any underlying network (which
means almost always, because it will take the default network
if it doesn't declare any), it has default capabilities and
will only take the capabilities of its underlying network
as part of an update happening after making the network
available but before the rematch can take place. This in turn
causes the capabilities callback sent as part of the rematch
to be spuriously sent.

Test: FrameworksNetTests. Also tested together with a
      followup that adds tests with drive-by coverage for this.
Bug: 150570873
Change-Id: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249
2020-05-07 12:07:03 +09:00
junyulai
c4fd5119f3 [SM10] Adopt helper class to monitor RAT type change per sub
Test: atest NetworkStatsServiceTest
Bug: 146415925
Change-Id: I45c3aa9046b316c8cd0943543d620a22e4afefd1
Merged-In: I45c3aa9046b316c8cd0943543d620a22e4afefd1
(cherry picked from commit 219faff07b)
2020-05-05 18:37:29 +08:00
Charles Chen
49f329ca66 Add WindowMetricsHelper
This metrics now is used for calculating the value reported by
Display#getSize. It could be extended to have more function later.

Also replace getCurrentMetrics usages to make them report
Display#getSize value.

Bug: 148904274
Test: atest WindowMetricsHelperTest

Change-Id: I182b6e63f7c28752eee22839cb9e69f073046c3f
2020-05-04 11:41:13 +08:00
Remi NGUYEN VAN
a1ac7c860f Merge "Use the new NetworkStackConnector constructor" am: 97c8cc81a1 am: af63d539c9
Change-Id: I6bf23b1716706aaa757170ec3a60062ff4fcb1e0
2020-05-01 04:47:17 +00:00
Remi NGUYEN VAN
97c8cc81a1 Merge "Use the new NetworkStackConnector constructor" 2020-05-01 04:19:29 +00:00
Rambo Wang
2b79933004 Merge "Restrict match conditions of TelephonyNetworkSpecifier#canBeSatisfied" into rvc-dev am: 767b58716b
Change-Id: I84be6ef46eb2e99749a86f24304555bff51ebfe6
2020-04-30 22:40:29 +00:00
Rambo Wang
767b58716b Merge "Restrict match conditions of TelephonyNetworkSpecifier#canBeSatisfied" into rvc-dev 2020-04-30 22:23:13 +00:00
Benedict Wong
449bd6fe45 Merge "Add filtering for IPsec algorithms in IKEv2 VPNs" into rvc-dev 2020-04-30 17:29:29 +00:00
Rambo Wang
e4acbd16d6 Merge "Rename satisfiedBy to canBeSatisfiedBy for MatchAllNetworkSpecifier" am: b86d989fce am: 9544c8a20b
Change-Id: I80164890061f1f3ba6900e6f5e73e3bc6fc04b5c
2020-04-30 15:31:31 +00:00
Rambo Wang
b86d989fce Merge "Rename satisfiedBy to canBeSatisfiedBy for MatchAllNetworkSpecifier" 2020-04-30 15:07:18 +00:00
Rambo Wang
6fc5438dfd Rename satisfiedBy to canBeSatisfiedBy for MatchAllNetworkSpecifier
MatchAllNetworkSpecifier is a subclass of NetworkSpecifer. The method
satisfiedBy should be renamed to canBeSatisfiedBy together with other
subclass of NetworkSpecifer in b/152238712.

Add annotation @Overide for the method to make sure it will not get
ignored when refactor in the future.

Bug: 154956584
Test: atest android.net.MatchAllNetworkSpecifierTest
Change-Id: Ibe32fd50fae43aa635c1c0dad66eaea82011c8b7
2020-04-30 15:06:35 +00:00
Benedict Wong
4fab295446 Add filtering for IPsec algorithms in IKEv2 VPNs
This commit adds support for validating and filtering IPsec algorithms.
Without a public API exposing IKEv2 algorithms (and their respective
public APIs), the allowedAlgorithms can only filter the proposals for
IPsec (Child) SA algorithms.

Additionally, this removes the HMAC_SHA1 from the IKE SA's integrity
algorithm proposals due to insecurity

Bug: 153701879
Test: FrameworksNetTests passing, new tests added
Change-Id: I7e61a1612692db275b751330af5bacbf86836a8c
Merged-In: I7e61a1612692db275b751330af5bacbf86836a8c
(cherry picked from commit 94e1c08a9a)
2020-04-29 23:05:35 -07:00
Remi NGUYEN VAN
675ec9d30e Merge "Address comments on NetworkStack AIDL v6" into rvc-dev 2020-04-30 06:02:32 +00:00
Chiachang Wang
0acb2fa70f Filter debug entries for each vpn
NetworkStats calculation needs to filter out debug entries to
prevent over counting. While NetworkStatsFactory migrates data
usage over a VPN to the TUN network, NetworkStatsFactory does
not filter out debug entries per vpn which will cause debug
entries left and cause exception.

Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
      and verify no exception
Change-Id: I3525edc385b07858b48c7add2d331c4b5a2e84ad
Merged-In: I3525edc385b07858b48c7add2d331c4b5a2e84ad
2020-04-30 02:39:15 +00:00
Chiachang Wang
4501650524 Add test prefix into test cases
Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
Change-Id: I6e18915e383ac20072cb238d0136d7a8e4ceb811
Merged-In: I6e18915e383ac20072cb238d0136d7a8e4ceb811
2020-04-30 02:38:18 +00:00
Chavi Weingarten
6eae26b96f Merge "Remove getLeash from WindowContainerToken" into rvc-dev am: 5a4a5682a2
Change-Id: If2e767cc167267de8f2297194419e297cba53621
2020-04-30 00:18:00 +00:00
Chavi Weingarten
7491c0f8c1 Merge "Re-parent children when Organized Window is no longer controlled" into rvc-dev am: 69722e1b03
Change-Id: I7a3ab00c5f0fd000509d6931b4c0e1ecef3c22bc
2020-04-29 20:51:14 +00:00
chaviw
7de50009a3 Remove getLeash from WindowContainerToken
If the WindowContainer was revoked from a registered organizer, the
client could still call getLeash to system server and control the leash
for the WindowContainer. Instead, pass the leash back to the client in
onTaskAppeared and onDisplayAreaAppeared. Once the WindowContainer is
revoked from the client, the leash will reference the old
WindowContainer SurfaceControl and will not be able to control the
WindowContainer anymore.

Test: Split screen
Test: DisplayAreaOrganizerTest
Test: WindowOrganizerTest
Bug: 154558563
Change-Id: I1f6eb987a2a3fecfef912a3009ee52989c85ff4b
2020-04-29 09:36:35 -07:00
chaviw
da7b3c286b Re-parent children when Organized Window is no longer controlled
When an Organized Window is no longer controlled by a specific client,
we create a new SurfaceControl and reparent the children so the client
no longer has control over the WindowContainer

Test: Pip, TaskOrganizerMultiWindowTest
Bug: 154558563
Change-Id: I76e0da115fd48f982a82bd6e2351e7171934acfc
2020-04-29 09:36:34 -07:00
Chiachang Wang
5e0437f1e2 Merge changes I3525edc3,I6e18915e am: c861b10841 am: 31f2f386ce
Change-Id: I85b8798fc82873d22c338937bb61092fbde259e6
2020-04-29 09:24:10 +00:00
Chiachang Wang
c861b10841 Merge changes I3525edc3,I6e18915e
* changes:
  Filter debug entries for each vpn
  Add test prefix into test cases
2020-04-29 08:43:02 +00:00
Chiachang Wang
34bbc85569 Filter debug entries for each vpn
NetworkStats calculation needs to filter out debug entries to
prevent over counting. While NetworkStatsFactory migrates data
usage over a VPN to the TUN network, NetworkStatsFactory does
not filter out debug entries per vpn which will cause debug
entries left and cause exception.

Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
      and verify no exception
Change-Id: I3525edc385b07858b48c7add2d331c4b5a2e84ad
2020-04-29 15:07:45 +08:00
Chiachang Wang
8563394015 Add test prefix into test cases
Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
Change-Id: I6e18915e383ac20072cb238d0136d7a8e4ceb811
2020-04-29 13:44:50 +08:00
Benedict Wong
bc03521467 Merge "Add filtering for IPsec algorithms in IKEv2 VPNs" am: 7e2fe6eeee am: 331c924374
Change-Id: I7ef93d318b795754eea3511caf7c3ae9187a88b2
2020-04-28 18:17:10 +00:00