Commit Graph

3295 Commits

Author SHA1 Message Date
Aaron Huang
484e857368 Add getters to NetworkStateSnapshot
Address API council feedback, add getters to NetworkStateSnapshot
instead of exposing the bare fields directly.

(cherry picked from ag/14233655)
Bug: 183972826
Test: FrameworksNetTests
Merged-In: Id1707753b42ae88d2b95e4bd00a792609434e4f5
Change-Id: Id1707753b42ae88d2b95e4bd00a792609434e4f5
2021-04-22 18:21:00 +08:00
junyulai
32631f5a6c [SP31] Expose onSetWarningAndLimit System API
Test: atest NetworkPolicyManagerServiceTest NetworkStatsServiceTest
Bug: 149467454
CTS-Coverage-Bug: 183598414
Merged-In: I6f5e22e3a7b80a38cae9f3c5d7296a1dff34facf
Change-Id: I6f5e22e3a7b80a38cae9f3c5d7296a1dff34facf
  (cherry-picked from ag/13981689 with fixed merged conflict)
2021-04-22 12:07:13 +08:00
junyulai
7d627db661 [SP29] Send interface warning bytes to NetworkStatsProvider
This change contains necessary modification in NPMS and NSS
to send warning bytes to NetworkStatsProvider. But since
no any provider has been upgraded to handle such parameter.
Thus, no behavior change is made in this patch.

Test: atest NetworkPolicyManagerServiceTest NetworkStatsServiceTest
Test: atest NetworkPolicyManagerServiceTest#testStatsProviderWarningAndLimitReached
Bug: 149467454
Bug: 170699770
Bug: 170179169
Merged-In: I6c4863030c36328db571294fd12a40e59864def5
Change-Id: I6c4863030c36328db571294fd12a40e59864def5
  (cherry-picked from ag/13982166)
2021-04-22 12:07:12 +08:00
junyulai
57d1c1bf53 [SP28] Add API for set data warning
To have better control and race-free of set data warning
to tether offload hardware, an interface of set warning and
limit at the same time in the NetworkStatsProvider is needed.

This is a no-op change which expose such interface with minimum
changes in service side to get build pass. The implementation
would be included in follow-up patches.

Test: atest NetworkStatsServiceTest
Test: atest NetworkPolicyManagerServiceTest
Test: atest GtsNetworkStackHostTestCases
Test: m doc-comment-check-docs
Bug: 149467454
Bug: 170699770
Bug: 170179169
Merged-In: I6ee661497f7dedb871c85786d1950cab951d8aa2
Change-Id: I6ee661497f7dedb871c85786d1950cab951d8aa2
  (cherry-picked from ag/13959436)
2021-04-22 12:07:12 +08:00
Aaron Huang
b8bb61a90b Merge "Add getters to UnderlyingNetworkInfo" into sc-dev 2021-04-22 03:09:41 +00:00
Nazanin Bakhshi
3701988a10 Merge "Security fix: enforce read privilege permission to check package privileges in TelephonyManager" into sc-dev 2021-04-21 22:04:04 +00:00
Nazanin
9ea496b0ae Security fix: enforce read privilege permission to check package
privileges in TelephonyManager

Bug: 180938364
Test: cts
Change-Id: I08c346c46b9e87dceaa1faf35fa36b954d88f9b0
2021-04-20 14:27:20 -07:00
Aaron Huang
80a4d561a3 Add getters to NetworkStateSnapshot
Address API council feedback, add getters to NetworkStateSnapshot
instead of exposing the bare fields directly.

Bug: 183972826
Test: FrameworksNetTests
Change-Id: Id1707753b42ae88d2b95e4bd00a792609434e4f5
2021-04-20 21:55:56 +08:00
Aaron Huang
69c1f216b1 Add getters to UnderlyingNetworkInfo
Address API review feedback, add getters to UnderlyingNetworkInfo
instead of exposing fields.

Instead of wasting memory by converting this into an array, have
migrateTun take a List<String>. In turn, tunAdjustmentInit should
also take a List<String>.

Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Change-Id: Id59744097208d91298a25ef110ade91a9cf291a1
2021-04-20 13:34:52 +08:00
lesl
f9707258ed wifi data usage: support to get carrier merged wifi network.
Carrier merged wifi network is a specific cerrier wifi network
which provides the same user experience as mobile.

To support data usage accounting for carrier merged wifi,
the change provide several APIs in NetworkTemplate:

  1. extend buildTemplateWifi so it could be used for matching
     wifi networks with subscriber Id (IMSI).
  2. add buildTemplateCarrier to let
     NetworkPolicyManagerService creates a single policy for
     a given carrier regardless of network type.

