8405 Commits

Author SHA1 Message Date
Junyu Lai
841583ae51 Merge changes I7eaca623,Ic94da540,If330e853,Ie2d229be,Ic6b2f10f into rvc-dev
* changes:
  [SM08] Add NetworkTemplate unit test for fetching mobile data usage
  [SM07] Make combine subtype configurable from Settings
  [SM05] Enable record mobile network stats by collapsed rat type
  [SM04] Support fetching data with NetworkTemplate with subType
  [SM02] Support record mobile network stats by collapsed rat type
2020-03-19 06:29:38 +00:00
Sudheer Shanka
c0fd5fa650 Delete a blob after the last lease of it is released.
Also, avoid deleting it if it was committed recently
to allow app that contributed it to acquire a lease.

Bug: 151378266
Test: atest --test-mapping apex/blobstore
Change-Id: I32f9bc0d0e9d74e7a07c279b5057f53ccb610673
2020-03-18 20:56:29 -07:00
Aaron Huang
8745384d71 API review: access field by method
- InvalidPacketException, public field should be a method so
  add getter to get error code.
- KeepalivePacketData, public fields should be methods so
   add getter for fields.

Bug: 151322799
Test: atest FrameworksNetTests
      atest FrameworksWifiTests
      atest FrameworksTelephonyTests: some failure in CarrierAppUtilsTest
Change-Id: Id01e6135193716cc21bba11da529bf1507a954f7
2020-03-19 11:38:24 +08:00
JW Wang
8cb6fe8c21 Override phenotype flags during tests
https://g3doc.corp.google.com/experiments/g3doc/mobile/phenotype/android/testing.md?cl=head#hermetic

Phenotype talks to a server to override the device config changes made
by the tests. Therefore, rollback expiration didn't happen as expected
and caused the test to fail.

We need to override the flags on our own during tests so the
device config values ('rollback_lifetime_in_millis' in this case)
won't be changed in an unexpected way.

Note this is the same fix as ag/10467568.

Bug: 151890602
Test: atest RollbackTest
Change-Id: Ie884e4807999d105f6224c46a39434e1f437ed1b
2020-03-19 11:12:36 +08:00
Lucas Lin
3d02325f96 Merge "Add version check to prevent test fail on Android Q" into rvc-dev 2020-03-19 03:09:46 +00:00
junyulai
20bff921b2 [SM08] Add NetworkTemplate unit test for fetching mobile data usage
Test: atest NetworkTemplateTest
Bug: 129082217

Change-Id: I7eaca623adf93f9b8d53c2e5857ecae90ea572ab
Merged-In: I7eaca623adf93f9b8d53c2e5857ecae90ea572ab
(cherry picked from commit 4670baace6c8dafe3a30330596c333d6b2389e4d)
2020-03-19 10:10:07 +08:00
junyulai
b56b6138bf [SM07] Make combine subtype configurable from Settings
Note that enabling/disabling would not take effect until device
reboot. This will be addressed in follow-up patch.

Test: 1. atest NetworkStatsServieTest SettingsBackupTest
      2. adb shell settings put global netstats_combine_subtype_enabled 1|0
Bug: 146415925

Change-Id: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
Merged-In: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
(cherry picked from commit c4f77ac90bf2e48a655ad19b162fe74a23bf3fb0 and
 fix merge conflict in SettingsBackupTest)
2020-03-19 10:10:07 +08:00
junyulai
3f4d4c1500 [SM05] Enable record mobile network stats by collapsed rat type
Switch on the recording in device side. Metrics will be
collected in follow-up patches which can be independently
enabled/disabled.

This change also fix the fail in NetworkStatsCollectionTest
which caused by enabling this feature, where the rounding
problem happened when records are distributed into smaller
buckets and categorized into more NetworkIdentity.

Test: atest FrameworksNetTests
Bug: 129082217
Change-Id: If330e85330a4ff713dd420c98d42fa741eabd90a
Merged-In: If330e85330a4ff713dd420c98d42fa741eabd90a
(cherry picked from commit 2d4fa2c0fae8c2d79a25093d9f732a33c2f91dd4)
2020-03-19 10:10:07 +08:00
Paul Hu
332dd2e195 Merge "Kill ConnectivityManager.CONNECTIVITY_ACTION_SUPL" am: 8ba389de1c am: 093c215b09
Change-Id: Icfbcfdcfc5070bf0b4a2c0ead9e5eff1de1d1877
2020-03-19 01:45:18 +00:00
junyulai
fe8eae5e9d [SM08] Add NetworkTemplate unit test for fetching mobile data usage
Test: atest NetworkTemplateTest
Bug: 129082217

