Commit Graph

921 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
7251eb2f0c Merge "Set ParseException constructors as public" am: a2a324f843
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669051

Change-Id: I418a1682eb64b2b54defa37ce12ffdf5aa805b64
2021-04-09 01:13:41 +00:00
Remi NGUYEN VAN
e5bc9e1aa1 Merge "Replace fields with getters in keepalive API" am: 445fd7e9d9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669345

Change-Id: I339284a9f509d970a8c20f4738e42b25ca05c28c
2021-04-09 01:11:20 +00:00
Remi NGUYEN VAN
6e9d84438c Merge "Add RequiresPermission to TestNetworkManager" am: 58a22b1d8f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669187

Change-Id: I3ea1379e439a1dfda99e9332275ea38efed86f4f
2021-04-09 01:08:42 +00:00
Remi NGUYEN VAN
dae21e8596 Merge "Use String in CaptivePortalData underlying types" am: 55d93ddb7e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644997

Change-Id: If054ef1739a273e4a203be44675d3b410784dedf
2021-04-09 01:00:10 +00:00
Chiachang Wang
1091a06338 Make getUid a method on UserHandle itself instead of static
This commit addresses the API review feedback that getUid()
will be better to make it be a method on UserHandle itself
rather than a static method.

Update as it is and update the corresponding usages.

Fix: 184735865
Test: make update-api
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I33844309224d84764704255d251fadc8940202ca
2021-04-09 08:33:07 +08:00
Remi NGUYEN VAN
3b4f0832bd Merge "Improve documentation on simulateDataStall" 2021-04-09 00:21:34 +00:00
Remi NGUYEN VAN
a2a324f843 Merge "Set ParseException constructors as public" 2021-04-09 00:20:33 +00:00
Remi NGUYEN VAN
445fd7e9d9 Merge "Replace fields with getters in keepalive API" 2021-04-09 00:20:13 +00:00
Remi NGUYEN VAN
58a22b1d8f Merge "Add RequiresPermission to TestNetworkManager" 2021-04-09 00:19:51 +00:00
Remi NGUYEN VAN
7391a9ce21 Merge "Make service-connectivity APEX-only" into sc-dev 2021-04-09 00:18:35 +00:00
Remi NGUYEN VAN
55d93ddb7e Merge "Use String in CaptivePortalData underlying types" 2021-04-09 00:17:59 +00:00
James Mattis
148043b2a0 Merge "Adding OEM Network Preferences for testing" am: ee638e2670 am: bad8f6262f am: c4c1b9c820
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1659163

Change-Id: Ia028efd68ae8ce229c5382dc4798671da9124a5b
2021-04-08 22:58:14 +00:00
James Mattis
c4c1b9c820 Merge "Adding OEM Network Preferences for testing" am: ee638e2670 am: bad8f6262f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1659163

Change-Id: I982301cdaf36457d1adecbcda1ffa6457fd3bfab
2021-04-08 22:11:04 +00:00
James Mattis
bad8f6262f Merge "Adding OEM Network Preferences for testing" am: ee638e2670
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1659163

Change-Id: I14a27b3b9e7dad67fe9ca275527926e63d465b9a
2021-04-08 21:29:36 +00:00
James Mattis
ee638e2670 Merge "Adding OEM Network Preferences for testing" 2021-04-08 20:51:05 +00:00
Chalard Jean
ff4e69f2be Add doc for NetworkScore#getLegacyInt
Test: comment-only change
Fixes: 184786246
Change-Id: I8306f01f3d247986683e272074047e3ad190f68e
2021-04-08 13:52:40 +00:00
Remi NGUYEN VAN
495d9ba693 Use String in CaptivePortalData underlying types
The venue friendly name comes from the network, and only plain strings
should be used in practice. writeCharSequence is also not usable in
CaptivePortalData, as it must build using module_api.

Use a String as the underlying type in CaptivePortalData, keeping
CharSequence in the API for consistency with UI-related elements.

This brings CaptivePortalData in line with downstream branches.

