4177 Commits

Author SHA1 Message Date
Hugo Benichi
60c9f63b66 Connectivity metrics: add WakeupStats events
This patch defines a new WakeupStats event in ipconnectivity.proto and
populates these events from the NFLOG wakeup events stored in
NetdEventListenerService.

There is one WakeupStats object per known interface on which ingress
packets arrive and may wake the system up.

Example from $ adb shell dumpsys connmetrics list:

UPDATEME
...
WakeupStats(wlan0, total: 58, root: 0, system: 3, apps: 38, non-apps: 0, unrouted: 17, 6111s)
WakeupEvent(13:36:31.686, iface wlan0, uid -1)
WakeupEvent(13:38:50.846, iface wlan0, uid -1)
WakeupEvent(13:39:16.676, iface wlan0, uid 10065)
WakeupEvent(13:40:32.144, iface wlan0, uid 1000)
WakeupEvent(13:40:35.827, iface wlan0, uid 1000)
WakeupEvent(13:40:47.913, iface wlan0, uid 10004)
WakeupEvent(13:40:52.622, iface wlan0, uid 10014)
WakeupEvent(13:41:06.036, iface wlan0, uid 10004)
...

Bug: 34901696
Bug: 62179647
Test: runtest frameworks-net
Change-Id: Ie2676b20bfb411a1902f4942643df0c20e268d99
2017-09-14 13:29:56 +09:00
Hugo Benichi
f562ac34a5 Connectivity metrics: collect NFLOG wakeup events
This patch stores NFLOG packet wakeup events sent by Netd to the system
server into a ring buffer inside NetdEventListenerService. The content
of this buffer is accessible by $ dumpsys connmetrics or $ dumpsys
connmetrics list, and is added to bug reports.

The wakeup event buffer stores currently uid and timestamps.

Bug: 34901696
Bug: 62179647
Test: runtest frameworks-net, new unit tests
Change-Id: Ie8db6f8572b1a929a20398d8dc03e189bc488382
2017-09-12 10:02:13 +09:00
Erik Kline
fc105bb6d8 Support NAT keepalives
Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - turned on debugging and walked around watching IpReachabilityMonitor
      force neighbors into NUD_PROBE state without error
    - observed NAT callbacks happening without any reported errors
    - watched:
        adb shell cat /proc/net/nf_conntrack | egrep '192[.]168[.]43[.]' | sort -n -k5
      for correct timeout updates

Bug: 29337859
Bug: 32163131

Merged-In: I82ac60e5ad79ec64a13df6ec56b5b51b223f8dde
Merged-In: I09bc685e821ec5e871576a54c4290edea4c5160b
Merged-In: I4d180369a8f64ee494b016656988252d98a09ba4
Change-Id: Icb23da64cfaa3a19f7bc75fba426a52b0994fb0f
(cherry picked from commit 7a65bc62fbe0391f88834ab27b32033d6b957c8b)
2017-09-08 10:54:20 +09:00
Hugo Benichi
4eccf78000 IP connectivity metrics: fix tests after proto update
Update to ipconnectivity.proto in commit
6d2f506bfd788a3685292d404dc9d82a27357cfe broke the associated unit
tests (Change-Id: I4cf5b95956df721aecd63fddfb026a7266c190b9)

Bug: 34901696
Bug: 65439160
Test: runtest frameworks-net
Merged-In: I57a6bad8a9836b1c45690c4589b416786ce1dfa0

(cherry picked from commit 822c5bf77892175d0b52aeaddf4e43c749c341f6)

Change-Id: I98b23b2208bbd7d12237fcb000f3cf10c53d9e55
2017-09-07 22:17:18 +09:00
Rubin Xu
1bb5c0818f Always add local subnet routes to the interface's routing table
For some networks such as mobile data connections, its LinkProperties
does not contain routes for the local subnet so no such route is added
to the interface's routing table. This can be problematic especially
if the device is in VPN lockdown mode where there exists high-priority
PROHIBIT routing rule which in turn blocks the network's default gateway
route from being added (next hop address hitting the prohibit rule).

