Commit Graph

660327 Commits

Author SHA1 Message Date
Junyu Lai
27c9adb058 [MS34.1] Replace TelephonyManager#getSubscriberId(subId) with public API
Test: atest com.android.server.net.NetworkStatsSubscriptionsMonitorTest
Bug: 204830222
Change-Id: I57aa4470aea1715217fa7d74f2c9067b096d1bae
2022-01-06 09:22:52 +00:00
Junyu Lai
2aa7b9ec4d [MS40.1] Remove Clock dependencies from NetworkStatsService
This includes:
1. Re-implement the BestClock in the static library.
2. Expose SystemClock#currentNetworkTimeClock as public Api

Test: TH
Bug: 204830222
CTS-Coverage-Bug: 213393821
Exempt-From-Owner-Approval: 1. Owner approved the change with
  explicitly granted submission after adderessing the
  straight-forward comment. 2. Owner is OOO for 3 months.
Change-Id: I08c0162a7101cc6184f3eca3d4a59211183fb843
2022-01-06 08:49:59 +00:00
Junyu Lai
0cf9e87c79 [MS27] Expose noteUntaggedSocket SystemApi
While Data usage related codes are moving to mainline module,
StrictMode#vmUntaggedSocketEnabled() and onUntaggedSocket()
can no longer be accessed from NetworkManagementSocketTagger.

Thus, expose alternative SystemApi to allow invocations from
the module.

Test: TH
Bug: 204830222
Exempt-From-Owner-Approval: 1. Owner approved the change with
  explicitly granted submission after adderessing the
  straight-forward comment. 2. Owner is OOO for 3 months.
Change-Id: Ib54ff54ce3617ae0d04080a1740e78b086bbb039
2022-01-06 08:49:46 +00:00
Junyu Lai
92524a042c [MS33.1] Remove NetdService dependency
This change pass INetd to NetworkStatsFactory to replace
NetdService#getNetdInstance.

Test: atest FrameworksNetTests
Bug: 204830222
Change-Id: I39b278989cea06dd316f21214380b5c4b54d2d50
2022-01-05 05:29:46 +00:00
Treehugger Robot
0892c27c57 Merge "[MS31] Fix several hidden API usages" 2022-01-04 03:56:23 +00:00
Treehugger Robot
7b8430e17e Merge changes from topics "ms25-appops", "ms28-service-fix"
* changes:
  [MS25.1] Remove AppOpsManager.OP_GET_USAGE_STATS dependency
  [MS28.1] Fix several hidden API dependencies
2022-01-03 22:41:07 +00:00
Junyu Lai
1e3e87b14a [MS31] Fix several hidden API usages
This includes:
1. Replace UserHandle.getUid(userId, appId) with public API
2. Remove Preconditions.checkArgument
3. Replace MathUtil.constrain with the one in NetworkStatsUtils
4. Remove Sets
5. Replace NetworkStack.checkNetworkStackPermission with the
   one in the PermissionUtils
6. Replace internal CollectionUtils with the one in the module
7. Inline ProtoOutputStream(fd)
8. Replace Intent.EXTRA_USER_HANDLE with Intent.EXTRA_USER

Test: atest NetworkStatsSubscriptionsMonitorTest \
      NetworkStatsServiceTest
Bug: 204830222

Change-Id: If06a27b04ad15c29052b670eefc2f6dc0d199420
2022-01-03 15:15:05 +00:00
Les Lee
d9862a4d0c Merge "wifi data usage: replaced Wi-Fi SSID with a Wi-Fi network key" 2022-01-03 12:36:49 +00:00
Les Lee
6ca5c25bf4 wifi data usage: replaced Wi-Fi SSID with a Wi-Fi network key
1. Used SSID to be a wifi network identity can't separate wifi
data usage when there are two different network with same SSID.
Use a new usage key from WifiInfo to replace wifi SSID to solve
this issue.

