Commit Graph

3124 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
75244b7d08 Remove NATT keepalive from IpSecTransform
The code is unused, and based on ConnectivityManager#startNattKeepalive,
which is deprecated.

Bug: 174436414
Test: atest FrameworksNetTests
Change-Id: I08c6c1baec668a304d971bb6f2328891a5611e6a
2020-11-30 17:24:10 +09:00
Junyu Lai
94782c58aa Merge "Expose getTx/RxBytes in TrafficStats" am: 6ef6648cd9 am: 2cdfa304d2 am: 32833d5d5d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440245

Change-Id: I755eb6294da6cba787f60d057997a4d239aaa095
2020-11-25 06:32:25 +00:00
Junyu Lai
32833d5d5d Merge "Expose getTx/RxBytes in TrafficStats" am: 6ef6648cd9 am: 2cdfa304d2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440245

Change-Id: I065c1f80d2024edcafa144e907bf74da870ab000
2020-11-25 06:11:53 +00:00
Chalard Jean
1fc8fb75b8 Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Change-Id: I067eeecd458c34b7f2fbfa439072682661ac750c
Merged-In: I067eeecd458c34b7f2fbfa439072682661ac750c
2020-11-25 06:01:49 +00:00
Junyu Lai
2cdfa304d2 Merge "Expose getTx/RxBytes in TrafficStats" am: 6ef6648cd9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440245

Change-Id: I69eb11657318438dbe794da849182a08e1847f94
2020-11-25 04:14:46 +00:00
junyulai
3154d517c9 Expose getTx/RxBytes in TrafficStats
Test: atest FrameworksNetTests TrafficStatsTest
      atest android.net.cts android.net.wifi.cts
Bug: 164965653
Change-Id: I17b9d0bc2404c5727d4c4530ad941439b7b71a54
2020-11-24 12:11:08 +08:00
Aurimas Liutikas
56e77fa2e4 [automerger skipped] Merge "Remove legacy style metalava suppression" am: e1bb600fc7 am: 8f02f86962 am: 96c5bcd136 am: 79c007ed31 -s ours
am skip reason: Change-Id I6d5df95cfca2950ea86872d2f0afc1ba828841dc with SHA-1 7e8faaefbd is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1421698

Change-Id: I64bd5ddef60555447dc9953f6208d22fd9ba1f53
2020-11-16 22:01:45 +00:00
Aurimas Liutikas
79c007ed31 Merge "Remove legacy style metalava suppression" am: e1bb600fc7 am: 8f02f86962 am: 96c5bcd136
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1421698

Change-Id: Ib1b078a6e6c6e19391277d19c0f8d748eee6300b
2020-11-16 21:40:21 +00:00
Aurimas Liutikas
96c5bcd136 Merge "Remove legacy style metalava suppression" am: e1bb600fc7 am: 8f02f86962
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1421698

Change-Id: Idd656e3803c247b03808259c582599898c064b27
2020-11-16 21:13:46 +00:00
Aurimas Liutikas
8f02f86962 Merge "Remove legacy style metalava suppression" am: e1bb600fc7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1421698

Change-Id: I86186f315dbac925c11f99993dd71703bd12d6ca
2020-11-16 17:58:37 +00:00
Aurimas Liutikas
9de1e0e438 Remove legacy style metalava suppression
@SuppressLint("Doclava125") is a legacy way of suppressing
RequiresPermission check. Updating to the new style of suppression
so metalava no longer has to support the legacy mode.

sed -i "s/@SuppressLint(\"Doclava125/@SuppressLint(\"RequiresPermission/" \
core/java/android/app/admin/DevicePolicyManager.java \
core/java/android/hardware/hdmi/HdmiControlManager.java \
core/java/android/hardware/location/ContextHubManager.java \
core/java/android/hardware/usb/UsbDeviceConnection.java \
core/java/android/net/TrafficStats.java \
core/java/android/os/RecoverySystem.java \
core/java/android/os/storage/StorageManager.java \
core/java/android/service/persistentdata/PersistentDataBlockManager.java \
location/java/android/location/LocationManager.java \
media/java/android/media/AudioManager.java \
telecomm/java/android/telecom/TelecomManager.java \
telephony/java/android/telephony/CarrierConfigManager.java \
telephony/java/android/telephony/TelephonyManager.java \
wifi/java/android/net/wifi/RttManager.java \
wifi/java/android/net/wifi/WifiScanner.java

