Commit Graph

443484 Commits

Author SHA1 Message Date
Bill Yi
3003c1ed25 Import translations. DO NOT MERGE
Change-Id: I6bae55182c9982c6e0abf4e0f7f4f4fed6e6ec63
Auto-generated-cl: translation import
2020-02-13 10:24:53 -08:00
Automerger Merge Worker
894c9db9f5 Merge "NetworkRequest: Embed requestor uid & packageName" am: 9dd718c5d9
Change-Id: Ic4f9247e18a9d1cc22b26500b47da1af2d9b011d
2020-02-12 18:51:59 +00:00
Qingxi Li
9dd718c5d9 Merge "NetworkRequest: Embed requestor uid & packageName" 2020-02-12 18:43:32 +00:00
Automerger Merge Worker
d785329abb Merge "Add @Nullable and @NonNull to module API" am: 04ee825346
Change-Id: I61943d8e33dc94d780401448a8acc716966a5763
2020-02-12 18:42:53 +00:00
Anton Hansson
04ee825346 Merge "Add @Nullable and @NonNull to module API" 2020-02-12 18:26:06 +00:00
Cody Kesting
b3a0f10a8e Merge "Include NetworkCapabilities and LinkProperties in DataStallReport."
am: 3939d29c0b

Change-Id: If2157b0dd7d62560c77318b76e0d7d2a66c09644
2020-02-12 09:16:41 -08:00
Anton Hansson
7f94169e56 Add @Nullable and @NonNull to module API
These two annotations are already in the public/system stubs,
but are re-written to be package private instead of public. This
makes them inaccessible to libs building against these stubs.

When setting sdk_version:<X>, the stubs of X will appear before any
other libraries on the classpath. This also makes it impossible for
modules to add Nullable annotations of their own when setting sdk_version.

Exposing these annotations as public in the module stubs makes it
possible for modules using these annotation to specify an sdk_version.

Bug: 146758669
Test: m
Test: downstream CLs using sdk_version:module_current
Change-Id: I71fb766d02f833ed9a1b3a7dbfbc1c8118882b30
Merged-In: I71fb766d02f833ed9a1b3a7dbfbc1c8118882b30
(cherry picked from commit c8fc90a0c2b04a5f6f5e6006155ca1e9a09db4e3)
2020-02-12 17:12:06 +00:00
Cody Kesting
3939d29c0b Merge "Include NetworkCapabilities and LinkProperties in DataStallReport." 2020-02-12 16:38:38 +00:00
Automerger Merge Worker
8f13cef9e5 Merge changes from topic "NS-A44_lingerstate" am: ea8483c0f5
Change-Id: Ibec8f280ad0b256d3d9b065a541063fc63d5a356
2020-02-12 15:29:30 +00:00
Chalard Jean
ea8483c0f5 Merge changes from topic "NS-A44_lingerstate"
* changes:
  [NS B10] Cleanup : remove mRematchedNetworks
  [NS B09] Create NetworkRanker
  [NS B08] More simplification
  [NS B07] More simplification
  [NS B06] Simplification
  [NS B05] Remove old dead code
  [NS B04] Make the network selection request-major.
  [NS B03] Add debug log showing the reassignment
  [NS B02] Split out a function to apply a NetworkReassignment
  [NS B01] Move the computation loop to a separate function
  [NS A44 2/2] Apply requests after all networks rematching is computed
  [NS A44 1/2] Update linger state before processing listens
2020-02-12 15:13:10 +00:00
Chalard Jean
fbb758f615 [NS B10] Cleanup : remove mRematchedNetworks
This is better computed by the code that applies the change
than by the code that computes the reassignment

Test: FrameworksNetTests
Change-Id: I13e2764fd9b29145499085c3bb56de88a97d6c3c
2020-02-12 21:23:45 +09:00
Chalard Jean
7a5e51f4dc [NS B09] Create NetworkRanker
Bug: 113554781
Test: FrameworksNetTests
Change-Id: Ia534247144f479fe896e1a6e05b906103cd10005
2020-02-12 20:57:45 +09:00
Chalard Jean
26693d466a [NS B08] More simplification
Only computing the reassignment does not actually change the
default network.