Bug: 176396812
Test: atest -c NetworkTemplateTest
Test: atest -c NetworkStatsServiceTest
Test: Manual Test with test code on mobile and wifi network.
      1. buildTemplateCarrier includes the carrier wifi and
         mobile usage
      2. buildTemplateWifi can get carrier wifi usage and support the
         filter via subscriberId

Change-Id: I667b4adf3eec0bdd3a7385109dd8c1fae8e7be32
2021-04-19 16:13:27 +08:00
Paul Hu
e13ee7a0a2 Merge "Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT" into sc-dev 2021-04-13 02:05:21 +00:00
Chiachang Wang
7381541282 Merge "Resolve hidden connectivity methods dependency" into sc-dev 2021-04-12 00:37:09 +00:00
Chiachang Wang
ae6367012a Resolve hidden connectivity methods dependency
This commit resolves the dependency under batterystatstests,
servicestests and coretests with hidden connectivity module codes.
Because of connectivity modularization work, the hidden connectivity
methods are not accessible outside modules. Update tests with
alternative ways.

Bug: 182859030
Test: atest
Change-Id: I8294ae4167ee5f95137e0be0f7464429ed3f3322
2021-04-09 18:31:39 +08:00
paulhu
4e878ad3f3 Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT
As API review feedback, rename Build#VERSION#FIRST_SDK_INT to
Build#VERSION#DEVICE_INITIAL_SDK_INT. As well as update all usage
in frameworks and tests.

Bug: 184735771
Test: m
Change-Id: I72660959cb4e638a8e80fcf2f4e96ea172969f44
2021-04-09 15:47:36 +08:00
Treehugger Robot
2ab2e596cc Merge "Add documentation on EthernetNetworkSpecifier API" am: 682a98d823 am: 7d93a243b7 am: ca083253e8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669186

Change-Id: I350d4b3d3c3b146f48480475a21b5dbe718ffc36
2021-04-09 02:37:18 +00:00
Treehugger Robot
ca083253e8 Merge "Add documentation on EthernetNetworkSpecifier API" am: 682a98d823 am: 7d93a243b7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669186

Change-Id: I8c8cd85bed535a868a55ec82721b35738efa4ae1
2021-04-09 02:29:15 +00:00
Treehugger Robot
7d93a243b7 Merge "Add documentation on EthernetNetworkSpecifier API" am: 682a98d823
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669186

Change-Id: I3ce2800bf2719b22c16c227dc3ded9a7db8f62c7
2021-04-09 02:03:01 +00:00
Remi NGUYEN VAN
5b5b782644 Add documentation on EthernetNetworkSpecifier API
Add javadoc on the constructor and getInterfaceName method.

Fixes: 182979732
Test: m
Change-Id: Iced805149a8344b953331501b48184661be0053a
2021-04-08 15:32:08 +09:00
Aaron Huang
d02ec08f01 [automerger skipped] Merge changes I5ed1bc8b,Ie9e6af0e am: 834026197f am: 3194606bc9 am: 5b889c7ee9 -s ours
am skip reason: skip tag Change-Id I5ed1bc8bc8bee5b0c795fd8577a2d64628998e51 with SHA-1 2c6db2fa85 is already in history

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

Change-Id: Id8ab6d21ab2ffab8932ceab53ddd1fdb8da8f800
2021-04-06 15:26:50 +00:00
Aaron Huang
e1c6d759ef [automerger skipped] Migrate hidden API in IpConfigStore to formal API am: 481a85d41f am: e9a8490c15 am: 1c4d44157e -s ours
am skip reason: skip tag Change-Id Ie9e6af0efe2c39667bb8faa1e3a498b1f61e1432 with SHA-1 7a47069896 is already in history

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

Change-Id: I91ca8eea0961a388e5a13bdeba39962c5d170d98
2021-04-06 15:26:40 +00:00
Aaron Huang
5b889c7ee9 Merge changes I5ed1bc8b,Ie9e6af0e am: 834026197f am: 3194606bc9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645290

Change-Id: Ia0f9ad67aaf675e8190d52e5814dbe855021a8b3
2021-04-06 14:41:28 +00:00
Aaron Huang
1c4d44157e Migrate hidden API in IpConfigStore to formal API am: 481a85d41f am: e9a8490c15
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1577123

Change-Id: I7ef352c7213864ee2ff99c5a2517fb1b9e68d1d2
2021-04-06 14:41:24 +00:00
Aaron Huang
3194606bc9 Merge changes I5ed1bc8b,Ie9e6af0e am: 834026197f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645290

