58564 Commits

Author SHA1 Message Date
Treehugger Robot
abb1562ca1 Merge "Revert "Don't unnecessarily reevaluate tethering provisioning"" 2018-04-10 08:35:31 +00:00
Erik Kline
e93ed61334 Revert "Don't unnecessarily reevaluate tethering provisioning"
This reverts commit 8067d78c32f545db6d35c660279ab3f2326ba41d.

Change-Id: I9098f98cb134c35692c1384339f9407b94ce6f28
2018-04-10 07:01:16 +00:00
Treehugger Robot
081014ac55 Merge "Don't unnecessarily reevaluate tethering provisioning" 2018-04-10 03:22:10 +00:00
dalyk
7301aa4140 Trigger NetworkCallback events when private DNS usage has changed.
Relies on events sent from netd in aosp/578162.

Test: Added tests to ConnectivityServiceTest. Added a new test
class DnsManagerTest. Built a simple app that appears to
receive onLinkProperties events correctly upon manual changes
to the private DNS settings on a Pixel.
Bug: 71828272
Change-Id: I68665aaf74b7d59182cc6f9586b80b55b0dfe427
2018-04-09 16:45:22 -04:00
Erik Kline
8d1fe54be1 Support bluetooth not using MultinetworkPolicyTracker
This required advancing the IpManager to IpClient refactoring
(Bluetooth used IpManager and friends). Most importantly, the
Bluetooth code used WaitForProvisioningCallback, so this is
moved into IpClient proper now. Also: some more renaming
cleanup.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 62476366
Bug: 72663849

Change-Id: I9eee2a9d5c31cdd48a054a7edc3403584efb1864
2018-04-08 23:09:36 -07:00
Erik Kline
8067d78c32 Don't unnecessarily reevaluate tethering provisioning
Registering for carrier config changes can deliver a sticky broadcast
and can cause Tethering to think something has changed and reevaluate
provisioning status, even though this has been checked before it
entered tethering mode alive state.

Additionally, move the provisioning_app{,no_ui} resources into the
TetheringConfiguration, if for no other reason than now we can log
it in .toString().

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
    - manual USB tethering toward WiFi works
