summaryrefslogtreecommitdiff
path: root/framework-t/src/android/net/NetworkStats.java
Commit message (Collapse)AuthorAgeFilesLines
* Hold wifi and mobile interfaces since boot in NetworkStatsServiceAaron Huang2022-06-031-0/+11
| | | | | | | | | | | | | | | In current design, the interface will be removed from the list if the network disconnected which will cause getUidStatsForTransport() returns unexpected snapshot to caller since the list is empty. This change also remove interface name from all entries before the method returns the result. Ignore-AOSP-First: non-AOSP CL is included in the same topic Bug: 231514741 Test: FrameworksNetTests manual test Change-Id: Ie60829a65d0d9b5b63ad353695a820c0586e3665
* Make some NetworkStats APIs system-currentjunyulai2022-03-301-25/+1
| | | | | | | | | | | Move iterator and NetworkStats.Entry getters to system-current according to API council feedback. This reverts parts of ag/17117903. Ignore-AOSP-First: Parent CLs does not exist in aosp yet. Test: TH Fix: 225168182 Change-Id: Ia7fdf8d31a96a26b0bf1682f462292b051560477
* [MS83.1] Make some APIs module-lib instead of system currentjunyulai2022-03-161-5/+31
| | | | | | | | | | | | | 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
* Let docs tool to list the newly-visible IntDef valuesAaron Huang2022-03-111-17/+8
| | | | | | | | | | | Some *_ALL constants are exposed in T and they should be mentioned in documentation. Because there are already defined InDef values for this kind of constants. Thus, remove the list in the javadoc and leave these up to the doc tool to list the InDef values. Bug: 222291452 Test: m doc-comment-check-docs Change-Id: Ibbaee5389a85bb3d696a518deea0897845553bfa
* Merge "Check iface by TextUtils.equals"Aaron Huang2022-02-221-1/+2
|\
| * Check iface by TextUtils.equalsAaron Huang2022-01-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | In current equals method, if iface is null then it will cause null object reference when checking iface. Thus, use TextUtils.equals to check iface so that it can compare null iface. Bug: 210073043 Test: FrameworksNetTests, NetworkStaticLibTests Change-Id: I2bd8127cb030ea54438382ee89961590fffbc31a
* | Have NetworkStats implements iterableAaron Huang2022-01-191-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | Make NetworkStats be iterable and expose iterator as system API which is better than expose size() and getValues(). This API could be used by the caller who needs to get entry from NetworkStats. Bug: 210073043 CTS-Coverage-Bug: 215061403 Test: build, TH Change-Id: I6cb4c8f63d7067133f2722b2be7e16b4098a697d
* | Add getter for the fields of NetworkStats.EntryAaron Huang2022-01-171-1/+90
|/ | | | | | | | | | | | | | NetworkStats is going to be moved into mainline module and there're some external callers have dependencies on it. To replace those hidden APIs with formal APIs, NetworkStats needs to expose some getter methods to eliminate the dependencies on hidden API. Bug: 210073043 Bug: 204830222 CTS-Coverage-Bug: 214881138 Test: FrameworksNetTests Change-Id: I85bb6b27bd17bad16c9693d95b569d0ec5fbb785
* [MS09] Expose NetworkTemplate APIs which are needed by NetworkPolicyJunyu Lai2022-01-061-19/+4
| | | | | | | | | This change also remove getWifiNetworkKey which should not be exposed as system API. Test: atest NetworkTemplateTest Bug: 204830222 Change-Id: I924f62025a8672167f778ff790cd208c74eed878
* [MS19.1] Fix several hidden API dependenciesJunyu Lai2021-12-281-3/+3
| | | | | | | | | | | | | | | | 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
* [MS10.1] Move multiplySafeByRational to NetworkStatsUtilsJunyu Lai2021-12-201-1/+1
| | | | | | | | | | | | Since NetworkStats related code will be moved to the module. multiplySafeByRational in the NetworkUtilsInternal cannot be accessed after that. Thus, create another utils class that will be moved with NetworkStats code and put the function into it. Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.NetworkStatsUtilsTest Bug: 204830222 Change-Id: I96f3ac02e57b7325ed53988285770f478dee529e
* [MS08] Move NetworkStats files to f/b/package/ConnectivityTJunyu Lai2021-12-101-0/+1738
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