Change-Id: I9fe40b60f31f0897f8cb62a39787536cd5524157
2021-04-06 14:06:51 +00:00
Aaron Huang
e9a8490c15 Migrate hidden API in IpConfigStore to formal API am: 481a85d41f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1577123

Change-Id: I218559824dc81cc1b57f17ef43f3fb29ec0fc4f5
2021-04-06 14:03:54 +00:00
Aaron Huang
c6cb931f32 Fix IpConfigStore dependencies on framework-connectivity
This change fixes IpConfigStore dependencies on framework-connectivity
hidden APIs.
- Use the version of SystemApi to new RouteInfo.
- Inline the implementation of isIPv4Default() directly because
  isDefaultRoute() is a public API so it can be used in this class.

(cherry-picked from ag/13945685)
Bug: 178777253
Test: FrameworksServicesTests:IpConfigStoreTest
Merged-In: I5ed1bc8bc8bee5b0c795fd8577a2d64628998e51
Change-Id: I5ed1bc8bc8bee5b0c795fd8577a2d64628998e51
2021-04-06 07:18:06 +00:00
Aaron Huang
481a85d41f Migrate hidden API in IpConfigStore to formal API
IpConfiguration and StaticIpConfiguration are included
in framework-connectivity which cannot have external
hidden API usages dependencies on them. IpConfiguration
and StaticIpConfiguration provide builder and getter
methods for the fields of the objects which are formal APIs.
So, replace the usages in IpConfigStore with those formal
APIs to remove the dependencies.

(cherry-picked from ag/13929104)
Bug: 178777253
Test: FrameworksServicesTests:IpConfigStoreTest
Merged-In: Ie9e6af0efe2c39667bb8faa1e3a498b1f61e1432
Change-Id: Ie9e6af0efe2c39667bb8faa1e3a498b1f61e1432
2021-04-06 07:13:56 +00:00
Les Lee
0b544ea954 Merge "Fix Wi-Fi SSID null handling" am: cadd76044e am: e7ac82b9a3 am: d5ca61de3f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624059

Change-Id: Iefb2bd39b51072cda3d4239e031ab00bd2e6f5c4
2021-04-06 06:10:38 +00:00
Les Lee
d5ca61de3f Merge "Fix Wi-Fi SSID null handling" am: cadd76044e am: e7ac82b9a3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624059

Change-Id: I9dacf92104c544f9ed12dc6fa60e4895ab228cbd
2021-04-06 05:24:54 +00:00
Les Lee
e7ac82b9a3 Merge "Fix Wi-Fi SSID null handling" am: cadd76044e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624059

Change-Id: I92537bac7a2762a74a1df051efa1600fdf381eeb
2021-04-06 04:42:57 +00:00
lesl
b0e21ab9af Fix Wi-Fi SSID null handling
When Wi-Fi SSID is null in NetworkCapabilities,
get Wi-Fi SSID from connection info (WifiInfo) which is non-null design.

Bug: 176396812
Test: FrameworksNetTests NetworkPolicyManagerServiceTest
Change-Id: I59c7d8f7e176d0c6bb100721269f3f6165f0ca21
2021-03-30 23:57:56 +08:00
Junyu Lai
ea9d557d74 [automerger skipped] Merge "[SP31] Expose onSetWarningAndLimit System API" am: 24a5630161 am: c903776d23 am: ecf81a98bd -s ours
am skip reason: skip tag Change-Id I6f5e22e3a7b80a38cae9f3c5d7296a1dff34facf with SHA-1 a22175603b is already in history

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

Change-Id: I6b291378c413fada7299afa2c4243dc7afc0b5be
2021-03-30 09:45:01 +00:00
Junyu Lai
ecf81a98bd Merge "[SP31] Expose onSetWarningAndLimit System API" am: 24a5630161 am: c903776d23
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625864

Change-Id: I022b2d130729f31fbd3fe8edaec6c998cdcd2aa4
2021-03-30 09:00:57 +00:00
Junyu Lai
c903776d23 Merge "[SP31] Expose onSetWarningAndLimit System API" am: 24a5630161
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625864

Change-Id: I7a95af1d2879fce22e1e644923661ccbc2253f26
2021-03-30 08:19:25 +00:00
Junyu Lai
24a5630161 Merge "[SP31] Expose onSetWarningAndLimit System API" 2021-03-30 08:00:45 +00:00
Junyu Lai
e6d2d64477 [automerger skipped] Merge "[SP29] Send interface warning bytes to NetworkStatsProvider" am: f60f4abb74 am: b4d15aa0b4 am: 97695a7d1d -s ours
am skip reason: skip tag Change-Id I6c4863030c36328db571294fd12a40e59864def5 with SHA-1 0141e8f8f8 is already in history

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