We fix this by patching LinkProperties to always include direct connected routes
when they are received by ConnectivityService. This has the added advantage that
when apps get LinkProperties, they see the directly connected routes as well.

Bug: 63662962
Test: runtest frameworks-core -c android.net.LinkPropertiesTest
Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest
Test: Start with device with mobile data, set up ics-OpenVPN in always-on
      lockdown mode. Turn off mobile data then turn it back on, observe
      mobile data connectivity is restored and VPN successfully reconnects.
Change-Id: I35b614eebccfd22c4a5270f40256f9be1e25abfb
2017-09-07 10:50:20 +01:00
Hugo Benichi
e6793f2795 Merge "Nat464Xlat: correct racefree teardown" 2017-09-05 12:12:02 +00:00
Hugo Benichi
ef502887ec Nat464Xlat: correct racefree teardown
This patch relays the NetworkBaseObserver notifications about nat
464xlat stacked interfaces onto the ConnectivityService handler.

This allows to process interface up and down notifications in the
same thread context and eliminates several races:

  - NPE risk due to race between fixupLinkProperties called on
    ConnectivityService thread and interfaceRemoved called on
    NetworkManagementService thread.
  - stale LinkProperties pointer reads in both NetworkBaseObserver
    callbacks not called on ConnectivityService handler.
  - removes the race between stop() and interfaceRemoved().
  - removes superfluous LinkProperties notifications when stop() is
    called before the stacked interface goes up.

The teardown procedure logic common to stop() and interfaceRemoved() is
put into enterStoppedState() and enterIdleState().

This allows to distinguish and correctly handle the following teardown
scenarios:
 - an IPv4 appears -> ConnectivityService calls Nat464Xlat#stop()
                   -> Nat464Xlat calls stopClatd
                   -> clatd stops
                   -> if the stacked interface was up, it is removed
                   -> Nat464Xlat#interfaceRemoved() is triggered and
                      a LinkProperties update is sent.

 - network disconnects -> ConnectivityService calls Nat464Xlat#stop()
                       -> Nat464Xlat calls stopClatd
                       -> clatd stops
                       -> if the stacked interface was up, it is removed
                       -> Nat464Xlat#interfaceRemoved() is triggered and
                          a LinkProperties update is sent.

 - clatd crashes or exit -> Nat464Xlat#interfaceRemoved() is triggered
                         -> Nat464Xlat unregisters itself as a network
                            observer
                         -> ConnectivityService is updated about the
                            stacked interface missing, and restarts
                            Nat464Xlat if needed.

Note that the first two scenarios have two cases: stop() can be called
before the notification for the stacked interface going up (STARTED), or
after (RUNNING). In the first case, Nat464Xlat must unregister
immediately as a network observer to avoid leaks.

This patch also:
  - removes/simplifies comments related to the threading model which
    are no obsolete.
  - extract clatd management logic from ConnectivityService into
    NetworkAgentInfo
  - add new unit tests where there was none before.

Bug: 62918393
Bug: 62997041
Bug: 64571917
Bug: 65225023
Test: runtest frameworks-net
Change-Id: I27221a8a60fd9760b567ed322cc79228df877e56
2017-09-05 15:33:55 +09:00
Hugo Benichi
c9d24d203d Merge "Network Service Discovery test: properly release resources" 2017-09-04 11:50:58 +00:00
Treehugger Robot
1fd2eb6276 Merge "Fix some broken tests in frameworks-net with native dependencies" 2017-09-04 04:58:16 +00:00
Treehugger Robot
05f0bfe33e Merge "DO NOT MERGE: Fix ApfTest" 2017-09-04 03:39:59 +00:00
Hugo Benichi
cd9b716153 Fix some broken tests in frameworks-net with native dependencies
Exempt-From-Owner-Approval: Android.mk uses per-file permission to let
the build team modify it without dependeing on us. However because this
rule overrides the directory default owners, Android core networking is
not owner anymore. This exemption is necessary to let Android core
networking team fix their build file.