Test: FrameworksNetTests
Change-Id: I21ddf5cc1e3d3817055dbda4246e38ceb0732407
2020-02-12 20:57:44 +09:00
Chalard Jean
7738b84729 [NS B07] More simplification
The new reassignment does not contain these useless lines
any more.

Test: FrameworksNetTests
Change-Id: I1583aebe94e529ce2b36e191a6e1f49c976bf29a
2020-02-12 20:57:44 +09:00
Chalard Jean
cdd4c45008 [NS B06] Simplification
This check is now unnecessary, seeing how the code adding these
changes is now guaranteed to only add at most one change for
each request.

Test: FrameworksNetTests
Change-Id: Ia0443602d9c89ee413e956df9c7b79f8f74813f7
2020-02-12 20:57:43 +09:00
Chalard Jean
8a2bf77793 [NS B05] Remove old dead code
Test: FrameworksNetTests
Change-Id: I553721b327b76ede0e76b9fb7a0130fcae012175
2020-02-12 20:52:17 +09:00
Chalard Jean
47d464870f [NS B04] Make the network selection request-major.
This patch marks the most important turning point of this
refactoring. Cleanups removing unused code will follow.

Replace the old network-major reassignment computation with a
much simpler and faster loop that takes each request and assigns
it the highest-scoring network.

All tests pass, of course.

Bug: 113554781
Test: FrameworksNetTests
Change-Id: Ie143802995155151a38a4eb1d2f26c3f29e556bd
2020-02-12 20:52:17 +09:00
Chalard Jean
bf1170cc19 [NS B03] Add debug log showing the reassignment
dumpString for a reassignment looks like :

NetworkReassignment :
  Rematched networks : [100 CELLULAR], [101 WIFI]
  6 : 100 → 101
  8 : null → 101

toString looks like :

NetReassign [4 : 100 → 101, 5 : null → 101]

If no changes, then it looks like
NetworkReassignment : no changes

Bug: 113554781
Test: Manual
Change-Id: If9eeadb7ee317dee2d91ca1feca3091ae39e9bae
2020-02-12 20:52:17 +09:00
Chalard Jean
8bab483c2b [NS B02] Split out a function to apply a NetworkReassignment
This makes the rematchAllNetworksAndRequests function, which
is the nexus of the rematching code, very straightforward and
easy to read.

Bug: 113554781
Test: FrameworksNetTests
Change-Id: I5cea4ed7e06439494700d88ab202b696402fa360
2020-02-12 20:52:17 +09:00
Chalard Jean
14c2d1da86 [NS B01] Move the computation loop to a separate function
Bug: 113554781
Test: FrameworksNetTests
Change-Id: I6c28c7af5c600d35aa1e9328b6c988dadb921f51
2020-02-12 20:52:17 +09:00
Chalard Jean
5f8010bf80 [NS A44 2/2] Apply requests after all networks rematching is computed
This patch finally separates completely computing the rematch
from all the side effects. A collateral effect of this is to
compute correctly the background network state in
rematchNetworkAndRequests, which compensates the breakage
from the previous patch.

Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: I998c729c385940168fcd6ba3f2e01911f1844ce1
2020-02-12 20:52:17 +09:00
Chalard Jean
a8013252e6 [NS A44 1/2] Update linger state before processing listens
To compute accurately whether a network is in the background, the
linger state needs to be updated. Do that before computing whether
a network is in the background and possibly calling
applyBackgroundChangeForRematch.

However ! As of this patch, rematchNetworksAndRequests computes
a wrong value when adding to the list of affected networks, because
it is looking at intermediate global state. Somehow this used to
compensate exactly for the way reading back the state was wrong.
There might have been a few undetected bugs there, but none is
known.