Test: make
Exempt-From-Owner-Approval: No-op change
Merged-In: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
Change-Id: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
2020-11-12 18:30:12 -08:00
Aurimas Liutikas
7e8faaefbd Remove legacy style metalava suppression
@SuppressLint("Doclava125") is a legacy way of suppressing
RequiresPermission check. Updating to the new style of suppression
so metalava no longer has to support the legacy mode.

sed -i "s/@SuppressLint(\"Doclava125/@SuppressLint(\"RequiresPermission/" \
core/java/android/app/admin/DevicePolicyManager.java \
core/java/android/hardware/hdmi/HdmiControlManager.java \
core/java/android/hardware/location/ContextHubManager.java \
core/java/android/hardware/usb/UsbDeviceConnection.java \
core/java/android/net/TrafficStats.java \
core/java/android/os/RecoverySystem.java \
core/java/android/os/storage/StorageManager.java \
core/java/android/service/persistentdata/PersistentDataBlockManager.java \
location/java/android/location/LocationManager.java \
media/java/android/media/AudioManager.java \
telecomm/java/android/telecom/TelecomManager.java \
telephony/java/android/telephony/CarrierConfigManager.java \
telephony/java/android/telephony/TelephonyManager.java \
wifi/java/android/net/wifi/RttManager.java \
wifi/java/android/net/wifi/WifiScanner.java

Test: make
Exempt-From-Owner-Approval: No-op change
Change-Id: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
2020-11-12 18:27:15 -08:00
Junyu Lai
2978147703 Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 07cfc92259 am: 24d691f04d am: 10656c3c44 am: bff31f6f47
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: I2c5895c223a5843cfe11a1736a243b6847ad1b9a
2020-11-12 10:19:29 +00:00
Junyu Lai
bff31f6f47 Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 07cfc92259 am: 24d691f04d am: 10656c3c44
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: Ie76caf460ac86251cd0ceca981bdf2c7e4bcfc44
2020-11-12 09:47:50 +00:00
Junyu Lai
10656c3c44 Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 07cfc92259 am: 24d691f04d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: I11a56ed8d67f321a66fecc7550383db7d9f9c897
2020-11-12 09:35:38 +00:00
Junyu Lai
24d691f04d Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 07cfc92259
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: I5545dddcb5c8499ac9c53325cbafd424124429e1
2020-11-12 09:02:13 +00:00
Junyu Lai
07cfc92259 Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5
* changes:
  Remove unused variables
  Return offloaded traffic when querying from TrafficStats API
  Add hardware tethering traffic in testTethering test
  Remove unused getTetherStats
2020-11-12 08:45:15 +00:00
junyulai
a545c35fa4 Remove unused variables
From aosp/537809, variables that used to fetch realtime
stats are defined in NetworkStatsService. These varialbles
are filled by JNI in boot up stage in order to keep
definitions sync with native layer.

However, there is still a copy in TrafficStats.java, and this
copy cannot be filled in boot-up stage since it is in app
process. Besides, making a binder call to fetch these
constants from service is considered an overkill.

Thus, since there is no caller to these variables and callers
should use definitions in TrafficStats, remove these variables.

Test: atest FrameworksNetTests
Bug: 16229221
Change-Id: I6a48d4dbb1b824cfc6c4a47395b2a76aa28cf5c9
2020-11-12 14:22:31 +08:00
junyulai
ea2363294f Return offloaded traffic when querying from TrafficStats API
TrafficStats API are being used for querying realtime network
statistics for years. However, on certain devices, some network
traffic are produced by hardware components and not be
able to seen by kernel counters.

Thus, include statistics for those missing network traffic is
necessary. Note that the included statistics might be stale
since polling newest stats from hardware might impact system
health and not suitable for TrafficStats API use cases.

Test: atest FrameworksNetTests TetheringTests
Bug: 16229221