Change-Id: I7eaca623adf93f9b8d53c2e5857ecae90ea572ab
Merged-In: I7eaca623adf93f9b8d53c2e5857ecae90ea572ab
(cherry picked from commit 4670baace6c8dafe3a30330596c333d6b2389e4d)
2020-03-19 01:41:53 +00:00
junyulai
1be2d732e0 [SM07] Make combine subtype configurable from Settings
Note that enabling/disabling would not take effect until device
reboot. This will be addressed in follow-up patch.

Test: 1. atest NetworkStatsServieTest SettingsBackupTest
      2. adb shell settings put global netstats_combine_subtype_enabled 1|0
Bug: 146415925

Change-Id: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
Merged-In: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
(cherry picked from commit c4f77ac90bf2e48a655ad19b162fe74a23bf3fb0)
2020-03-19 01:40:55 +00:00
Remi NGUYEN VAN
c02d8ed6ed Merge "Move sensitive field parceling bool to constructor" into rvc-dev 2020-03-19 01:32:48 +00:00
Remi NGUYEN VAN
b8b53564b3 Merge "Make LinkPropertiesTest backwards compatible" into rvc-dev 2020-03-19 01:32:17 +00:00
Remi NGUYEN VAN
cd394aecff Merge changes from topic "netstack_api_review" into rvc-dev am: 54a6565668
Change-Id: Iddd40677121e331eb50b74aa379dabaf4632219d
2020-03-19 01:30:57 +00:00
Remi NGUYEN VAN
54a6565668 Merge changes from topic "netstack_api_review" into rvc-dev
* changes:
  Remove usage of Context.NETWORK_STACK_SERVICE
  Remove NETWORK_STACK_SERVICE constant
2020-03-19 01:21:29 +00:00
Paul Hu
8ba389de1c Merge "Kill ConnectivityManager.CONNECTIVITY_ACTION_SUPL" 2020-03-19 01:10:55 +00:00
Lorenzo Colitti
20b0a9531a Merge "mtu: Add MTU parameter to Routes" into rvc-dev 2020-03-19 00:50:57 +00:00
Cody Kesting
8fcc76839f Change NetworkCapabilties administrator UIDs to be stored as int[].
NetworkCapabilities#mAdministratorUids is used to track the UIDs that
are administrators of the given Network. This value was previously
stored as List<Integer>. However, general Android API Council guidelines
recommend using Arrays for primitive values. In order to be consistent
with the guidelines, updating the field to use an Array.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: I2652a5b0f276b8944454af5cb4b1383a3e054cfa
Merged-In: I2652a5b0f276b8944454af5cb4b1383a3e054cfa
2020-03-18 15:18:47 -07:00
Cody Kesting
b3aff3e11c Merge "Restrict VPN Diagnostics callbacks to underlying networks." am: 48a1305d1e am: 8dbbe45761
Change-Id: Iae4aa40b2232171f241d99a81ec84cbbac1fd64d
2020-03-18 20:26:46 +00:00
Igor Murashkin
470d85fe56 Merge "AppLaunch: Update to support iorap compilations on go/perfmaster" into rvc-dev 2020-03-18 20:22:09 +00:00
Cody Kesting
48a1305d1e Merge "Restrict VPN Diagnostics callbacks to underlying networks." 2020-03-18 20:07:52 +00:00
Cody Kesting
8c78e55488 Change NetworkCapabilities administrator UIDs to be stored as int[]. am: f7ac996fb5
Change-Id: I26343fa85d936aa71dbe983341343fd1d74a7a0a
2020-03-18 19:56:33 +00:00
Cody Kesting
93b97bd690 Merge "Change NetworkCapabilities administrator UIDs to be stored as int[]." into rvc-dev 2020-03-18 19:40:39 +00:00
Victor Hsieh
d3c37d3efd Merge "Run ApkVerityTest if first api level >= 30" into rvc-dev am: 0af18474b3
Change-Id: I6cb612ee08887a9f63f0a3f5d73c3387e69f4b6a
2020-03-18 18:41:33 +00:00
Victor Hsieh
0af18474b3 Merge "Run ApkVerityTest if first api level >= 30" into rvc-dev 2020-03-18 18:35:33 +00:00
Cody Kesting
f7ac996fb5 Change NetworkCapabilities administrator UIDs to be stored as int[].
NetworkCapabilities#mAdministratorUids is used to track the UIDs that
are administrators of the given Network. This value was previously
stored as List<Integer>. However, general Android API Council guidelines
recommend using Arrays for primitive values. In order to be consistent
with the guidelines, updating the field to use an Array.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: I2652a5b0f276b8944454af5cb4b1383a3e054cfa
2020-03-18 17:40:24 +00:00
Adrian Roos
7dc8245e84 Merge "WindowInsetsAnimationController: Add state callback and getters" into rvc-dev am: 269b162622
Change-Id: I3a52c334c8acaa907eeaf94c49058578ce56deac
2020-03-18 16:46:20 +00:00
Victor Hsieh
4a70ead56d Run ApkVerityTest if first api level >= 30
CDD requires new devices launching with R to support fs-verity.