Test: All tests in runtest frameworks-net pass.
Merged-In: Ie0b8baa38ca39e92fbd698ebcead86dac0a67708

(cherry picked from commit 99e8ab6e46eec5dbd1b059b3732672d537b3cf34)

Change-Id: I4471a5cd7f20852645f3d94684cc5aeef3324162
2017-09-04 11:03:55 +09:00
Hugo Benichi
10c913331e DO NOT MERGE: Fix ApfTest
libutils is now depending on libvndksupport. So any client that
statically links to libutils needs to link against libvndksupport as
well.

Bug: 32561414
Test: ApfTest works
Merged-In: Id99792baa1c0a7a61c4056f83f33d25e0bea143e

(cherry picked from commit 9a2041ee836be925e93dd820f11686aa378dd92d)

Change-Id: I8808e668230ff7076403ff29cf48c12cbc36f78a
2017-09-04 11:03:47 +09:00
Erik Kline
aabdaa9710 Record even more stats even more often
Like kale, one can never have enough stats.  =)

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Merged-In: I5d40eae488cab685be6a44849181c0286fe28fdb
Merged-In: I759e97f9a72d15a84036c3a56451b872143539c6
Change-Id: Ieb47c3beed50f21c2c858fe57438afd48cfdc662
(cherry picked from commit 1199a352fcb938a8dc7a34a2853c4fde7f5656f1)
2017-09-04 09:37:12 +09:00
Hugo Benichi
e062ae07f9 Network Service Discovery test: properly release resources
Bug: 32561414
Bug: 62918393
Bug: 62044295
Test: runtest frameworks-net
Change-Id: If23993b5e391947ecbdc01677f0a643144794b2b
2017-09-02 14:54:29 +09:00
Ahmed ElArabawy
fd424169a1 Add APF black list for ether-type
Add a configurable black for protocols which packets are to be dropped
by APF. This enales an OEM to configure the APF to filter out un-needed
packets from reaching the host

Bug: 62415182
Test: runtest frameworks-net

Merged-In: I86335a0f854d5e83a2b2767978cd69b2cc25c2f8

Signed-off-by: Ahmed ElArabawy <arabawy@google.com>

(cherry picked from commit caffbe127726c6a9ab5dd023a9b09cfa43eac617)