Change-Id: Ifbd33d77e0f2f3ddff5191589f6e3a958b01284f
2021-03-30 04:00:50 +00:00
Junyu Lai
97695a7d1d Merge "[SP29] Send interface warning bytes to NetworkStatsProvider" am: f60f4abb74 am: b4d15aa0b4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1470723

Change-Id: I6d799819362fd7d89b6be691d15c49314c867734
2021-03-30 03:30:15 +00:00
Junyu Lai
b4d15aa0b4 Merge "[SP29] Send interface warning bytes to NetworkStatsProvider" am: f60f4abb74
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1470723

Change-Id: I9004a9af67fffc90c1d9f8ff18448d2258caf5ba
2021-03-30 03:10:57 +00:00
Junyu Lai
f60f4abb74 Merge "[SP29] Send interface warning bytes to NetworkStatsProvider" 2021-03-30 02:56:25 +00:00
Junyu Lai
97a9b098d4 [automerger skipped] Merge "[SP28] Add API for set data warning" am: f30b5cc765 am: d688859687 am: dbccab20de -s ours
am skip reason: skip tag Change-Id I6ee661497f7dedb871c85786d1950cab951d8aa2 with SHA-1 00f7776ec2 is already in history

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

Change-Id: I9c0734c571f46d0211fe013198d37defe323fd62
2021-03-29 12:57:39 +00:00
Junyu Lai
dbccab20de Merge "[SP28] Add API for set data warning" am: f30b5cc765 am: d688859687
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1469125

Change-Id: I43fa10034699732b6091fe290a4e064478c8a0e1
2021-03-29 12:12:19 +00:00
Junyu Lai
d688859687 Merge "[SP28] Add API for set data warning" am: f30b5cc765
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1469125

Change-Id: Ibdf919a762952350dc89bda59724b2f0cb291313
2021-03-29 11:30:37 +00:00
Junyu Lai
f30b5cc765 Merge "[SP28] Add API for set data warning" 2021-03-29 11:06:05 +00:00
Junyu Lai
548cdb8f43 Merge "Support Dual ViLTE stats" am: f7d1e337c0 am: 2c0063b321 am: 5f62de9322
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540920

Change-Id: I5739265c2747055b0252da7d1fb9e47d61ca111c
2021-03-29 09:05:02 +00:00
Junyu Lai
5f62de9322 Merge "Support Dual ViLTE stats" am: f7d1e337c0 am: 2c0063b321
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540920

Change-Id: Iaa7d8d3dcb106cd19777fe1ff64db5ab4ea75991
2021-03-29 08:26:07 +00:00
Junyu Lai
2c0063b321 Merge "Support Dual ViLTE stats" am: f7d1e337c0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540920

Change-Id: Ie65e2a2530b3e10b1cb7b571bbe4e7255caf1b08
2021-03-29 07:37:34 +00:00
Junyu Lai
f7d1e337c0 Merge "Support Dual ViLTE stats" 2021-03-29 06:59:19 +00:00
Lucas Lin
955ad85646 [automerger skipped] Merge changes I6d5dd0a8,I106b3e4f am: 6f244a30bc am: f80bb2661d am: e84279a36a -s ours
am skip reason: skip tag Change-Id I6d5dd0a8c3879df7bdc1d58e36022045c303bb40 with SHA-1 f16d4995f4 is already in history

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

Change-Id: I3d8237e0619f7a63e3290609b9c9158d47d5830d
2021-03-25 13:06:52 +00:00
Lucas Lin
df1edaa442 [automerger skipped] Merge "Use getAllInterfaceNames to get all interface names" am: c4c056b647 am: cc86d88f8f am: e3948a3016 -s ours
am skip reason: skip tag Change-Id Id2b19dc5099355af69d23a6d99d2b7e6c0e1e88a with SHA-1 4249f3b868 is already in history

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

Change-Id: I42520f8831d37b49a4c8d96d0db0092b9ed90ad0
2021-03-25 13:05:36 +00:00
Lucas Lin
e84279a36a Merge changes I6d5dd0a8,I106b3e4f am: 6f244a30bc am: f80bb2661d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653932

Change-Id: Ic04621eaa36aa0b2837dced4730d32f415f8dc13
2021-03-25 12:22:16 +00:00
Lucas Lin
e3948a3016 Merge "Use getAllInterfaceNames to get all interface names" am: c4c056b647 am: cc86d88f8f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653937

Change-Id: I2a51fc361a3ef6fe7a99fe70e8c47fdffa2903bd
2021-03-25 12:21:20 +00:00