As such, as of this patch, rematchNetworksAndRequests still
computes a wrong value while the computation when applying that
state now computes the right one, so the tests do not pass.
This patch must be checked in together with A44 2/2 which will
fix the computation in rematchNetworksAndRequests, but is kept
separate for ease of review.

Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: Iaeed0d11bfa09f292f232ae020e944e430bc0184
2020-02-12 20:52:17 +09:00
Automerger Merge Worker
23fa19dce9 Merge "Expose NETWORK_STACK permission for system and test API" am: 97c24fb167
Change-Id: I46ddde0f99b5444ca8ffc6df1adbcdc9b5317c35
2020-02-12 09:48:27 +00:00
Chiachang Wang
97c24fb167 Merge "Expose NETWORK_STACK permission for system and test API" 2020-02-12 09:28:24 +00:00
Automerger Merge Worker
6185ee9556 Merge changes Ibc9b1965,I288ea32f am: 7fa63afe6d
Change-Id: I6eb675ddfa609dcc3031e916ce49959e42cf53f6
2020-02-12 06:25:49 +00:00
Automerger Merge Worker
b9e9fcbc88 Add a systemapi constructor for NetworkAgent am: 6dc9854996
Change-Id: I3fa3ec32d3c580ba0b7f2d515e08d27dd6af5bcd
2020-02-12 06:25:42 +00:00
Chalard Jean
7fa63afe6d Merge changes Ibc9b1965,I288ea32f
* changes:
  Fix invalid usage of javadoc
  Add a systemapi constructor for NetworkAgent
2020-02-12 06:10:32 +00:00
Aaron Huang
9be870d8bd Fix invalid usage of javadoc
CP from ag/10125651

Test: this change removes invalid usage
Change-Id: Ibc9b1965ec7aa545c0dae71d741c3802d3a9fa12
Merged-In: I35fc4a814238635fa95981649c27230dda319afa
2020-02-12 06:10:10 +00:00
Chiachang Wang
d643862a46 Expose NETWORK_STACK permission for system and test API
NETWORK_STACK permission is used for system and test API
permission check which should also be system API. Expose
as it is.

Bug: 148379628
Test: make test-api-stubs-docs-update-current-api \
      system-api-stubs-docs-update-current-api

Change-Id: I87db8568f20f26eabf236f76a8e281a63bf25114
Merged-In: I27061280b0c49677fa651c6f9799e48b78e4c109
2020-02-12 13:44:23 +08:00
Automerger Merge Worker
b5b5ebd1a9 Merge "[SP10] Add IntDef annotations for system api of NetworkStats" am: 0f19f99cf6
Change-Id: I4d352ed54671ce77ebbcaa9f0808a0ef703d3c6f
2020-02-12 04:54:02 +00:00
Roshan Pius
3e63df535a NetworkRequest: Embed requestor uid & packageName
Add the requestorUid & requestorPackageName fields to
NetworkCapabilities. This is populated by CS when
a new network request is received.
These 2 requestor fields are also optionally used for network
matching. All of the regular app initiated requests will have the
requestor uid and package name set by connectivity service. Network
agents can optionally set the requestorUid and requestorPackageName
to restrict the network created only to the app that requested the network.

This will help removing the necessity for the various specifiers to embed
the uid & package name info in the specifier for network matching.

Note: NetworkSpecifier.assertValidFromUid() is deprecated & removed in
favor of setting the uid/package name on the agent to restrict the
network to a certain app (useful for wifi peer to peer API & wifi aware).

