660339 Commits

Author SHA1 Message Date
Lucas Lin
9d8001cea1 Merge "Update underlying networks if it is changed" 2022-01-05 03:21:45 +00:00
Dmitri Plotnikov
884e5d8456 Merge "Add BATTERY_STATS_OWNERS to all *Stats files" 2022-01-04 23:42:08 +00:00
Treehugger Robot
547654cab7 Merge "Don't remove SYSTEM_FIXED for intentional fixed grants to critical apps." 2022-01-04 23:34:38 +00:00
Dmitri Plotnikov
5e85751023 Add BATTERY_STATS_OWNERS to all *Stats files
Test: N/A
Change-Id: Ifb1865b2db902bf0cca1bde48a7381903dca229c
2022-01-04 15:31:01 -08:00
Chen Xu
ed021212d6 Merge "[MEP] eSIM API refactor to support MEP" 2022-01-04 18:50:09 +00:00
Treehugger Robot
6a5c5e23cc Merge "Add QUERY_AUDIO_STATE permission" 2022-01-04 17:55:01 +00:00
Sarah Chin
fa2dc0b7e4 Merge "Update unthrottleApn calls to take in DataProfile" 2022-01-04 17:27:41 +00:00
Treehugger Robot
6619bac824 Merge "Fix deadlock issue." 2022-01-04 17:08:52 +00:00
Treehugger Robot
302d0925da Merge "Fix typo in Javadoc." 2022-01-04 16:39:30 +00:00
jiayongqiang
d2280b8107 Fix deadlock issue.
It might cause deadlock sometimes:

The locking order of setEventsMask is:
    registerDisplayListener -> <DMG.mLock> -> setEventsMask -> <class lock>;

The Locking order of handleMessage is:
    Looper.loop -> Looper.loopOnce -> Handler.dispatchMessage -> handleMessage -> <class lock>;

Therefore, when the registerDisplayListener is called by client,
the DisplayListenerDelegate.handleMessage also called by DMS's callback,
at this time, if the method with DMG.mLock is called in handleMessage(),
it will lead to deadlock.

Test: (For example)
Thread A:
DisplayListenerDelegate.handleMessage() -> <class lock>
DisplayListener.onDisplayChanged() -> DMG.getCompatibleDisplay() ->
DMG.getDisplayInfo() -> <DMS.mLock>

Thead B:
DMG.registerDisplayListener() -> <DMS.mLock> -> DisplayListenerDelegate.setEventsMask() -> <class lock>

Signed-off-by: jiayongqiang <jiayongqiang@xiaomi.com>
Change-Id: Ie1a8728339c16fa8f4c4f5c758821c836fa1c96b
2022-01-04 18:29:45 +08:00
Hai Zhang
cc0a80895f Don't remove SYSTEM_FIXED for intentional fixed grants to critical apps.
See b/208785537#comment11.

Bug: 208785537
Bug: 206556385
Bug: 183537857
Bug: 208785537
Test: presubmit
Change-Id: Iaf5e2a0d86259805a9ef03f8f1baa14dd8c58da0
Merged-In: Iaf5e2a0d86259805a9ef03f8f1baa14dd8c58da0
(cherry picked from commit e6f07a4fb2b5f17aefb17df8e7d04dcc57fd0be9)
2022-01-04 09:22:05 +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
William Escande
d0ad455409 Add QUERY_AUDIO_STATE permission
Due to aosp/1863058, we need to add the associated permission

Bug: 190422401
Tag: #refactor
Test: None in this CL.
Change-Id: Id1809b85aca57929cba0197ba9d35f926dfeaf1b
2022-01-03 22:49:46 +01: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
sandeepjs
6afa68e472 [MEP] eSIM API refactor to support MEP
Newly added UiccPortInfo and UiccSlotMapping classes and introduced
UiccPortInfo as a port list in UiccCardInfo and UiccSlotInfo,
Deprecated some constructors and updated callers.
Test: build
Bug: 159354974
Change-Id: I71e4e1ef649b7301d126dde23d53783761de940f
Merged-In: I71e4e1ef649b7301d126dde23d53783761de940f
2022-01-03 12:12:52 +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
Jacinta Hu
35ecc5886c Fix typo in Javadoc.
A missing end brace was causing Javadoc to fail to parse one of the links.
Change-Id: I8e4ca3721d7d08b7094d142fef394f06a223428e
2021-12-31 00:15:50 +00: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
4036f73231 Update unthrottleApn calls to take in DataProfile
Test: atest FrameworksTelephonyTests
Bug: 208651109
Change-Id: I4e77e56296d6a9a8b1010167e260f4e9c1a40202
Merged-In: I4e77e56296d6a9a8b1010167e260f4e9c1a40202
2021-12-28 23:27:21 +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