Test: `atest ApkVerityTest` on device with first_api_level=30
Bug: 150641206
Change-Id: Ied831fa720fecc623dbac6bdbd1263856d2792ef
2020-03-18 16:44:57 +00:00
Adrian Roos
269b162622 Merge "WindowInsetsAnimationController: Add state callback and getters" into rvc-dev 2020-03-18 16:43:10 +00:00
Gavin Corkery
01d2c092c7 Merge "Sync requests only when there are changes to report" into rvc-dev am: a80e32178b
Change-Id: Ifcaf3be858398b2ade0d68f21b98619a22844e90
2020-03-18 13:44:33 +00:00
Gavin Corkery
a80e32178b Merge "Sync requests only when there are changes to report" into rvc-dev 2020-03-18 13:27:45 +00:00
TreeHugger Robot
8a69fa1853 Merge "Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister" into rvc-dev 2020-03-18 11:49:09 +00:00
Lorenzo Colitti
d86407b092 mtu: Add MTU parameter to Routes
- Change route to update existing route
- MTU parameter added to AddRoute

Bug: 142892223
Test: unit test
Change-Id: I2164808ef628eb7c12e875f0bde7f5151bf6a5b5
Merged-In: Ie339d0cee5be12c2232a4631fed61219a0facc64
(cherry picked from commit e521f07e8b03102f1b510a3fb401993513d9c127)
2020-03-18 11:18:37 +00:00
Adrian Roos
5d557edb44 WindowInsetsAnimationController: Add state callback and getters
Adds more comprehensive callbacks and getters for the WindowInsetsAnimationController,
to make it more straight forward to properly use.

Test: atest InsetsControllerTest PendingInsetsControllerTest
Fixes: 151707442
Change-Id: Ida55f609112396c0f6de4c5c4431e0793c2e315e
2020-03-18 12:17:19 +01:00
Chiachang Wang
1cb71607bc Merge changes I97015365,Ic9db4b9b into rvc-dev
* changes:
  Add NattKeepalivePacketDataTest
  Add KeepalivePacketDataTest
2020-03-18 10:15:15 +00:00
Junyu Lai
2762be9bba Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister
Test: atest ConnectivityServiceTest#testNetworkFactoryUnregister \
      --geneate-new-metrics 100
Bug: 151792032

Change-Id: I1ee7a26186885d3a79a32ec9e45f5bcd656a6680
Merged-In: I1ee7a26186885d3a79a32ec9e45f5bcd656a6680
Merged-In: Iece9e8ad5c51170cd404ac995d0005392d37fe0c
(cherry picked from commit 31c26cdbeb35a6fd6a53a1c25cce6d36b825bf41)
2020-03-18 10:09:44 +00:00
Remi NGUYEN VAN
438018d1c0 Remove usage of Context.NETWORK_STACK_SERVICE
The NetworkStack.getService() API should be used instead.

Bug: 151243982
Test: atest FrameworksNetTests TetheringTests
      Manual tethering test
Change-Id: I7855090bffbe895c8349ad4903b8f2eb55515f0b
2020-03-18 18:31:39 +09:00
Lucas Lin
03d9d75fea Add version check to prevent test fail on Android Q
Include androidx.core_core for androidx.core.os.BuildCompat.

Bug: 151293251
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest

Change-Id: I8356aed1bdf2646671d045e10c9d0c8115c10ca5
Merged-In: I73ef7eececec757a6e9683b231bf73fcd8d49f8d
2020-03-18 09:31:26 +00:00
Junyu Lai
6a0925b327 Merge "Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister" am: 7ff5f631b0 am: f8e280e885
Change-Id: I941bdbd6877dbf5e269ee4e49fd3947681025961
2020-03-18 09:02:12 +00:00
Automerger Merge Worker
0acf910399 Move sensitive field parceling bool to constructor
This addresses API review comments recommending to use a copy
constructor with additional parameters instead of a dedicated method.
makeSensitiveFieldsParcelingCopy becomes LinkProperties(base, true).