Bug: 183174863
Test: atest FrameworksNetTests
Merged-In: Ifa3ea9aae0cabf5757791c4ae13e6f551759ed97
Change-Id: Ic662d3b546d52f825f9c3a24c5e0d4ba03818ab0
2021-04-08 08:23:20 +00:00
Aaron Huang
44c5e1fb51 [automerger skipped] Merge "Remove Network, NetworkRequest metrics from jobscheduler" am: 40a440f0dc am: 26ebda35aa am: ad8412de63 -s ours
am skip reason: skip tag Change-Id Ie0c540303ba06b8fba029d2b98ae753afb08c963 with SHA-1 967f77c269 is already in history

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

Change-Id: I5d2e532792b6abf0c35968f136c16a418ad2b380
2021-04-08 07:56:06 +00:00
Paul Hu
324810d572 Merge "Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager" am: ed4117ff40 am: 2cac9e94ba am: 21dbcf362f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667080

Change-Id: I5fd350d67065211b84dbea769d258daff9780276
2021-04-08 07:48:14 +00:00
Remi NGUYEN VAN
564f7f8df3 Improve documentation on simulateDataStall
Explain that:
 - The method does not cause an actual data stall.
 - The detectionMethod parameter refers to
   ConnectivityDiagnosticsManager.DataStallReport constants (which
   already use an IntDef).
 - timestampMillis is relative to SystemClock.elapsedRealtime.

Fixes: 183972768
Test: m
Change-Id: I2eeb79e0e8ec6e8fd3b8fe1dcb1abbf2e6338983
2021-04-08 16:30:25 +09:00
Remi NGUYEN VAN
c5174c3c10 Add RequiresPermission to TestNetworkManager
All API methods in TestNetworkManager require the MANAGE_TEST_NETWORKS
permission.

Fixes: 183972672
Test: m
Change-Id: Ic5929c24ea88d7259d367a81fec8f223a2e3ecb0
2021-04-08 16:12:23 +09:00
Remi NGUYEN VAN
84a217a6ef Set ParseException constructors as public
As there is no strong reason to keep the constructors module-lib, set
them as public API.
This is in response to API feedback.

Fixes: 183446251
Test: m
Change-Id: I01daa6f6f8095f7a4db94d1ca05f913166939df3
2021-04-08 15:57:31 +09:00
Remi NGUYEN VAN
a00cc613ac Add option to make sign-in notification ongoing
Add an overlay boolean that allows setting the SIGN_IN notification as
an ongoing notification.

This can be useful to make sure users can always easily find the
notification to sign in to a captive portal, as studies have found that
some users have a tendency to dismiss notifications before reading them.
At the same time the notification shade is generally too crowded, which
is what causes such behaviors in the first place, so this option is not
enabled by default and should generally not be enabled without proper
user studies or metrics.

Bug: 173171709
Test: atest NetworkNotificationManagerTest
Change-Id: Ic187d2a2b7e49ad152ea2aa35bb784864b97473c
2021-04-08 14:42:48 +09:00
Remi NGUYEN VAN
019b0eef3c Replace fields with getters in keepalive API
General guidance is to have getters in the API instead of fields.

Fixes: 181014882
Test: m
Change-Id: Id4bfc447701e8d0380163047779fbba043f17b6f
2021-04-08 14:06:53 +09:00
Aaron Huang
ad8412de63 Merge "Remove Network, NetworkRequest metrics from jobscheduler" am: 40a440f0dc am: 26ebda35aa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1666841

Change-Id: Ie3d8de6a1df69231367c8d476a158070d21f7f91
2021-04-08 03:00:27 +00:00
Aaron Huang
26ebda35aa Merge "Remove Network, NetworkRequest metrics from jobscheduler" am: 40a440f0dc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1666841

Change-Id: I3770e6f3b146c47fa5b20dcd09e2bbd0fd69cbdf
2021-04-08 02:43:55 +00:00
Paul Hu
21dbcf362f Merge "Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager" am: ed4117ff40 am: 2cac9e94ba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667080

