Commit Graph

2574 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
b6caaa4c1e Restructure Module code [ com.android.tethering ]
Code Migration from frameworks/base/packages/Tethering ->
packages/modules/Connectivity/Tethering

BUG: 167962976
Test: m com.android.tethering + TH
Merged-In: Ib4a3a7a14d7d0e544aadf1bfb21ad390f1ba76a7
Change-Id: Ifae56d991b43c02f1e3496abbafc87d1869add8a
2020-10-30 05:44:59 +00:00
Baligh Uddin
80e5ee71f3 [automerger skipped] Merge "Restructure Module code [ com.android.tethering ]" into stage-aosp-master am: 7ba7715c73 -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: I0bed410286e6a199774856e053f41a7872079fac
2020-10-30 05:14:12 +00:00
Baligh Uddin
f69cbcf3c2 Restructure Module code [ com.android.tethering ]
Code Migration from frameworks/base/packages/Tethering ->
packages/modules/Connectivity/Tethering

BUG: 167962976
Test: TH
Merged-In: I68cc959b56d5984b038cea4c621c60f34472f34c
Change-Id: Ia22c69ebff88d2d117a058e6ad22b23fa5d04fda
2020-10-29 21:41:26 +00:00
Baligh Uddin
54c723074a Restructure Module code [ com.android.tethering ]
Code Migration from frameworks/base/packages/Tethering ->
packages/modules/Connectivity/Tethering

BUG: 167962976
Test: TH
Merged-In: Ide2ba760c0552e614635b3e402890b587ddc3c4c
Change-Id: I68cc959b56d5984b038cea4c621c60f34472f34c
2020-10-29 20:46:03 +00:00
Yan Yan
29a46c9501 Merge "Require devices with first sdk 0 or later to support mandatory algorithms" am: 27ef72a875 am: bf50daf5dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1468662

Change-Id: I6cc664926bf6843093cdfa66f85a469c0824d84e
2020-10-20 23:12:10 +00:00
Yan Yan
27ef72a875 Merge "Require devices with first sdk 0 or later to support mandatory algorithms" 2020-10-20 22:33:37 +00:00
Yan Yan
f62269e265 Require devices with first sdk 0 or later to support mandatory algorithms
It is safe because these mandatory algorithms are already required
before new algorithms are added

It is also a quick fix to unblock b/171279612, whose root cause is
the device first sdk is wrong

Bug: 171279612
Test: atest CtsNetTestCases:IpSecManagerTest
Change-Id: I5b9d85b2bc8f13f54467c97160d138a4628265f7
2020-10-20 15:12:30 -07:00
Anton Hansson
a750f5a9f6 Merge "Remove @TestApi from @SystemApi symbols" am: 5cedf5097c am: cbe282347e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1466264

Change-Id: I86daec690141893837ec58ab1d75aecc88557ff9
2020-10-20 19:45:04 +00:00
Anton Hansson
5cedf5097c Merge "Remove @TestApi from @SystemApi symbols" 2020-10-20 13:45:13 +00:00
Anton Hansson
9001afc697 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-19 16:41:01 +01:00
Yan Yan
f769e1ecb0 Merge changes from topic "new-ipsec-api" am: 46f82d282a am: 2580e7a9f1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398433

Change-Id: I45530694608909ddbb21d037cc3302130d8140c7
2020-10-16 23:07:31 +00:00
Yan Yan
2580e7a9f1 Merge changes from topic "new-ipsec-api" am: 46f82d282a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398433

Change-Id: I074e1cc2d9b8e38d242c4a1c9b2176d3b8338774
2020-10-16 22:52:03 +00:00
Yan Yan
46f82d282a Merge changes from topic "new-ipsec-api"
* changes:
  Expose new algorithms as public API
  Add new mandatory IPsec algorithms
2020-10-16 22:30:37 +00:00
Yan Yan
4f86de5e54 Expose new algorithms as public API
Bug: 161716062
Test: FrameworksNetTests:IpSecAlgorithmTest
Change-Id: I5041c61ad5a4aa58b259e24de80a2c63d6b19dae
2020-10-16 17:53:37 +00:00
Treehugger Robot
851900ba6c Merge "Allow the network stack to read network stats history" am: 7e4a864f60 am: 5ac12d9b41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1450457

Change-Id: Ia0e0564d205ebc512db49e48c9fc3d90a581ea1b
2020-10-16 04:31:48 +00:00
Treehugger Robot
5ac12d9b41 Merge "Allow the network stack to read network stats history" am: 7e4a864f60
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1450457

Change-Id: Ia7a7fdbb57f44ef9ad74d3c1dcb6a273bbb6baf8
2020-10-16 04:20:39 +00:00
Treehugger Robot
7e4a864f60 Merge "Allow the network stack to read network stats history" 2020-10-16 04:12:51 +00:00
Chalard Jean
f1e2cf02ae Allow the network stack to read network stats history
Identical to ag/12843161