Change-Id: I15a758d18464d73d24ba8364a867904bb3cd3b34
2017-09-01 14:03:58 +09:00
Colin Cross
46a435a378 Fix errorprone build
Fixes:
frameworks/base/tests/net/java/com/android/server/connectivity/tethering/OffloadControllerTest.java:149: error: [JUnit4TestNotRun] Test method will not be run; please add @Test annotation
    public void testNoSettingsValueDefaultDisabledDoesNotStart() throws Exception {
                ^
    (see http://errorprone.info/bugpattern/JUnit4TestNotRun)
  Did you mean '@Test'?
frameworks/base/tests/net/java/com/android/server/connectivity/tethering/OffloadControllerTest.java:170: error: [JUnit4TestNotRun] Test method will not be run; please add @Test annotation
    public void testNoSettingsValueDefaultEnabledDoesStart() throws Exception {
                ^
    (see http://errorprone.info/bugpattern/JUnit4TestNotRun)
  Did you mean '@Test'?

Bug: 64489631
Test: m -j RUN_ERROR_PRONE=true javac-check
Merged-In: Ib32489d07778465134bca52c589baddbd78ab129
Change-Id: I41dfdf87529e532df385617fa05c7006a7a14c86
2017-08-29 12:54:11 -07:00
Lorenzo Colitti
f612b609db Trivial change to test expectations.
(cherry picked from commit 0fee732ca579bbc4320ade35f238bdfa1aa500f5)

Bug: 32163131
Test: runtest frameworks-net
Change-Id: Iec8af5191b4da495e47ef97d70a03a5d2e75cfe2
2017-08-28 18:58:13 +09:00
Treehugger Robot
b09cf3fbf1 Merge changes from topic "offload_cherrypick"
* changes:
  Send add/removeDownstream info to offload HAL
  Don't completely stop offload if setting data limit fails.
2017-08-24 05:18:23 +00:00
Erik Kline
b3bb26eaa7 Send add/removeDownstream info to offload HAL
Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passed
Bug: 29337859
Bug: 32163131

Merged-In: I0cb81ac054fc2bf6c8b8bfe658e9404a15091d7a
Merged-In: I7abcdcc2d7d967179c47081a6db2b417164891f3
Change-Id: I6c59aa7cb80b54f376f294b24c1409710c553d74
(cherry picked from commit ed962a84122ab950a103fbbc0bf911f61b6b9500)
2017-08-23 20:55:47 -07:00
Lorenzo Colitti
ddce7ee20f Don't completely stop offload if setting data limit fails.
Currently, if setting a data limit fails, we completely stop
offload in order to avoid data overages. However, the next thing
we do is try to fetch the stats and crash, because once offload
is stopped all our local state is cleared.

Fix this by fetching stats before we stop offload.

Bug: 29337859
Bug: 32163131
Bug: 64867836
Test: OffloadControllerTest passes
Test: no crash when disabling wifi tethering with BT tethering active
Merged-In: I7fc47e60b2da5f39c26fb22c1325618f9948dd38
Merged-In: I464dd2a6d1996b1cfb8bbf82b6ee453fd0747569
Change-Id: I260f5450f8b67f055983af68fb23a5f3cfc0bc69
(cherry picked from commit d743601a002ac12c02da58e92ebd0544ab0b77ea)
2017-08-23 20:51:35 -07:00
Hugo Benichi
29b1826ff2 Merge "Make NetworkManagementServiceTest pass again." 2017-08-24 03:36:20 +00:00
Hugo Benichi
752c1287bd Tethering offload stats updates are eventually consistent
This patch removes the call to runWithScissors() in
OffloadController#getTetherStats() that was causing a deadlock when
NetworkStatsService would be polled for stats in certain threading
contexts.

Instead of trying to query the tethering offload HAL synchronously all
the time, this patch:
 - changes getTetherStats() to only call into the offload HAL when it
   detects that it is called on the same thread as the Tethering handler
   thread.
 - changes the map of interface to accumulated tethering forwarded stats
   to be concurrent.

This makes stats reading from getTetherStats() eventually consistent.
From the point of view of getTetherStats(), it preserves the guarantees
that tethering stats are monotonically increasing, and also guarantees
no tearing between rx bytes and tx bytes.

Bug: 29337859
Bug: 32163131
Bug: 64771555
Test: runtest frameworks-net
Merged-In: Ibcd351ad0225ef146b00a807833f76d2a886f6c1
Merged-In: I61786d61fe1422e429c0dd9eadaff6f02eb850e7
Merged-In: I999d1d1bf72e7ab02c5d17f37aad00bc711d3fc5

(cherry pick from commit eb5e465edd78bea26289f779b635c7e94d934854)

Change-Id: I28646b962cee8c8a6efd66059f84873c02ac5810
2017-08-23 09:58:09 +09:00
Lorenzo Colitti
a086800e04 Make NetworkManagementServiceTest pass again.
1. Mock the service manager so that NMS can fetch mock versions
   of INetd and IBatteryStats.
2. Call LocalServices.removeServiceForTest to avoid a duplicate
   service registration error. // check this
3. Change the timeout from 100ms to 200ms, as otherwise the tests
   that check for IfaceClass fail.
4. Convert NetworkManagementServiceTest to JUnit 4.
5. Move NetworkManagementServiceTest to tests/net

Bug: 29337859
Bug: 32163131
Bug: 32561414
Bug: 62918393
Test: runtest frameworks-net
Change-Id: Ic7371b427b35809ccd446addf35c9d8ae99ccfd3
2017-08-23 09:49:05 +09:00
Hugo Benichi
c6a9b5564a Merge "IpManager: use InitialConfiguration for provisioning"
am: 5b218bdc8e

Change-Id: I131589680b68222e4fda4e9165ac2f50894ee28e
2017-08-21 12:08:28 +00:00
Hugo Benichi
d00ddf5672 IpManager: use InitialConfiguration for provisioning
This patch changes IpManager to take into account static provisioning
information specified in the InitialConfiguration for IPv6 static
configuration.

When a valid InitialConfiguration with IPv6 content is specified,
IpManager will do the following things:

- at start(), it will push the IPv6 addresses in the config to netd
- it will observe all addresses be notified via Netlink
- when all addresses are there, it will patch in the associated IPv6
  routes in the config, so that they get passed to ConnectivityService
  through the usual mechanism

The logic triggering onProvisioningSuccess is also changed to take into
account InitialConfiguration: when all addresses and all routes in the
config are seen the provisioning is successful.

Bug: 62988545
Test: runtest frameworks-net, with newly added tests
Change-Id: I77ed7c576c4b198de7a4726be70c78b74689e98b
2017-08-21 16:00:31 +09:00
Lorenzo Colitti
9335d2d0b1 Merge changes I325b13d5,I89719fe7
am: 23868e9c09

Change-Id: Iaced543ab17ea87c8f701975764d957bc1b17fc7
2017-08-19 03:15:08 +00:00
Treehugger Robot
23868e9c09 Merge changes I325b13d5,I89719fe7
* changes:
  Add tether offload traffic to interface stats as well.
  Tell the system when tethering offload hits a limit.
2017-08-19 03:05:14 +00:00
Lorenzo Colitti
f1912ca49a Add tether offload traffic to interface stats as well.
Currently, we only count add tethering traffic to per-UID
stats, but not to total data usage (i.e., dev and XT stats). This
is correct for software tethering, because all software forwarded
packets are already included in interface counters, but it is
incorrect for hardware offload, because such packets do not
increment interface counters.

To fix this:
1. Add an argument to ITetheringStatsProvider#getTetherStats to
   indicate whether per-UID stats are requested. For clarity,
   define integer constants STATS_PER_IFACE and STATS_PER_UID
   to represent these operations.
2. Make NetdTetheringStatsProvider return stats only if per-UID
   stats are requested. (Otherwise tethering traffic would be
   double-counted).
3. Make OffloadController's stats provider return the same
   stats regardless of whether per-UID stats were requested or
   not.
4. Make NetworkStatsService add non-per-UID tethering stats to
   the dev and XT snapshots. The per-UID snapshots were already
   correctly adding in per-UID stats.

(cherry picked from commit 5356a35c3bcfcdf2d184c620af6bfbf9bddf35c5)

Bug: 29337859
Bug: 32163131
Test: runtest frameworks-net
Test: runtest frameworks-telephony
Change-Id: I325b13d50e88841dfb0db4c35e7e27f163ee72fe
Merged-In: I4e8e923d68dce1a4a68608dbd6c75a91165aa4ee
2017-08-19 10:12:05 +09:00
Lorenzo Colitti
9f0baa94ca Tell the system when tethering offload hits a limit.
Add a new tetherLimitReached method to INetworkManagementService,
and call it when the HAL notifies OffloadController because the
limit has been reached.

Bug: 29337859
Bug: 32163131
Test: builds
Test: OffloadControllerTest passes

(cherry picked from commit d66cf56ba662f10f2da1d0f844116632ad0a0dbb)

Change-Id: I89719fe7ec8bfd3c85d6cdca9c0d449aea86ef9d
Merged-In: I026e6aa9e7b371f316c0d97c3cf5e78abc1f5263
2017-08-19 00:15:31 +09:00
Hugo Benichi
ea2defe62b Merge "Add convenience methods to IpPrefix and LinkAddress"
am: 2ad60c88f1

Change-Id: I6d3f3c50eaec44e3a0787e849ab28e89f6f4a72d
2017-08-16 14:49:27 +00:00
Treehugger Robot
2ad60c88f1 Merge "Add convenience methods to IpPrefix and LinkAddress" 2017-08-16 14:38:29 +00:00
Hugo Benichi
1dfb6b6755 Add convenience methods to IpPrefix and LinkAddress
Also moving relevant test files into tests/net as part of runtest
framworks-net.

Also removes testHashCode in LinkAddress() because this test relies on
the assumption that hashCode() is stable across releases or jdk
versions, which is absolutely not true.

This creates maintenance work for little benefit since hashCode is
already tested as part of the equality test.

For instance this test is now broken because hashing for InetAddress
changed.

Bug: 62988545
Bug: 62918393
Test: runtest frameworks-net, added coverage in tests
Change-Id: I695bc3f0e801bf13bc4fc0706565758f12b775b4
2017-08-16 21:42:21 +09:00
Lorenzo Colitti
51c3d6a8bf Merge changes I82d3bee0,I9c9413d7
am: deb4eb5d05

Change-Id: Iaa6aecf3ec3a91dc04f4533c0ea5b649bdfeb83d
2017-08-15 02:07:36 +00:00
Lorenzo Colitti
deb4eb5d05 Merge changes I82d3bee0,I9c9413d7
* changes:
  Pass data usage limits to tethering offload code.
  Don't time out when fetching tether offload stats.
2017-08-15 01:57:28 +00:00
Lorenzo Colitti
50b60fc34d Pass data usage limits to tethering offload code.
Bug: 29337859
Bug: 32163131
Test: builds
Test: OffloadControllerTest passes
Change-Id: I82d3bee030bafa8fe85855885b5fc3893e699181
2017-08-15 00:09:23 +09:00
Treehugger Robot
c06dbc114f Merge "DO NOT MERGE Fix some broken tests in frameworks-net with native dependencies" 2017-08-08 08:30:03 +00:00
Hugo Benichi
a22fbf4534 Merge "Connectivity OWNERS: let owners modify Android.mk"
am: 05be68698b

Change-Id: Iff94ca7089c074cc44f8e09cbce01f741c0b5c67
2017-08-08 07:34:39 +00:00
Hugo Benichi
05be68698b Merge "Connectivity OWNERS: let owners modify Android.mk" 2017-08-08 07:20:07 +00:00
Hugo Benichi
4478840931 DO NOT MERGE Fix some broken tests in frameworks-net with native dependencies
Rational for do not merge: the list of native libraries needed in
Android.mk is not consistent at the moment for aosp master and for
internal branches. Furthermore it is not consistent within internal
branches either. This patch only attempts to fix the tests of the
branches where it matters for development. Otherwise the cost of merge
conflicts makes it undesirable.

Test: All tests in runtest frameworks-net pass.
Merged-In: Ie0b8baa38ca39e92fbd698ebcead86dac0a67708

(cherry pick from commit 99e8ab6e46eec5dbd1b059b3732672d537b3cf34)

Change-Id: Ic732b3dafc3497235e455b8748ac4f99cf02b221
2017-08-08 16:06:54 +09:00
Hugo Benichi
afd2346bcc Connectivity OWNERS: let owners modify Android.mk
Since per-file overwrites the directory default, just allowing
build.master@android.com for Android.mk with a per-file rule prevents
the owners of the directory to modify Android.mk files without bypassing
OWNERS check in gerrit.

This patch fixes this issue for Connectivity OWNERS files by explicitly
listing Connectivity members for a few Android.mk files.

Test: build
Change-Id: I9c2a2519c3e7dd27e66334b090e074968b408cbc
2017-08-08 10:46:57 +09:00
Hugo Benichi
f6346af47e Merge "NetworkCapabilities: fix describeImmutableDifferences"
am: 7575ec2240

Change-Id: If38efacdeec8476880835657938e435f9b598525
2017-08-05 00:54:43 +00:00
Hugo Benichi
2ecb9408f4 NetworkCapabilities: fix describeImmutableDifferences
This patch fixes the mask used in describeImmutableDifferences which did
not correctly turn NET_CAPABILITY_NOT_METERED into bit flag.

Bug: 63326103
Test: added unit tests, runtest frameworks-net
Change-Id: Ib6b390b1daef5912859302692af7dcd6cfd3e39a
2017-08-04 15:17:40 +09:00
Alexandru-Andrei Rotaru
5469504e6b Notify the user and turn off tethering when the service is disallowed.
Added UserRestrinctionListener for turning the service off one the
DISALLOW_CONFIG_TETHERING is on into Tethering.  Added notification
about
tethering being turned off. Also added Unit Tests to test the
functionality
of the UserRestrictionListener added.

Bug: 27936525
Test: Turn the tehering service on (either wifi, usb or bluetooth).
Automatically the system should send a notification about the service
being active.Close settings from recents. From TestDPC User Restrictions
switch on DISALLOW_CONFIG_TETHERING. The tethering should be turned off
and a notification should appear informing that the service is inactive.

Merged-In: Ib7ea8885cedc2a842ebd4487c8b366a6666996bc
Change-Id: Ib7ea8885cedc2a842ebd4487c8b366a6666996bc
(cherry picked from commit fa6d5c5ca02f1bfc454bd3cd82e6c043661e7aa7)
2017-08-03 13:51:36 +00:00
Treehugger Robot
5027dd1026 Merge "Notify the user and turn off tethering when the service is disallowed." 2017-08-03 10:29:55 +00:00
Hugo Benichi
ef7d6d93c3 Merge "NetworkNotificationManager: correctly handle existing notifications"
am: 3451fb6156

Change-Id: I4432f66067ea1ab02e1d2dfe42530bcdafa52df6
2017-07-27 14:43:48 +00:00
Treehugger Robot
3451fb6156 Merge "NetworkNotificationManager: correctly handle existing notifications" 2017-07-27 14:36:47 +00:00
Hugo Benichi
5fcd050e0e NetworkNotificationManager: correctly handle existing notifications
This patch corrects a regression added by commit fb2609d3eee1 that did
not take into account the case of multiple notifications shown for a
single network id. Given how network notifications are triggered, it can
happen that NO_INTERNET and SIGN_IN notifications are both triggered for
the same network when captive portal detection is slow.

Contrary to the situation before commit fb2609d3eee1, a notification
priority order is introduced so that SIGN_IN always overrides
NO_INTERNET, and NO_INTERNET is ignored if SIGN_IN is already present.

Bug: 63676954
Bug: 62503737
Test: runtest frameworks-net, added new unit tests
Change-Id: Ib8658601e8d4dc6c41b335ab7dd8caa0cccd9531
2017-07-27 21:20:20 +09:00
Narayan Kamath
19d39ee384 Merge "Remove CoreTests: HeapTest"
am: c3fd3b8c7d

Change-Id: If6565f8bc8a655d3d7422f57db3dd6160459b092
2017-07-27 11:37:02 +00:00
Narayan Kamath
c3fd3b8c7d Merge "Remove CoreTests: HeapTest" 2017-07-27 11:26:10 +00:00
Lucas Gomez Jimenez
b3787b9ce7 Remove CoreTests: HeapTest
It is largely redundant due to other tests in art/ and libcore/

Test: Run CoreTests

Change-Id: I97485c522fed157d650b95225ad6641e4184d7bf
2017-07-26 13:31:08 +02:00