Change-Id: Ice9b0d027e7e4f00bc9f14eb075ead9e77eaeca7
2021-04-08 02:37:23 +00:00
Aaron Huang
40a440f0dc Merge "Remove Network, NetworkRequest metrics from jobscheduler" 2021-04-08 02:27:05 +00:00
TreeHugger Robot
cfbcf574dc Merge "Remove unnecessary public API getActiveNetworkForUid" into sc-dev 2021-04-08 02:26:15 +00:00
Paul Hu
2cac9e94ba Merge "Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager" am: ed4117ff40
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667080

Change-Id: I4f180fc6e083b21d089dc15881e89a021557635a
2021-04-08 01:56:44 +00:00
Treehugger Robot
6563ba2454 [automerger skipped] Merge "Expose constants of ConnectivityManager" am: cb20318619 am: 9b01e26848 am: bc7c12a84f -s ours
am skip reason: skip tag Change-Id I715c766ad8e5eb54f4dc67239c1dbca7239506fc with SHA-1 cf6d450eb8 is already in history

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

Change-Id: I998cf20b3f54ccdfadf46e64ee655858e3534097
2021-04-07 12:06:15 +00:00
paulhu
b49c8425b2 Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager
- As API review feedback, move ACTION_CLEAR_DNS_CACHE form Intent
  to ConnectivityManager.

- Rename to "android.net.action.CLEAR_DNS_CACHE" because of lint
  suggestion.
frameworks/base/packages/Connectivity/framework/src/android/net/
ConnectivityManager.java:449: error: Inconsistent action value;
expected `android.net.action.CLEAR_DNS_CACHE`, was
`android.intent.action.CLEAR_DNS_CACHE` [ActionValue]

Bug: 183937999
Test: atest FrameworksNetTests
Test: atest ActivityTaskManagerServiceTests
Test: atest android.permission2.cts.PermissionPolicyTest
Test: atest CtsNetTestCases
Change-Id: Iae8aa0ba10dfc7581f0cfaab82643edbee789e2f
2021-04-07 19:40:47 +08:00
Treehugger Robot
bc7c12a84f Merge "Expose constants of ConnectivityManager" am: cb20318619 am: 9b01e26848
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1579805

Change-Id: Ibd12c85a42d9b0c13113923c3a61dde7f2cd3e5a
2021-04-07 11:25:59 +00:00
Treehugger Robot
9b01e26848 Merge "Expose constants of ConnectivityManager" am: cb20318619
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1579805

Change-Id: I0e3930444640a8bff7b0f9846cd2ce0e92df8d6f
2021-04-07 10:42:47 +00:00
Treehugger Robot
cb20318619 Merge "Expose constants of ConnectivityManager" 2021-04-07 10:11:06 +00:00
lucaslin
d89b2980df Expose constants of ConnectivityManager
The callers cannot call the hidden APIs after ConnectivityManager
became a part of mainline module, so expose them for callers.
Also change the value of ACTION_PROMPT_PARTIAL_CONNECTIVITY,
ACTION_PROMPT_LOST_VALIDATION and ACTION_PROMPT_UNVALIDATED because
of API lint errors.

Bug: 172183305
Test: Check private DNS settings is normal, and test NO_INTERNET
      notification can be shown normally.
Change-Id: I715c766ad8e5eb54f4dc67239c1dbca7239506fc
Merged-In: I715c766ad8e5eb54f4dc67239c1dbca7239506fc
2021-04-07 09:13:46 +00:00
Chiachang Wang
bb0f157fa3 Merge "Assign the bit calculation as long to prevent overflow" am: 1122a53585 am: 7e2a559c57 am: a97e380d38
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664307

Change-Id: Ia3a1974227ebfd0069b288203df3551a561556eb
2021-04-07 06:06:50 +00:00
Chiachang Wang
a97e380d38 Merge "Assign the bit calculation as long to prevent overflow" am: 1122a53585 am: 7e2a559c57
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664307

Change-Id: I68844967fbef3cffb7211ce72fd502ae19c331c8
2021-04-07 05:39:01 +00:00
Chiachang Wang
7e2a559c57 Merge "Assign the bit calculation as long to prevent overflow" am: 1122a53585
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664307