2. To support to query wifi usage per configured Wifi network.
Adding matchWifiNetworkKeys in NetworkTemplate to support querying
multi networkKeys wifi data usage since each configured Wifi
network configuration might be used to connect different Wifi
network. (Replace mNetworkId with mMatchWifiNetworkKeys)

3. Updated callers who were using NetworkTemplate constructor.

4. Fixed SortedSet null order case. The null subscriberId is a
valid input for matchSubscriberIds.

5. Replaced ArrayUtils with CollectionUtils.

Bug: 197520752
Bug: 126299427
Test: atest -c NetworkTemplateTest
Test: atest -c NetworkStatsServiceTest
Test: atest -c NetworkPolicyManagerServiceTest
Test: atest -c NetworkPolicyTest
Change-Id: Ie20e7fb56597817901be4ce1d2a7afcbc9ded0c6
2022-01-03 15:13:00 +08:00
Treehugger Robot
8bc5344f95 Merge "[MS23] Remove UserHandle.getUserId dependencies" 2021-12-30 15:45:03 +00:00
Treehugger Robot
c938ae401e Merge "[MS26.1] Remove Process.NETWORK_STACK_UID dependency" 2021-12-30 12:43:39 +00:00
Junyu Lai
fe054b770c [MS25.1] Remove AppOpsManager.OP_GET_USAGE_STATS dependency
Replaced by public interface.

Test: TH
Bug: 204830222
Change-Id: If7d17879b0ffdb6300373bc581cb07252fccfc7a
2021-12-30 10:00:19 +00:00
Junyu Lai
5c7508e2ac [MS23] Remove UserHandle.getUserId dependencies
Replaced with SystemApi.

Test: TH
Bug: 204830222
Change-Id: Ibc834489428c2036cd4ccd3284ba06c4c9e792b7
2021-12-30 10:00:19 +00:00
Junyu Lai
94a24370f7 [MS28.1] Fix several hidden API dependencies
This includes:
1. Replace Slog with Log
2. Use android.util.IndentingPrintWriter instead of the
   deprecated internal one.
3. Replace usages of ArrayUtils with CollectionUtils.
4. Reimplement DumpUtils#checkDumpPermission in PermissionUtils.
5. Replace MathUtils.constrain with NetworkStatsUtils.constrain

Test: FrameworksNetTests
Bug: 204830222
Change-Id: I2b064fc25497288d66018584e66da98c79bd208d
2021-12-30 10:00:19 +00:00
Alice Kuo
8c0ae12d46 Merge "Group CSIP device based on CAP" 2021-12-30 01:38:04 +00:00
Treehugger Robot
ccb536b8e2 Merge "Use Common Audio Service UUID from latest assigned numbers" 2021-12-30 00:16:35 +00:00
Alice Kuo
26bb180195 Group CSIP device based on CAP
Enable device group based on CAP

Bug: 150670922
Bug: 178981521
Test: pair with the LE audio coordinated set, and make sure it works

Change-Id: Ia3d0dbe496dec822fee8ae6465b81688b9e9440c
Merged-In: Ia3d0dbe496dec822fee8ae6465b81688b9e9440c
2021-12-30 07:54:51 +08:00
Jakub Pawlowski
2b67e53442 Use Common Audio Service UUID from latest assigned numbers
Bug: 150670922
Test: compilation
Merged-In: I35684ecec50c3db757331b6384c2579f5a28a70a
Change-Id: I35684ecec50c3db757331b6384c2579f5a28a70a
2021-12-29 19:11:00 +00:00
Treehugger Robot
4f4060c7b4 Merge "[MS21] Remove DataUnit dependency" 2021-12-29 13:24:49 +00:00
Treehugger Robot
613e503207 Merge "[MS19.1] Fix several hidden API dependencies" 2021-12-29 05:16:58 +00:00
Junyu Lai
7c4090fdb5 [MS26.1] Remove Process.NETWORK_STACK_UID dependency
Check NetworkStack permission instead.