Change-Id: I6741c41cb5145ca8748f9b083b9c15e7e2735681
2020-11-12 14:22:31 +08:00
Mathew Inwood
e6794fe61c [automerger skipped] Merge "Add maxTargetSdk restriction to unused APIs." am: db3bb00d7b am: 6b8c99737d am: 6b29d9afd1 -s ours am: dd916a5693 -s ours
am skip reason: Change-Id I626caf7c1fe46c5ab1f39c2895b42a34319f771a with SHA-1 e44c5f5a7c is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1468245

Change-Id: Ie7a69520ba03c3454455d1fe0d0daf95d12840ed
2020-11-09 16:32:35 +00:00
Mathew Inwood
dd916a5693 [automerger skipped] Merge "Add maxTargetSdk restriction to unused APIs." am: db3bb00d7b am: 6b8c99737d am: 6b29d9afd1 -s ours
am skip reason: Change-Id I626caf7c1fe46c5ab1f39c2895b42a34319f771a with SHA-1 e44c5f5a7c is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1468245

Change-Id: I121b7837c0d2a65bb2a8d264c7f92c2a477def67
2020-11-09 15:59:31 +00:00
Mathew Inwood
6b29d9afd1 Merge "Add maxTargetSdk restriction to unused APIs." am: db3bb00d7b am: 6b8c99737d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1468245

Change-Id: I60222cb1879651cf283e385519b5c4d156ab68a1
2020-11-09 15:24:20 +00:00
Mathew Inwood
6b8c99737d Merge "Add maxTargetSdk restriction to unused APIs." am: db3bb00d7b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1468245

Change-Id: I35f65987f7f9287cf03418e9feb27c81f4fd1878
2020-11-09 15:09:11 +00:00
Mathew Inwood
db3bb00d7b Merge "Add maxTargetSdk restriction to unused APIs." 2020-11-09 14:41:20 +00:00
junyulai
e3be94d65c Remove unused getTetherStats
Before Android R, getTetherStats were used to collect tethering
iface stats of all clients who extends ITetheringStatsProvider,
which typically contains NetdTetheringStatsProvider and
OffloadController.

However, this always returns 0 since Android R, because:
  1. OffloadController implemented NetworkStatsProvider and no
     longer reports stats through getTetherStats.
  2. NetdTetheringStatsProvider always return 0 by design since
     non-offloaded iface tethering stats are already included
     in native iface stats.

This change is a no-op refactoring to remove unused
getTetherStats and update test which is not pratical.
Fix for offloaded tethering stats will be in follow-up CLs.

Test: atest FrameworksNetTests TetheringTests
Bug: 162292214
Change-Id: Icd0717c5c2807ae3bd98626b897e4b148f142815
2020-11-06 19:02:44 +08:00
Chalard Jean
2efb2c89e0 Merge "Move module utils to the module package." 2020-11-05 06:45:18 +00:00
Eran Messeri
84e8e481f0 [automerger skipped] DO NOT MERGE: Introduce DPMS shim for active DO/PO check am: 0c94b53855 am: a8efd2bc0c am: c084922997 am: 7176db04ea -s ours
am skip reason: subject contains skip directive

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1486196

Change-Id: Id6810e59354ad617785eeba7ca8600ea3778dc06
2020-11-04 13:33:42 +00:00
Eran Messeri
7176db04ea DO NOT MERGE: Introduce DPMS shim for active DO/PO check am: 0c94b53855 am: a8efd2bc0c am: c084922997
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1486196

Change-Id: I76bfbffc3485cd07675ffc8c8c64f11a8a7d5d03
2020-11-04 13:00:13 +00:00
Eran Messeri
c084922997 DO NOT MERGE: Introduce DPMS shim for active DO/PO check am: 0c94b53855 am: a8efd2bc0c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1486196

Change-Id: I467120ce7e419a75749efac109609bb30cc35eff
2020-11-04 12:46:45 +00:00
Eran Messeri
a8efd2bc0c DO NOT MERGE: Introduce DPMS shim for active DO/PO check am: 0c94b53855
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1486196

