Commit Graph

2662 Commits

Author SHA1 Message Date
Baligh Uddin
95d6ec4a52 Merge "Migrate frameworks/base/wifi & frameworks/base/packages/OsuLogin" am: e41cd2917a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1533852

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ief078339fcd28ea8899eceec6ec611429c30a2ae
2020-12-24 06:26:58 +00:00
Baligh Uddin
67ba9e1d66 Migrate frameworks/base/wifi & frameworks/base/packages/OsuLogin
Migrate to packages/modules/Wifi.  This CL will be presubmit tested
once migration is complete.  This CL drops the code from
frameworks/base/wifi and migrated to packages/modules/Wifi.
Also adjusts visibility rules in frameworks/base/Android.bp
Bug: 137323948
Test: TH
Merged-In: I9031a37c84e17c2cf5c0552d1b33e8fd59216b92

Change-Id: I4ad80b1584f9f80dffed7786739b80f3aaf88cdc
2020-12-23 23:47:49 +00:00
Remi NGUYEN VAN
d095d82c85 Merge "Split NetworkUtils and NetworkUtilsInternal" am: 7adf0e84b8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1513140

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaa5503f829077f70803e2e865f58c6e4691d1a73
2020-12-23 01:37:12 +00:00
Remi NGUYEN VAN
7adf0e84b8 Merge "Split NetworkUtils and NetworkUtilsInternal" 2020-12-23 01:19:27 +00:00
Chalard Jean
07d2787724 Merge "Move module utils to the module package." am: eeb7c450aa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1406808

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9c42945df36d94e4abdf073fac17141f3b23d034
2020-12-21 06:11:51 +00:00
Chalard Jean
1c1883133b Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Change-Id: If5d1e4a58fb2d6d9544e6d01995dabe445cf1f25
Merged-In: I067eeecd458c34b7f2fbfa439072682661ac750c
2020-12-16 11:44:22 +09:00
Xin Li
6fe90d9859 [automerger skipped] Merge "DO NOT MERGE - Merge Android R QPR1" am: efafd46947 -s ours
am skip reason: Change-Id Ib81ba3288a986546bc570c3759c55d026add591a with SHA-1 3cfbcbee16 is in history

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1158b1e4f70b018504c963a76782c8773f698118
2020-12-10 03:05:40 +00:00
Xin Li
efafd46947 Merge "DO NOT MERGE - Merge Android R QPR1" 2020-12-10 02:18:27 +00:00
Xin Li
449272426d DO NOT MERGE - Merge Android R QPR1
Bug: 172690556
Merged-In: Ib81ba3288a986546bc570c3759c55d026add591a
Change-Id: I2acfeb6cfc83a80056a685355cc367a5514da069
2020-12-09 17:55:44 -08:00
Serik Beketayev
6f3c1295e9 Merge "[Mainline Migration] Migrate NetworkUtils" am: a086c295e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1498168

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icc0a49e76f87a741f4410b53e9a40012e37fde36
2020-12-10 00:08:03 +00:00
Remi NGUYEN VAN
8ce3c4680d Split NetworkUtils and NetworkUtilsInternal
NetworkUtils is planned to move to a dedicated JAR for connectivity
classes, while NetworkUtilsInternal would stay in the
frameworks-minus-apex JAR, in the com.android.internal.net package.

Bug: 171540887
Test: m, boots, wifi working
      atest FrameworksNetTests
Change-Id: I3d38d72ad23a4bf84af823c7baeb6fed25c0665f
2020-12-07 19:41:49 +09:00
Serik Beketayev
7f507337a7 [Mainline Migration] Migrate NetworkUtils
Migrating makeStrings(), numericToInetAddress() APIs

Bug: 173089079
Test: atest FrameworksNetTests
Change-Id: Ie914fd41bc3ce16d07f5d2768b89ce805b9245a9
2020-12-06 22:33:04 -08:00
Treehugger Robot
1453310967 Merge "Remove NATT keepalive from IpSecTransform" am: ef8a605c6f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512881

Change-Id: I6a0e26ee28e1b9bb0906c840826b7a9ddc88a818
2020-12-04 03:56:01 +00:00
Remi NGUYEN VAN
f055bbd349 Merge "Set NetworkIdentity subscriberId on all networks" am: 1ded24221e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512877

Change-Id: I6ebe5b398a14c85fe32b1b497c381963377dcdbe
2020-12-04 03:18:57 +00:00
Treehugger Robot
ef8a605c6f Merge "Remove NATT keepalive from IpSecTransform" 2020-12-04 02:07:56 +00:00
Remi NGUYEN VAN
9ae6c505e7 Merge "Remove hidden API usage in metrics toString" am: 179419f810
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512876

Change-Id: Ie5c89993c019770cdf71818565ed86f50fe9fcd1
2020-12-03 03:47:27 +00:00
Remi NGUYEN VAN
f565045348 Set NetworkIdentity subscriberId on all networks
Instead of setting NetworkIdentity.subscriberId only on telephony
networks, set it when provided on any network. At the moment only
telephony is expected to have a subscriberId in its NetworkState anyway,
and while there are plans for other network agents (wifi) to have a
subscriberId, it should also be set in that case.

This allows NetworkIdentity to stop depending on hidden network type
APIs to determine if the network is mobile.

Bug: 174436414
Test: atest FrameworksNetTests
Change-Id: I4f09987f8737d1801342eb5d6d7c2b9968b466b0
2020-12-02 18:11:16 +09:00
Remi NGUYEN VAN
25f710ae47 Remove hidden API usage in metrics toString
Remove usage of hidden NetworkType, transport APIs in toString()
implementations of metrics and data usage classes.

The toString implementations can log the transports or network type as
hex or raw indices. While slightly less readable, the metrics classes
and network type APIs are deprecated.

Bug: 174436414
Test: m
Change-Id: I79239a540b66dadd3bbe0a997960530878331358
2020-12-02 18:10:59 +09:00
Xin Li
2ce0eab1c3 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I78222391b83a4add8e964340ec08bb8a1306e1c6
Change-Id: I28bbf40820674675ccf765c912aa8140d3f74ab2
2020-12-02 00:38:58 -08:00
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
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
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
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
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
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
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
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
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
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
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
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
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