summaryrefslogtreecommitdiff
path: root/framework-t/src/android/app
Commit message (Collapse)AuthorAgeFilesLines
* [MS83.1] Make some APIs module-lib instead of system currentjunyulai2022-03-162-32/+91
| | | | | | | | | | | | | Some of the internal classes are not available for priv-apps. Thus, make them module-lib instead. This change also adds some nullability annotations for existing APIs according to go/android-api-guidelines. Test: m Test: m frameworks-base-api-system-current-compat Fix: 217479745 Change-Id: I18de46b11df7232ab82b9465856fdde621283156
* Rename setUidForeground to noteUidForegroundAaron Huang2022-03-101-2/+2
| | | | | | | | | | This patch addresses API review about the naming of NetworkStatsManager#setUidForeground and it would be more appropriate to rename it to noteUidForeground. Bug: 222291301 Test: atest FrameworksNetTests Change-Id: I952762872850889609c9808aa6e3cdfc04317806
* Merge "[MS68.3] Address comments at aosp/1958144"Frank Li2022-03-031-2/+6
|\
| * [MS68.3] Address comments at aosp/1958144Frank2022-03-021-2/+6
| | | | | | | | | | | | | | | | | | | | Test: atest TrafficStatsTest NetworkUsageStatsTest FrameworksNetTests Bug: 204830222 (cherry-picked from ag/16813003) Change-Id: I5a54b44294021d64d8506eeb570db0db8544472a Merged-In: I5a54b44294021d64d8506eeb570db0db8544472a
* | [DU03-4]Add NETWORK_STACK Permission check for NetworkStatsService APIFrank2022-03-021-2/+6
|/ | | | | | | | | | | | | 1. getUidStatsForTransport API Bug: 210066922 Test: atest BatteryStatsImplTest WifiPowerCalculatorTest MobileRadioPowerCalculatorTest NetworkStatsServiceTest (cherry-picked from ag/16816095) Change-Id: I022c34b5af87fe3ff6857ea264bac2f7098eaed4 Merged-In: I022c34b5af87fe3ff6857ea264bac2f7098eaed4
* Add setPollForce to module APIRemi NGUYEN VAN2022-02-181-3/+6
| | | | | | | | | | | The API was test API in S, but this is not supported in module API surfaces. Make it module API instead. Bug: 197717846 Test: Tests already using this API (cherry-picked from ag/16780943) Change-Id: I9d44b761572f94b08b269478c4a0c20c1171343c Merged-In: I9d44b761572f94b08b269478c4a0c20c1171343c
* [MS59.3] Expose NetworkStatsDataMigrationUtilsjunyulai2022-01-281-8/+4
| | | | | | Test: TH Bug: 204830222 Change-Id: I15a45fbadeb69b70a0e983b00de9e934d29749d6
* Move the implement of getAllCollapsedRatTypes to StatsPullAtomServiceAaron Huang2022-01-271-0/+48
| | | | | | | | | | | To make data usage as a mainline module, move getAllCollapsedRatTypes to StatsPullAtomService since currently it is the only user. Also, the method needs to call getCollapsedRatType, thus move getCollapsedRatType to NetworkStatsManager and expose it as module API. Bug: 210073043 Test: builds, FrameworksNetTests Change-Id: Ibe41b50f173464694c21dd22841552bdb69a6a14
* Move NETWORK_TYPE_5G_NSA from NetworkTemplate to NetworkStatsManagerAaron Huang2022-01-271-0/+12
| | | | | | | | | Move NETWORK_TYPE_5G_NSA to NetworkStatsManager. Also expose it as module API so that it can be used out of module. Bug: 210073043 Test: builds, FrameworksNetTests Change-Id: I670c7e1405107bbe30b92fe1a8d81652c46de6d9
* [MS68.1] Register usage callback from NetworkPolicyManagerServicejunyulai2022-01-241-1/+2
| | | | | | | | Use usage callback to replace the need of intent receiver. Test: atest TrafficStatsTest NetworkUsageStatsTest FrameworksNetTests Bug: 204830222 Change-Id: I40967c2b6c86d25c7db93e6d3a4908b72ed76154
* [MS67.1] Expose registerUsageCallback with templatejunyulai2022-01-241-53/+92
| | | | | | Test: atest FrameworksNetTests Bug: 204830222 Change-Id: I643e2d96144210852fc8916ec9c483f2b207a48b
* [MS66] Initialize TrafficStats with contextJunyu Lai2022-01-221-0/+5
| | | | | | | | | | | | | | | | | | | | | TrafficStats has static methods created in API level 8 that need access to NetworkStatsManager but doesn't take a context. Previously this was achieved by using ServiceManager, but with TrafficStats moving to the connectivity module, this is no longer possible. Instead, make sure TrafficStats has an appropriate context by the time any client code can call the relevant methods. • In app code, this achieved by passing the application context from ActivityThread#handleBindApplication, before any app code can run. • In the system server, this is achieved by passing the context right after creating service. Test: atest TrafficStatsTest CtsWebkitTestCases Bug: 204830222 Change-Id: I251bb8a4431ad12ff61929879ef1363cf06b9244
* [DU03-1]Remove INetworkStatsService from BatteryStatsImpllifr2022-01-211-14/+38
| | | | | | | | | | | | | | | Expose systemapi NetworkStats.getDetailedUidStats for use by BatteryStats. BatteryStatsImpl is using INetworkStatsService APIs, which cannot be accessed after moving into the mainline module. So, replace and remove those hidden API usages. Bug: 210066922 Test: atest BatteryStatsImplTest WifiPowerCalculatorTest MobileRadioPowerCalculatorTest NetworkStatsServiceTest CTS-Coverage-Bug: 213437796 Change-Id: I40d713923278f4654d67bb4d12155cea85c10447
* [MS57.1] Prepare APIs for data migration utilityJunyu Lai2022-01-201-0/+13
| | | | | | | | | | | | | | This includes: 1. Move PREFIX_* constants to NetworkStatsManager to expose in later changes. 2. Rename networkId to wifiNetworkKey. 3. Rename subType to ratType. 4. Replace SUBTYPE_COMBINED with NETWORK_TYPE_ALL 5. Fix lint errors when exposing system api. Test: TH Bug: 204830222 Change-Id: I2b7c34958bc59c3225c96f12abba008b83101585
* [MS45] Expose SystemApis to query summary and history with templateJunyu Lai2022-01-201-5/+10
| | | | | | | | | | | | | | | | | | This includes: 1. queryDetailsForDevice: get history of network stats that matches the given template. 2. querySummaryForDevice: similar to the above one, but the result is aggregated over time. 3. queryDetailsForUidTagState: get history of uid stats that matches the given template, uid, tag and other conditions. 4. querySummary: similar to the above one, but the result is aggregated over time. 5. queryTaggedSummary: similar to the above one, but only return tagged data. Test: TH Bug: 204830222 Change-Id: Ic18010822a33e340b954e9c53dc515f3b6224d6d
* [MS41.1] Prepare for APIs for querying usage with templateJunyu Lai2022-01-202-10/+91
| | | | | | | | | | | | | | | | This CL includes: 1. Prepare for queryDetailsForDevice which allows callers to query history of networks that matches the given template. 2. Prepare for queryDetailsForUidTagState, which allows callers to query history uid stats with the given template, uid and other conditions. 3. Enforce fine location permission if the caller is querying data usage with a template which contains wifi network keys. Test: atest NetworkStatsServiceTest NetworkStatsManagerTest Bug: 204830222 Bug: 200768422 Change-Id: I6783d6bfd6e075e0b3ec8a3c91836377f1d71c7a
* [MS37.1] Expose APIs which is used by NPMSJunyu Lai2022-01-191-9/+25
| | | | | | | Test: TH Bug: 204830222 CTS-Coverage-Bug: 213124616 Change-Id: I16418791246b12fc3da7348ed36b58274e20db54
* [MS37] Replace NetworkStatsManagerInternal usages in NPMSJunyu Lai2022-01-151-0/+70
| | | | | | | | | | | | | This is done by: 1. Add NetworkStatsManagerInternal APIs directly from NetworkStatsManager, these APIs are needed by NPMS. 2. Replace all usages with these APIs. 3. Delete NetworkStatsManagerInternal implementation. Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest Bug: 204830222 CTS-Coverage-Bug: 213124616 Change-Id: If51b6676915e3a0a8a9f95221d735306911442fc
* [MS35] Remove getNetwork[Total|Uid]Bytes dependencies from NPMSJunyu Lai2022-01-151-1/+9
| | | | | | | | | | | | | | | | | | 1. getNetworkTotalBytes was used for querying overall statistics that regards of the NetworkPolicy to calculate the remaining data warning/limit quota that needs to be send to the lower layer. 2. getNetworkUidBytes was used for querying overall statistics of apps to find out the rapid traffic that caused by an abnormal app behavior. This change replaces getNetwork[Total|Uid]Bytes with APIs that are about to expose, and introduces a dependencies object for better unit test injection. Test: atest NetworkPolicyManagerServiceTest Bug: 204830222 Change-Id: I802d2316fb22886e951456df0941c09176c981f8
* Merge "[MS44.1] Add API to query tagged UID summary"Junyu Lai2022-01-132-1/+43
|\
| * [MS44.1] Add API to query tagged UID summaryJunyu Lai2022-01-132-1/+43
| | | | | | | | | | | | | | | | | | | | | | Query tagged UID summary is currently needed by StatsPullAtomService to collect tagged traffic statistics. Add an Api via NetworkStatsManager to support this functionality. Test: atest NetworkStatsManagerTest Bug: 204830222 Change-Id: Iaa54482a8109b56e66e829c5bec5a8a8f466641a
* | [DU03]Remove INetworkStatsService from BatteryStatsImpllifr2022-01-121-0/+26
|/ | | | | | | | | | | | | | | | BatteryStatsImpl is using INetworkStatsService APIs, which cannot be accessed after moving into the mainline module. So, replace and remove those hidden API usages. Bug: 210066922 Test: atest BatteryStatsImplTest WifiPowerCalculatorTest MobileRadioPowerCalculatorTest CTS-Coverage-Bug: 213437796 (cherry-picked from ag/16548638) Change-Id: I584897ff8ba303c717a9df3756c9f6778c1cfb10 Merged-In: I584897ff8ba303c717a9df3756c9f6778c1cfb10
* Merge "[MS21] Remove DataUnit dependency"Treehugger Robot2021-12-291-2/+1
|\
| * [MS21] Remove DataUnit dependencyJunyu Lai2021-12-291-2/+1
| | | | | | | | | | | | | | | | | | | | 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
* | Merge "[MS19.1] Fix several hidden API dependencies"Treehugger Robot2021-12-291-3/+5
|\|
| * [MS19.1] Fix several hidden API dependenciesJunyu Lai2021-12-281-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | [MS18] Augment data usage by defaultJunyu Lai2021-12-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | [MS16.1] Prepare APIs for replacing getNetwork[Total|Uid]BytesJunyu Lai2021-12-241-18/+69
|/ | | | | | | | | | | | | | | 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
* [MS03] Remove ServiceNotFoundException hidden API usageJunyu Lai2021-12-131-11/+0
| | | | | | | | | | | Since ServiceNotFoundException is not a system API. Remove the unsupported interface which uses this exception. This is safe since the method annotated with maxTargetSdk = R and from dashboard it is not using by anybody. Test: TH Bug: 204830222 Change-Id: Ib8c0ce7b165732d24929851792d35371b90a5dfc
* [MS08] Move NetworkStats files to f/b/package/ConnectivityTJunyu Lai2021-12-102-0/+1484
NetworkStatsService is going to be moved into ConnectivityService module. Move all related files to packages/ConnectivityT so that it can be easily migrate these files to connectivity module after clearing the hidden API usages. Bug: 197717846 Test: TH Change-Id: Iead00832b5eb7b1dc40a92027c5a14ae8316b16c