Change-Id: I79e090d92c5bf17993f8e4f710581675eb72f2a9
2020-11-04 12:24:40 +00:00
Eran Messeri
0c94b53855 DO NOT MERGE: Introduce DPMS shim for active DO/PO check
Introduce a shim into DevicePolicyManagerInternal &
DevicePolicyManagerService so that NetworkStatsAccessTest would not
diverge from internal development branches.

The DevicePolicyManagerService refactoring on the internal branch
removed isActiveAdminWithPolicy in favour of isActiveDeviceOwner and
isActiveProfileOwner.

These methods are being made available in AOSP for
NetworkStatsAccessTest.

Bug: 170459325
Test: atest NetworkStatsAccessTest
Change-Id: Ic7e0898989fb8222aaba2b35436765c04eb3250c
2020-11-04 10:07:06 +00:00
Mathew Inwood
fe2fed741e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Natasha Lee
22ea903296 [automerger skipped] Merge "Allow the network stack to read network stats history" into rvc-qpr-dev am: ef3ed74b7a am: 4d43ed5483 -s ours
am skip reason: Change-Id Ibb6342b0f263c874bb1f7ab4031a639778bad37e with SHA-1 4c1d8a48fc is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12906925

Change-Id: I40c947f523733adb7f97325f48c3062008b64d28
2020-11-03 02:16:09 +00:00
Natasha Lee
4d43ed5483 Merge "Allow the network stack to read network stats history" into rvc-qpr-dev am: ef3ed74b7a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12906925

Change-Id: Ica71524ed28a86befd9f3f16921f58e40eff2cea
2020-11-03 02:14:06 +00:00
Treehugger Robot
5e6e021c8d [automerger skipped] Merge "Apply FLAG_IMMUTABLE to the PendingIntent in NetworkStatService.java" am: 2c0bf15a21 am: 3672e620c9 am: d4fe2f1ae4 am: 48ae7842a7 -s ours
am skip reason: Change-Id I35ccfc0f69fd98b5803da74d9eb12902b351acc7 with SHA-1 f5686f3918 is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1481721

Change-Id: Idadfa833e3b030df4a592207ddb7a89a028ecd4d
2020-11-03 02:13:46 +00:00
Treehugger Robot
48ae7842a7 Merge "Apply FLAG_IMMUTABLE to the PendingIntent in NetworkStatService.java" am: 2c0bf15a21 am: 3672e620c9 am: d4fe2f1ae4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1481721

Change-Id: Ia314010dcaeb89e9229fc17c09fb27f3cfff64a2
2020-11-03 01:57:31 +00:00
Treehugger Robot
d4fe2f1ae4 Merge "Apply FLAG_IMMUTABLE to the PendingIntent in NetworkStatService.java" am: 2c0bf15a21 am: 3672e620c9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1481721

Change-Id: I69f5ad02a04e87b78cc9344556c12753a68c540e
2020-11-03 01:41:22 +00:00
Treehugger Robot
3672e620c9 Merge "Apply FLAG_IMMUTABLE to the PendingIntent in NetworkStatService.java" am: 2c0bf15a21
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1481721

Change-Id: I175f062b3d7f5ead9cbab6142ba1a126ce311d45
2020-11-03 00:34:39 +00:00
Mathew Inwood
529c3aefeb [automerger skipped] Add maxTargetSdk restriction to unused APIs. am: e44c5f5a7c -s ours
am skip reason: Change-Id I8285daa8530260251ecad6f3f38f98e263629ca7 with SHA-1 2217f37fc7 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12967795

Change-Id: I7640cc309f990c400ff3a7db6de77a71bb0f1d72
2020-11-02 15:04:11 +00:00
Mathew Inwood
e44c5f5a7c Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I8285daa8530260251ecad6f3f38f98e263629ca7
Change-Id: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
2020-11-02 10:30:09 +00:00
Treehugger Robot
62780368b0 Allow the network stack to read network stats history
Bug: 168984229
Test: testNetworkStatsProvider
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1450457