Bug: 144102365
Test: Verified that wifi network request related CTS verifier tests
pass.
Test: Device boots up and connects to wifi networks
Change-Id: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529
Merged-In: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529
2020-02-12 04:42:58 +00:00
Treehugger Robot
0f19f99cf6 Merge "[SP10] Add IntDef annotations for system api of NetworkStats" 2020-02-12 04:37:55 +00:00
Automerger Merge Worker
9346552f89 Merge "[GWP-ASan] Scan GWP-ASan regions for native allocations." am: b666519a50
Change-Id: I997680166d778e7385430c4806355a13f22dd3b5
2020-02-12 03:37:15 +00:00
Treehugger Robot
b666519a50 Merge "[GWP-ASan] Scan GWP-ASan regions for native allocations." 2020-02-12 03:22:33 +00:00
Automerger Merge Worker
8795408c51 Merge "Return null for getSubmitPdu() for encoding failure instead of NPE" am: 75214226c6
Change-Id: Ib374f2ecf640ed0064b5033251f49ec2febf8801
2020-02-12 03:08:39 +00:00
Treehugger Robot
75214226c6 Merge "Return null for getSubmitPdu() for encoding failure instead of NPE" 2020-02-12 03:04:03 +00:00
Automerger Merge Worker
c022a03494 Merge "[SP11] add dumpsys support to dump stats inside providers" am: 9bcef80b3e
Change-Id: I44f69d27b89c6d0463a5b12b98e0cc3cf8297a33
2020-02-12 02:59:21 +00:00
Treehugger Robot
9bcef80b3e Merge "[SP11] add dumpsys support to dump stats inside providers" 2020-02-12 02:45:38 +00:00
Automerger Merge Worker
c6199ca4d8 [automerger skipped] Merge "Import translations. DO NOT MERGE" am: 805865c314 -s ours
am skip reason: subject contains skip directive

Change-Id: I01982de063bc8532fe9615ba0a451527aafea132
2020-02-12 01:32:19 +00:00
Mitch Phillips
6229df2bb9 [GWP-ASan] Scan GWP-ASan regions for native allocations.
GWP-ASan is part of the native allocator, and may allocate some memory.
When GWP-ASan is enabled, JNI needs to look inside of
GWP-ASan regions as well for native allocations.

Bug: 135634846
Test: ???
Change-Id: Id4f15544a902a034687690214c9481ab963929fc
2020-02-11 17:23:21 -08:00
Treehugger Robot
805865c314 Merge "Import translations. DO NOT MERGE" 2020-02-12 01:18:29 +00:00
Automerger Merge Worker
c0800cfc20 Merge "Set boot image profile properties in a loop for BootImageProfileTest" am: 33905aa38d
Change-Id: Icda0be79e45ac0c61ed0051e6c2a8fc468042024
2020-02-12 00:15:10 +00:00
Automerger Merge Worker
7c0f0d3cec Merge "Fix clang-tidy performance-faster-string-find warnings" am: 57fb318ca3
Change-Id: Icdf5d2931d8e2503f0c2ebc5c7f87d349fdc59a8
2020-02-12 00:14:47 +00:00
Mathieu Chartier
33905aa38d Merge "Set boot image profile properties in a loop for BootImageProfileTest" 2020-02-12 00:05:58 +00:00
Treehugger Robot
57fb318ca3 Merge "Fix clang-tidy performance-faster-string-find warnings" 2020-02-11 23:57:08 +00:00
Automerger Merge Worker
f1e6950510 Merge "Remove String16 operator<<, now provided in header" am: 35d04c27ee
Change-Id: I225b599e1bb7ba052361c0c0cb926b2c015f7baf
2020-02-11 23:03:21 +00:00
Steven Moreland
35d04c27ee Merge "Remove String16 operator<<, now provided in header" 2020-02-11 22:43:26 +00:00
Chih-Hung Hsieh
f2ef6579f2 Fix clang-tidy performance-faster-string-find warnings
Bug: 30411878
Test: build with WITH_TIDY=1
Change-Id: I7fd815aa401fbcaff97b772f3ba5d6f1d2034011
2020-02-11 14:27:11 -08:00
Automerger Merge Worker
285f6781c1 Merge "Give CONTROL_DEVICE_LIGHTS permission to the shell" am: 668daf0341
Change-Id: I8f0d55f7a310e6dff8cf552e5ddf929eb8d0c2b7
2020-02-11 22:14:58 +00:00
Treehugger Robot
668daf0341 Merge "Give CONTROL_DEVICE_LIGHTS permission to the shell" 2020-02-11 21:55:09 +00:00