Test: NetworkStatsAccessTest
Bug: 204830222
Change-Id: I052a1422d145af533b036b0f017ace485b67cbfe
2021-12-29 01:43:54 +00:00
Junyu Lai
790c02d70b [MS21] Remove DataUnit dependency
DataUnit is a hidden class, remove the references to
it from files that about to be moved into the module.

Test: TH
Bug: 204830222

Change-Id: Ibfb82ab74f283686fb2af6c3a550d541440c890d
2021-12-29 01:43:53 +00:00
Sarah Chin
a28f3d2066 Merge "Add new fields to ApnSetting/DataProfileInfo" 2021-12-28 23:06:10 +00:00
Amy Gu
6b7318e25a Merge "Fix typo." 2021-12-28 18:32:15 +00:00
Jon Eckenrode
01b57ef4f6 Merge "Removed reference to developer guide from class description. Added some missing parameter and return descriptions." 2021-12-28 14:58:24 +00:00
Junyu Lai
3c53e4c8a4 [MS19.1] Fix several hidden API dependencies
This includes:
1. Use android.util.IndentingPrintWriter instead of the
   deprecated internal one.
2. Replace usages of IntArray with CollectionUtils and ArrayList.
3. Replace usages of ArrayUtils with CollectionUtils.
4. Refactor MathUtils.constrain functions into NetworkStatsUtils.
5. Replace Maps.newHashMap and Lists.newArrayList with public
   class constructors.
6. Replace Slog with Log.

Test: FrameworksNetTests NetworkStaticLibTests
Bug: 204830222
Change-Id: If009194ad5668a6d48dd341ea6d325028ce56d42
2021-12-28 09:16:33 +00:00
Chiachang Wang
80178db312 Merge "Add configuration whether to exclude local traffic in the VPN" 2021-12-28 07:45:20 +00:00
Treehugger Robot
de62afa978 Merge "[MS18] Augment data usage by default" 2021-12-28 06:23:09 +00:00
Chiachang Wang
de8c621832 Add configuration whether to exclude local traffic in the VPN
Add a extra variable to store whether the local traffic is
exempted from the VPN.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I70301901c2374ded9fdf179d0ce64e7bb2d7b1ab
2021-12-28 11:14:01 +08:00
Junyu Lai
b4ac36e28d Merge changes from topic "ms16-querysummary"
* changes:
  [MS16.2] Change exception handling for Data Usage APIs
  [MS16.1] Prepare APIs for replacing getNetwork[Total|Uid]Bytes