Change-Id: I548347851e102f81cd13516a6a409e74c59859f4
2021-04-07 04:56:41 +00:00
Chiachang Wang
1122a53585 Merge "Assign the bit calculation as long to prevent overflow" 2021-04-07 04:24:46 +00:00
Aaron Huang
a35f6c23d8 Remove Network, NetworkRequest metrics from jobscheduler
These metrics are deprecated so remove them from jobscheduler.
Also remove dumpDebug method from Network, NetworkRequest and
NetworkCapabilities because there's no caller anymore.

This change also for connectivity mainline module. These
three classes are inculded in framework-connectivity so
external module cannot have dependencies on its hidden API.
With this change, the dependencies can be removed.

(cherry-picked from ag/13959431)
Bug: 178777253
Test: FrameworksNetTests
      JobStoreTest
      adb shell dumpsys jobscheduler --proto
      CtsIncidentHostTestCases:JobSchedulerIncidentTest
Merged-In: Ie0c540303ba06b8fba029d2b98ae753afb08c963
Change-Id: Ie0c540303ba06b8fba029d2b98ae753afb08c963
2021-04-07 12:22:57 +08:00
Remi NGUYEN VAN
50805b15e5 Make service-connectivity APEX-only
service-connectivity is not used by arc-services anymore, so it does not
need apex_available for the platform anymore.

Bug: 183691942
Test: m
Change-Id: I8e7aa59e517a3694b7c4c1ed1e29f4281777b62c
2021-04-07 13:22:31 +09:00
Treehugger Robot
ec73c43fa0 Merge "ConnectivityManager: Address review comments from aosp/1595396" am: 1515b6c96d am: 0eadb2848d am: 89fcdff5d6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633279

Change-Id: I05777492db3ab9d7b4c6c69131f9404780e4e832
2021-04-07 02:47:49 +00:00
Chiachang Wang
2b79e200c3 Assign the bit calculation as long to prevent overflow
The value should be assigned as a long to do the bit calculation
as the mNetworkCapabilities is intended to be a long. Otherwise,
the value will be temporary assigned into an integer then
assigned to the target long. When the bit shift calculation
is out of the integer scope, the calculation will overflow and
result in unexpected bebavior.

Without assigning to a long, ConnectivityServiceTest will get
Out-Of-Memory in StringBuilder while generating toString() in
NetworkCapabilities after updating tests to verify
NET_CAPABILITY_VSIM and NET_CAPABILITY_BIP.

Bug: 130869457
Test: atest FrameworksNetTests
Change-Id: I4d34c1215c7efb6dc352c314107792e3fa512ad7
2021-04-07 02:06:33 +00:00
Treehugger Robot
89fcdff5d6 Merge "ConnectivityManager: Address review comments from aosp/1595396" am: 1515b6c96d am: 0eadb2848d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633279

Change-Id: I9fe5fb1cbbbae44e91efe90107c220a7b64d9755
2021-04-07 02:00:09 +00:00
Treehugger Robot
0eadb2848d Merge "ConnectivityManager: Address review comments from aosp/1595396" am: 1515b6c96d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633279

Change-Id: I6653d668d1fdc4370f8d5db1da41214b9755bb4d
2021-04-07 01:16:24 +00:00
Treehugger Robot
1515b6c96d Merge "ConnectivityManager: Address review comments from aosp/1595396" 2021-04-07 00:36:27 +00:00
Roshan Pius
0392d9c63d Merge "NetworkCapabilities: Hide copy constructor" am: fb309ae283 am: afd7250ef7 am: c768b86db0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664151

Change-Id: Ia04c6e313a5c960c4874cd57cf91c6619d1505da
2021-04-06 18:25:52 +00:00
Roshan Pius
c768b86db0 Merge "NetworkCapabilities: Hide copy constructor" am: fb309ae283 am: afd7250ef7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664151

Change-Id: If4d2d06c0e3ca6793dcb6139d3cd197e33f5aab7
2021-04-06 17:36:58 +00:00
Roshan Pius
afd7250ef7 Merge "NetworkCapabilities: Hide copy constructor" am: fb309ae283
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664151

Change-Id: I4e3b8ca8158102bf71b6ab2ca796bdfeeedd7d55
2021-04-06 16:49:29 +00:00