Change-Id: Ic9bd2d2d06c790a84e56ec8a6915f1faab16dda0
Merged-In: Ibb6342b0f263c874bb1f7ab4031a639778bad37e
(cherry picked from commit 9010baec16faa806c2253f90225d002c4b2efb0c)
2020-11-02 07:40:58 +00:00
Chalard Jean
339c010f8f Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Change-Id: I067eeecd458c34b7f2fbfa439072682661ac750c
2020-11-02 10:01:30 +09:00
Ashwini Oruganti
c5c6f28294 Apply FLAG_IMMUTABLE to the PendingIntent in NetworkStatService.java
Broadcast intents sent by AlarmManager are immutable; the system
dispatches them without customization.

Fixes: 171815343
Test: TH
Change-Id: I35ccfc0f69fd98b5803da74d9eb12902b351acc7
Merged-In: I35ccfc0f69fd98b5803da74d9eb12902b351acc7
2020-10-30 10:49:45 -07:00
Baligh Uddin
1f8bafbfb4 [automerger skipped] Restructure Module code [ com.android.tethering ] am: bbe92b335c -s ours
am skip reason: Change-Id I2accb96abbdfa665ef34aa79e87af040226bcf32 with SHA-1 7199b112b5 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12948958

Change-Id: I1423385124c67bf55535c00bd16b39808e16139e
2020-10-30 14:50:44 +00:00
Baligh Uddin
bbe92b335c Restructure Module code [ com.android.tethering ]
Code Migration from frameworks/base/packages/Tethering ->
packages/modules/Connectivity/Tethering

BUG: 167962976
Test: TH
Merged-In: I2accb96abbdfa665ef34aa79e87af040226bcf32
Change-Id: Id7656fe7f6a6fae044dc8defd05e83d81c6b8c11
2020-10-30 14:42:23 +00:00
Treehugger Robot
ebf4f1454b [automerger skipped] Merge "Restructure Module code [ com.android.tethering ]" am: c8769826af -s ours am: 31afdad66a -s ours am: a18699c4a4 -s ours am: 40088801dd -s ours
am skip reason: Change-Id Ib4a3a7a14d7d0e544aadf1bfb21ad390f1ba76a7 with SHA-1 571a934615 is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1479716

Change-Id: I26b9652e1951f6be776d75707890ed563c6e66ec
2020-10-30 10:38:16 +00:00
Treehugger Robot
40088801dd [automerger skipped] Merge "Restructure Module code [ com.android.tethering ]" am: c8769826af -s ours am: 31afdad66a -s ours am: a18699c4a4 -s ours
am skip reason: Change-Id Ib4a3a7a14d7d0e544aadf1bfb21ad390f1ba76a7 with SHA-1 62822a92cd is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1479716

Change-Id: Ibba9eafcf65c50cfe52b9d42f6b6d77d67ca886c
2020-10-30 10:04:43 +00:00
Treehugger Robot
a18699c4a4 [automerger skipped] Merge "Restructure Module code [ com.android.tethering ]" am: c8769826af -s ours am: 31afdad66a -s ours
am skip reason: Change-Id Ib4a3a7a14d7d0e544aadf1bfb21ad390f1ba76a7 with SHA-1 62822a92cd is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1479716

Change-Id: I509d8b350d9fea9757a0740704e401d39ab7f1de
2020-10-30 09:43:18 +00:00
Treehugger Robot
31afdad66a [automerger skipped] Merge "Restructure Module code [ com.android.tethering ]" am: c8769826af -s ours
am skip reason: Change-Id Ib4a3a7a14d7d0e544aadf1bfb21ad390f1ba76a7 with SHA-1 62822a92cd is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1479716

Change-Id: I47de082b8e60278e8baa8381a384001d636e6f90
2020-10-30 09:13:35 +00:00
Baligh Uddin
2e6412b683 [automerger skipped] Merge "Restructure Module code [ com.android.tethering ]" into stage-aosp-master am: 7ba7715c73 -s ours am: 80e5ee71f3 -s ours am: 411e1ad5f6 -s ours
am skip reason: Change-Id I68cc959b56d5984b038cea4c621c60f34472f34c with SHA-1 54c723074a is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12948375

Change-Id: I060f66963855b6e490aa09d11e41253076685e99
2020-10-30 06:11:53 +00:00