Bug: 168984229
Test: testNetworkStatsProvider
Change-Id: I7ad72c3b2b95f26ceec1371e7e0fdb92fa88920c
Merged-In: Ibb6342b0f263c874bb1f7ab4031a639778bad37e
2020-10-16 00:55:01 +00:00
Yan Yan
21abcd0248 Add new mandatory IPsec algorithms
This CL adds new mandatory IPsec algorithms and allows
OEM to enable them on old devices using resource overlay

Bug: 161716062
Test: FrameworksNetTests:IpSecAlgorithmTest
Change-Id: Ib827b05ea27dbe61b14ad236e858f825293ed994
2020-10-15 17:35:17 -07:00
TreeHugger Robot
8217b0a190 [automerger skipped] Merge "Merge ab/6749736 in stage." into stage-aosp-master am: 9e72f3f5c7 -s ours
am skip reason: Change-Id Iecef31f7bf10ad97b7e0075cf302ae94e248474a with SHA-1 539d92beb7 is in history

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

Change-Id: I35256efaa6acc9a9f28371993587f888c1a77252
2020-10-13 03:51:03 +00:00
Junyu Lai
bb9de525b2 Merge "Support dynamically update IMSI" am: 05e92bb5ef am: 3fd314dbca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1418348

Change-Id: Ic369f77eb09979e8ed36e4207fe42f293548ba90
2020-10-13 03:49:06 +00:00
TreeHugger Robot
9e72f3f5c7 Merge "Merge ab/6749736 in stage." into stage-aosp-master 2020-10-13 03:31:35 +00:00
Junyu Lai
3fd314dbca Merge "Support dynamically update IMSI" am: 05e92bb5ef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1418348

Change-Id: Id06d5d37ad5f12e689643c916548e9a59089eb3b
2020-10-13 03:22:09 +00:00
Junyu Lai
05e92bb5ef Merge "Support dynamically update IMSI" 2020-10-13 02:41:47 +00:00
junyulai
f571003794 Support dynamically update IMSI
Currently, NetworkStatsSubscriptionsMonitor will skip the
listener registration until the IMSI is available to deal
with SIM PIN locked case. However, this solution can only
handle the case that IMSI changes from/to null. And it also
relies on the assumption that IMSI never changes for a subId.

Thus, support dynamically update IMSI to handle IMSI changes
more robustly.

This patch also address leftover comments at ag/12400327.

Test: enable SIM PIN and manually test
Test: atest NetworkStatsSubscriptionsMonitorTest#testSubscriberIdUnavailable
Test: atest NetworkStatsSubscriptionsMonitorTest#testSubscriberIdChanged
Test: ./out/host/linux-x86/bin/statsd_testdrive 10082
Bug: 160941101

Change-Id: I625a5b10ee4806f6fee99c2d9d6c5e7977ff785e
2020-10-12 15:31:02 +08:00
Xin Li
dace5ac894 Merge ab/6749736 in stage.
Bug: 167233921
Merged-In: Iecef31f7bf10ad97b7e0075cf302ae94e248474a
Change-Id: I9e9c873bc2e05a0cfe3af0bf74725500f3f108db
2020-10-10 20:38:57 -07:00
Bill Yi
c281e94f60 [automerger skipped] Merge "Merge mainline-release 6664920 to master - DO NOT MERGE" am: 5249616425 am: 24c8811399 -s ours am: c5f6e724a4 -s ours
am skip reason: Change-Id Id04ea331831e8b26ba99478848392b40a92548d5 with SHA-1 c54ab73ef9 is in history

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

Change-Id: I18f6dabacb6e272e2d3fdf63a9220afc5572f2d2
2020-09-19 07:01:25 +00:00
Bill Yi
7fe436bd3a [automerger skipped] Merge mainline-release 6664920 to master - DO NOT MERGE am: 4c6dc6bbea am: b450e2e7e3 -s ours am: 953d2224f7 -s ours
am skip reason: Change-Id Id04ea331831e8b26ba99478848392b40a92548d5 with SHA-1 c54ab73ef9 is in history

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

Change-Id: Ib3e8b5c0678513b5128aaf106c8f8044bed09702
2020-09-19 07:00:58 +00:00
Bill Yi
c5f6e724a4 [automerger skipped] Merge "Merge mainline-release 6664920 to master - DO NOT MERGE" am: 5249616425 am: 24c8811399 -s ours
am skip reason: Change-Id Id04ea331831e8b26ba99478848392b40a92548d5 with SHA-1 c54ab73ef9 is in history

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

Change-Id: I2ad75dfe2a2109ea63eade0ed3edc40b92149a16
2020-09-19 05:51:33 +00:00