2021-12-27 05:36:46 +00:00
Treehugger Robot
6c8544e068 Merge "Update JIT Zygote image option." 2021-12-24 15:46:57 +00:00
Jiakai Zhang
5e6fa85a96 Update JIT Zygote image option.
Bug: 203492478
Test: manual -
  1. Build a system image and flash it to a device.
  2. adb shell setprop dalvik.vm.extra-opts '-verbose:image'
  3. adb shell setprop dalvik.vm.profilebootclasspath true
  4. adb shell setprop ctl.restart zygote
  5. See the boot image extension being compiled in memory
     (http://gpaste/4688561208033280).
Change-Id: I69c11e3e41b9ab142b427ee054c2a6275ff089de
2021-12-24 11:47:39 +00:00
Junyu Lai
6d53853cfa [MS18] Augment data usage by default
Follow-up from ag/2815797, callers who uses the hidden API
will have their data augmented by default, and the public
API offers a way to opt-into augmentation.

However, since the data usage is going to the module.
All the hidden API usage must be eliminated. Also, from user
perspective, it is better for UI and API to have aligned
behavior.

Thus, enable augment data usage for public API callers.

Test: atest FrameworksNetTests \
      android.app.usage.cts.NetworkUsageStatsTest
Bug: 204830222
Change-Id: Ida254fac8d44c32d388f1886a866f7324a41ce75
2021-12-24 09:55:22 +00:00
Junyu Lai
1fb998b864 [MS16.2] Change exception handling for Data Usage APIs
Test: TH
Bug: 204830222
Change-Id: If4e37f227adcabf6901d70ba0bee0dc29b9b3bdc
2021-12-24 08:50:29 +00:00
Junyu Lai
81b2bcc7aa [MS16.1] Prepare APIs for replacing getNetwork[Total|Uid]Bytes
These internal methods are used in MultipathPolicyTracker and
NetworkPolicyManagementService. getNetworkTotalBytes is used
to query total bytes regarding to the specified NetworkPolicy,
to see how much data quota is used. getNetworkUidBytes is used
to find the app to blame for rapid data usage.

These methods needs to be replaced by public APIs in follow-up
patches.

Test: TH
Bug: 204830222
Change-Id: Iec9cc7a07397ec2bbc6c3d2559fc3680b149cb8a
2021-12-24 08:50:29 +00:00
Treehugger Robot
28c8ad15b6 Merge "Global settings for Bluetooth (Settings.Global.BLUETOOTH_ON) must be set to BLUETOOTH_ON_BLUETOOTH whenever non-BLE MESSAGE_ENABLE is handled irrespective of the state." 2021-12-24 06:10:12 +00:00
Treehugger Robot
eccbcfc72d Merge "Add shubang@ to OWNERS of media/tv" 2021-12-23 19:52:48 +00:00
joneckenrode
067ab51e9e Removed reference to developer guide from class description. Added some missing parameter and return descriptions.
Test: Reviewed compiled API documentation
Signed-off-by: joneckenrode <joneckenrode@google.com>
Change-Id: I01eb68d6c9e4849c63d9833baf8a1ba0b9982460
2021-12-23 18:47:38 +00:00
Amy Gu
c44f9be43b Fix typo.
Change-Id: I9c22f0810068eb94e7c9768b33045eea3f26e330
2021-12-23 17:48:34 +00:00
shubang
8dc2c25c30 Add shubang@ to OWNERS of media/tv
Test: make
Change-Id: If8ad81f302378ffea6fb6a238ea044e820224de4
2021-12-23 09:48:15 -08:00
Treehugger Robot
ad9f190680 Merge "am:fix format in OomAdjuster.md." 2021-12-23 10:08:09 +00:00
Shuo Qian
457bfa1180 Merge "Use Math.floor to convert RSSNR from ten db to DB" 2021-12-23 05:45:35 +00:00
Junyu Lai
d159c1ead7 Merge "[MS15.1] Remove get/setSubscriberIdMatchRule dependencies" 2021-12-23 01:35:00 +00:00
James Mattis
9ff27e5802 Merge changes from topic "railway_stub"
* changes:
  eth manager updates for network management APIs
  aidl and Parcelable defintions for eth management
2021-12-23 00:59:06 +00:00
Henry Fang
1d6f1c9d04 Merge "Add methods to get vendor extension interfaces" 2021-12-22 22:05:16 +00:00
Devin Moore
a188a10262 Merge "Use new AIDL IR interface for ConsumerIr service" 2021-12-22 21:44:17 +00:00
Jeff Sharkey
cd9e9c7d32 Merge "Add text folks for text related JNI files" 2021-12-22 20:23:17 +00:00
Seigo Nonaka
17d8705a0e Add text folks for text related JNI files
Test: N/A
Bug: N/A
Change-Id: Iffd637ecc0c86ee1d984fb6cb8cdeb49ba421ed2
2021-12-22 12:05:31 -08:00
James Mattis
3dd562abab eth manager updates for network management APIs
Private methods added to EthernetManager for network management to be
made public when ready.

Bug: 210485380
Test: make, flash and boot
Change-Id: I7f484d373e05225c98bf0e6111afdc12be31764f
2021-12-22 11:11:01 -08:00
James Mattis
e350f54f94 aidl and Parcelable defintions for eth management
aidl and Parcelable definitions neccessary for internal network
management APIs as related to ethernet interfaces.

Bug: 210485380
Test: make, flash and boot
Change-Id: I5908d21564014c56282dad001da441f5b900b523
2021-12-22 11:10:58 -08:00