Bug: 69565814
Change-Id: Ib8b2620ce44c55e5eb0afd3f00f3f5aa4fc8a593
2018-04-08 18:28:15 -07:00
Erik Kline
736353a584 Move the logic of (re)evaluation of Private DNS
Moves this out of ConnectivityService and into each NetworkMonitor
(where it's more self-contained).

Test: as follows
    - builds, flashes, boots
    - runtest frameworks-net passes
    - manual testing with working and non-working hostnames behaves
      somewhat (but not entirely) as expected, and not always quickly
Bug: 64133961
Bug: 72345192
Bug: 73872000
Bug: 77140445
Change-Id: Ic4322af3cb49149f2d975cb31f54b2ac7927f907
2018-04-05 15:17:38 -07:00
Mathieu Chartier
35f8bc164f Add dedicated flag to control app image generation
Also disable the flag for split APKs.

Bug: 72696798
Test: manual

(cherry picked from commit a9c343386d5505d7111aee3c1ffec409c9730f21)

Merged-In: I25007500e221744a218b165dde41ca9db19b1832
Change-Id: I1dc3137307834d948b52af18205ca47dc8dc7e67
2018-04-03 15:36:53 -07:00
Erik Kline
2140529d9b Support bypassing TLS in the framework
This change comprises the following parts:

    [1] android.net.dns.ResolvUtil, containing methods that encapsulate the
        use of the high bit in netids used in DNS resolution contexts.

    [2] Updates to captive portal apps to call the ResolvUtil method that
        enables DNS-over-TLS bypass for the captive portal app process.

Test: as follows
    - builds
    - flashes
    - boots
    - runtest frameworks-net passes
Bug: 64133961
Bug: 72345192

Change-Id: I2072c1f68d6978fa0d7e9d8693135a2c51bb0f87
2018-04-03 00:35:30 -07:00
Treehugger Robot
e34c426fd3 Merge "Refactor isTetheringSupported() calls" 2018-04-02 18:47:18 +00:00
Bernie Innocenti
e2c70f8a60 APF: drop multicast ICMPv6 while in doze mode
Some WiFi hotspots send excessive multicast IPv6 ping requests which
cause considerable power drain. Thus, drop all multicast ICMPv6 ping
requests while the device is in doze mode.

Bug: 66930077
Test: runtest -x tests/net/java/android/net/apf/ApfTest.java
Test: manual - compared generated APF bytecode using apf_disassembler
Test: manual - force idle mode while sending multicast pings to device
Change-Id: I25dbf99985cf4413b4d0e3920d281fe6d663197a
2018-04-02 21:17:51 +09:00
Erik Kline
465ff3a0c1 Refactor isTetheringSupported() calls
Tethering currently wants access to complex isTetheringSupported
logic that is only available in ConnectivityService. Instead of
trying to access that via ConnectivityManager, pass this capability
in to Tethering directly, in the TetheringDependencies object.

Also:
    - ConnectivityManager is only a source of static constants now,
      so "import static" all the constants that are actually used.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net works
    - manual USB towards WiFi tethering works
Bug: 68951715

Change-Id: Ia64faaadefb4a5d84a50da98bdebd544b6fda101
2018-03-30 17:24:43 -07:00
Bernie Innocenti
51dab0ed9d Merge "Relax APF version check in ApfGenerator" 2018-03-30 07:25:08 +00:00
Chalard Jean
b8a1509d68 Merge "Limit the number of routes for performance" 2018-03-30 06:40:29 +00:00
Lorenzo Colitti
7fcde83572 Merge "Disallow Reserved SPI Allocation" 2018-03-30 06:16:17 +00:00
Lorenzo Colitti
2891409c93 Merge "Clarify UDP encapsulation socket API" 2018-03-30 04:58:47 +00:00
Bernie Innocenti
d6bf7ffea7 Relax APF version check in ApfGenerator
Instead of requiring an *exact* version, we now require a minimum
version. This is necessary if we wish to upgrade the APF interpreter in
vendor firmware independently of the framework code. Adding new opcodes
without changing the semantics of the old ones is always possible and
usually easy, so we can at least have a backwards-compatibility horizon
wider than a single version.

Change-Id: I4f1ed661afb2ede193188eb8086fbf2a8b45b33d
Test: Change extracted from aosp/647079 and tested there
2018-03-30 13:14:54 +09:00
Treehugger Robot
d136b0fb08 Merge "Add the compilation reason to the dexopt dumps" 2018-03-30 01:20:26 +00:00
Calin Juravle
bceae38c7a Add the compilation reason to the dexopt dumps
Knowing why we compiled a package will make some investigations easier.

Test: adb shell dumpsys package dexopt
Bug: 76425903
Change-Id: I67b5bc980d198340aa52affb24fb3ce7e3080d67
2018-03-29 12:44:57 -07:00
Remi NGUYEN VAN
25a7e4fdbf Use InterfaceSet for upstream interfaces.
Allows using different upstream interfaces for IPv4 and IPv6.

Bug: 38218697
Bug: 64382985
Bug: 64976379
Bug: 64995262
Bug: 64380515
Test: runtest frameworks-net, manual (with aosp/644099 applied)

Change-Id: I3db63f7aa5255a0229253187def7590a386c5133
2018-03-29 18:13:46 +09:00
Chalard Jean
e0d26f66b0 Limit the number of routes for performance
In evaluating whether "most" of the addressing space is
covered, the list of routes are obtained from a third-party
app, so it's possbile the system service stalls unless
some limit is enforced on how much work it has to do.
This change limits the number of routes to 400, as determined
by time measurement on various devices.

Bug: 74176086
Test: runtest framework-net
Change-Id: Ie4a96098bc044ade87b188839586f14dd101c100
2018-03-29 18:13:23 +09:00
Remi NGUYEN VAN
83088dcd8e Merge "Fix network usage stats on 464xlat tethered." 2018-03-29 06:04:02 +00:00
Treehugger Robot
ff95c80198 Merge "Remove non-tombstoned ANR path." 2018-03-28 21:25:13 +00:00
Elliott Hughes
85b6c0032a Remove non-tombstoned ANR path.
Bug: http://b/73140330
Test: boots with ANR
Change-Id: Ib58724a0a6b831c05cb59d053520a4169ea591fd
Merged-In: Ib58724a0a6b831c05cb59d053520a4169ea591fd
2018-03-28 17:54:26 +00:00
Nathan Harold
7f606ee8e5 Disallow Reserved SPI Allocation
Disallow the allocation of SPIs in the range
reserved for future use by RFC 4303.

Bug: 77205120
Test: runtest frameworks-net
Change-Id: I05e26ed34b5871f1a07d5bd7b58b79a64cd74b67
2018-03-28 16:08:57 +00:00
Mathew Inwood
51a1d4453c Use commas to separate API exemptions list, not colon.
A colon appears in the type signature of a field, so is not safe to use in
this context.

Test: m
Test: $ adb shell settings put global hidden_api_blacklist_exemptions \
Test: > Landroid/app/Activity;->mResumed:Z,Landroid/view/RemoteAnimationDefinition\\\;

Bug: 73337509
Change-Id: Ia9171fecc9c3ed265b87921b31458de25304486e
2018-03-28 13:01:37 +01:00
Remi NGUYEN VAN
9fb55e4f03 Fix network usage stats on 464xlat tethered.
Usage stats corrections for 464xlat in NetworkStatsFactory are not applied
to tethered traffic. Add adjustments in NetworkStatsService. After
migrating external callers off NetworkStatsFactory, we will be able to
only apply adjustments in NetworkStatsService and remove stacked
interface tracking from NetworkStatsFactory.
Bug: 72107146
Fixes: 72107146
Test: runtest frameworks-net & manual - checked corrected network usage

Change-Id: I5ce450e616b4fddf21f2a491fe5d0c9e9f969bda
2018-03-28 12:14:14 +09:00
Benedict Wong
4c987ebade Clarify UDP encapsulation socket API
This change updates the getSocket() methods for IPsec to improve clarity
of the return types, both for public APIs, and internal-only methods.

Bug: 72473753
Test: APIs updated, CTS + unit tests ran.
Change-Id: I0afebd432c5d04c47c93daa1ce616d712aa323d7
2018-03-27 19:46:50 -07:00
Andreas Gampe
c157be081e BgDexopt: Reschedule job on timeout
When the background dexopt job times out, tell the scheduler to
reschedule it, as we have more work to do.

Bug: 76425903
Test: m
Test: manual
Change-Id: Ibbdb979bceb1ff0a25f8aed2b3cc26a7f30057e2
2018-03-27 15:04:19 -07:00
Treehugger Robot
4b8285b907 Merge "Configurable hidden API exemptions." 2018-03-27 20:49:45 +00:00
Remi NGUYEN VAN
f8b537d7a3 Merge "Add tests for IPv4 of dual stack tethering." 2018-03-27 10:17:44 +00:00
Mathew Inwood
2c6f97d4c9 Configurable hidden API exemptions.
Extend the existing hidden_api_blacklist_exemptions config to support a
list of API signature prefixes to exclude from hidden API enforcement.

Push this list down to the zygote process when that process is created,
and when the list changes. This minimizes overhead, but should also ensure
that all new processes get the latest whitelist.

Test: $ adb shell settings put global hidden_api_blacklist_exemptions \
Test:    Landroid/view/RemoteAnimationDefinition\\\;:Landroid/app/ActivityManager\\\$TaskDescription\\\;
Test: Manually verify logcat output from app which uses named APIs
Bug: 73337509
Change-Id: Ib1245b69da4dac50c6968f1be62f1a74591dc433
2018-03-27 10:51:10 +01:00
Remi NGUYEN VAN
a911e84798 Add tests for IPv4 of dual stack tethering.
Also refactoring some Tethering and TetherInterfaceStateMachine calls
to address testability issues.

This is in preparation of other work to have IPv6-only or 464xlat
tethering working.

Test: runtest frameworks-net
Bug: 38218697
Bug: 64382985
Bug: 64976379
Bug: 64995262

Change-Id: I721aca4789ddfbee5a97316aae0b378d79ee2107
2018-03-26 11:38:34 +09:00
Treehugger Robot
76f64641bb Merge "Pass all relevant resolver info to netd" 2018-03-23 23:41:11 +00:00
Elliott Hughes
6941fcd88c Merge "Prune files from /data/anr/ by number as well as age." 2018-03-23 17:36:23 +00:00
Treehugger Robot
827a150646 Merge "Revert "Revert "Logging: Bluetooth Enabled""" 2018-03-23 17:29:36 +00:00
Mathew Inwood
69e1cbc3fe Merge "More flexible API enforcement policy." 2018-03-23 13:29:03 +00:00
Mathew Inwood
16073b8a7c More flexible API enforcement policy.
This CL adds the basics to set black, dark gray or light gray list
enforcement, rather than just black as before. It's not possible to
actually set the policy per-package yet.

PackageDexOptimizer still uses a single bit, for API checks on/off, rather
than the new enum. It assumes blacklist enforcement internally. This can
be improved in a follow up CL.

(cherry-picked from commit e52130ae4cf3b046b38a09fc7cc7712f5b7fb83d)

Test: m
Test: Boot device

BUG: 73337509
Change-Id: Ic0d5b8fa631c2bd583b6fc52b2ee3708c8113f59
Merged-In: Idd73c9938592c5c4d67cfb9efefdffed0dd5f262
2018-03-23 11:44:42 +00:00
Treehugger Robot
9d9782ec7e Merge "audioservice: Add a property for default voice call volume" 2018-03-23 08:38:21 +00:00
Erik Kline
e5dac904d3 Pass all relevant resolver info to netd
Test: runtest frameworks-net passes
Test: manual testing of opportunistic and strict mode works
Bug: 34953048
Bug: 64133961
Bug: 72345192
Change-Id: Ia4f1905e1fa60e7a468c2246fb809191d2ba796b
2018-03-22 23:50:13 -07:00
Chalard Jean
06f0fc04e7 Merge "Have PermissionMonitor arbiter which app can access background networks" 2018-03-23 06:15:00 +00:00
Elliott Hughes
08de1891c8 Prune files from /data/anr/ by number as well as age.
tombstoned prunes based on both age and number of files. Until we can
fully switch over to tombstoned, emulate that here too.

Bug: http://b/73140330
Test: ran tests
Change-Id: I824034019e91d541fc7b7ba49d152e1ceaf37621
2018-03-22 14:06:37 -07:00
Tej Singh
e7e9fca001 Revert "Revert "Logging: Bluetooth Enabled""
This reverts commit 46850eb3d2180d29751a18056ae094965e840827.

Reason for revert: The dummy StatsLog class was merged into stage-aosp-master and oc-mr1-dev-plus-aosp, which were the branches that broke initially.

Change-Id: Iab9bac487d845db0ba70b2622679523604b4944e
2018-03-22 18:30:31 +00:00
Chalard Jean
1d738004e8 Have PermissionMonitor arbiter which app can access background networks
This will let ConnectivityService send the right callbacks to the
relevant apps.

Test: manual with apps
      runtest frameworks-net
      cts
      new tests for this functionality
Bug: 67408339

Change-Id: I6f08efd9e73c7e191f833d7f307a3bf4c9e2f0b4
2018-03-22 19:03:59 +09:00
Remi NGUYEN VAN
088ff6824f Add method to NetworkStatsService for UID stats.
Useful for clients such as BatteryStats which currently rely
on NetworkStatsFactory. Data at that stage is incomplete as
it does not account for tethering, VT data and corresponding
464xlat corrections.

Test: runtest frameworks-net, CTS tests pass.
Change-Id: I763b77f601c827fd2963204694fb5b45425cc791
2018-03-22 15:31:28 +09:00
Treehugger Robot
72fa61b325 Merge "Calls unlinkToDeath in binderDied to deregister" 2018-03-21 22:04:50 +00:00
Treehugger Robot
21a9ebeb6c Merge "Revert "Logging: Bluetooth Enabled"" 2018-03-21 19:55:58 +00:00
Yueming Wang
46850eb3d2 Revert "Logging: Bluetooth Enabled"
This reverts commit f336d1e9cf8b48fe73ad8527365d5286d673ffba.

Reason for revert: Reverting this CL as it causes several build breakages in git_stage-aosp-master

Change-Id: I4a29f7313857a561452c01fb331accbf59c64a72
2018-03-21 18:20:34 +00:00
Treehugger Robot
8173db40c3 Merge "Logging: Bluetooth Enabled" 2018-03-21 16:25:27 +00:00
nharold
94d8fa0da6 Merge "Check mOwnedByTransform to avoid DELSA on SPI" 2018-03-21 01:27:22 +00:00