Bug: 150877475
Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests
Merged-In: Ib145ca7f36dcbee6ef47d09862a181fc04a28f03
(cherry picked from commit bf091021d332804e875d7fd3424340e32b896cce)

Change-Id: I98449430ca5b11f5a62ba43683663bd82650e817
2020-03-18 09:00:34 +00:00
Automerger Merge Worker
1f0748824c Make LinkPropertiesTest backwards compatible
LinkPropertiesTest must be backwards compatible with Q for CTS.

In Q 4 fields were added: DhcpServerAddress, WakeOnLanSupported,
CaptivePortalApiUrl, CaptivePortalData. The new test only tests these
fields on R and above.
testLinkPropertiesParcelable_Q still verifies that there are 14 fields
on Q, so the 4 extra fields can be ignored.

The changes use androidx.core.os.BuildCompat.isAtLeastR(), so
androidx.core_core is added as a dependency to FrameworksNetCommonTests.

Test: atest CtsNetTestCasesLatestSdk:android.net.LinkPropertiesTest
        on Q and R devices
Bug: 150918852
Change-Id: I570efa4eb483a717d4204a18473d02653a69f46d
Merged-In: I570efa4eb483a717d4204a18473d02653a69f46d
(cherry picked from commit b4c981c7c683564dde0693fa05bd02618f7dcba3)
2020-03-18 08:56:51 +00:00
junyulai
6f813159b5 [SM05] Enable record mobile network stats by collapsed rat type
Switch on the recording in device side. Metrics will be
collected in follow-up patches which can be independently
enabled/disabled.

This change also fix the fail in NetworkStatsCollectionTest
which caused by enabling this feature, where the rounding
problem happened when records are distributed into smaller
buckets and categorized into more NetworkIdentity.

Test: atest FrameworksNetTests
Bug: 129082217
Change-Id: If330e85330a4ff713dd420c98d42fa741eabd90a
Merged-In: If330e85330a4ff713dd420c98d42fa741eabd90a
(cherry picked from commit 2d4fa2c0fae8c2d79a25093d9f732a33c2f91dd4)
2020-03-18 08:08:01 +00:00
Lorenzo Colitti
e521f07e8b Merge "mtu: Add MTU parameter to Routes" am: 47c884dc67 am: 0784058909
Change-Id: I2164808ef628eb7c12e875f0bde7f5151bf6a5b5
2020-03-18 07:52:25 +00:00
junyulai
433d2ad073 Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister
Test: atest ConnectivityServiceTest#testNetworkFactoryUnregister \
      --geneate-new-metrics 100
Bug: 151792032
Change-Id: Iece9e8ad5c51170cd404ac995d0005392d37fe0c
2020-03-18 15:22:54 +08:00
Lorenzo Colitti
47c884dc67 Merge "mtu: Add MTU parameter to Routes" 2020-03-18 07:20:01 +00:00
Chiachang Wang
d4d035d6eb Add NattKeepalivePacketDataTest
Add test for constructor and parcel

Test: atest CtsNetTestCasesLatestSdk:android.net.NattKeepalivePacketDataTest
      on both Q and R devices
Bug: 151402211
Change-Id: I97015365604be1846e3ecbaf60ac99e334705565
Merged-In: I97015365604be1846e3ecbaf60ac99e334705565
2020-03-18 05:44:26 +00:00
Chiachang Wang
3c5ecde097 Add KeepalivePacketDataTest
Add test for constructor of KeepalivePacketData and
InvalidPacketException

Bug: 151109466
Test: atest CtsNetTestCasesLatestSdk:android.net.KeepalivePacketDataTest
      on both Q and R devices
Change-Id: Ic9db4b9b83ff96c87f41c5f381763c3ee8dd27c8
Merged-In: Ic9db4b9b83ff96c87f41c5f381763c3ee8dd27c8
2020-03-18 05:43:42 +00:00
Lucas Lin
cd16575779 Merge "Add version check to prevent test fail on Android Q" am: 4b0fc3fdfa am: e4545dc59a
Change-Id: I1985c4cfe6ff1712f2d181a151bfee0160fc96bf
2020-03-18 04:23:00 +00:00
Lucas Lin
4b0fc3fdfa Merge "Add version check to prevent test fail on Android Q" 2020-03-18 03:56:37 +00:00
Junyu Lai
2c7aa1f5ab Merge "[SP25] Rename functions that add Entry conditionally" 2020-03-18 03:16:41 +00:00