Commit Graph

3519 Commits

Author SHA1 Message Date
Hugo Benichi
4953ce3d15 Connectivity metrics: simplify ConnectivityMetricsEvent
Now that ConnectivityMetricsEvent is only used for core networking
metrics and is not @SystemApi anymore, remove unused fields and prepare
for additional new fields.

Test: updated unit tests, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I15abad19981d491f16f2a3afe401f1e833079907
2017-03-15 15:12:38 +09:00
Hugo Benichi
2de8920989 IP connectivity metrics: update ipconnectivity.proto
This patch adds several new fields to ipconnectivity.proto for
improving APF metrics, connect metrics, and link_layer inference.

Test: build, flashed, ran $ adb shell dumpsys connmetrics list proto
      updated metrics unit tests depending on proto schema
Bug: 34901696
Change-Id: I6f68e16f583a6b407f33f8a500133e100f3453c7
2017-03-09 15:19:02 +09:00
Etan Cohen
61d46aad9e Merge "[CM] Allow timeout in request network" am: 43d964ac8f am: 24c862dad6
am: ac879cbcaf

Change-Id: If42250966d619073d45d608aab454589213b1756
2017-03-07 17:02:05 +00:00
Etan Cohen
24c862dad6 Merge "[CM] Allow timeout in request network"
am: 43d964ac8f

Change-Id: Ic7a3da0a5292be5e13abca9c98c422bc2f50f3a0
2017-03-07 16:49:53 +00:00
Etan Cohen
43d964ac8f Merge "[CM] Allow timeout in request network" 2017-03-07 16:40:27 +00:00
Erik Kline
2b1df53310 Merge "request{LinkProperties,NetworkCapabilities} no longer needed" am: 67a9265809 am: 57c8c6b5f4
am: bb54baba04

Change-Id: Id2aa8aeff6d299edb85955c12ab0a04023458597
2017-03-07 13:42:11 +00:00
Erik Kline
57c8c6b5f4 Merge "request{LinkProperties,NetworkCapabilities} no longer needed"
am: 67a9265809

Change-Id: I79b9323be242ed5d2bf83962f78c613a465a20b8
2017-03-07 13:33:29 +00:00
Treehugger Robot
67a9265809 Merge "request{LinkProperties,NetworkCapabilities} no longer needed" 2017-03-07 13:27:11 +00:00
Erik Kline
26af1d81b3 request{LinkProperties,NetworkCapabilities} no longer needed
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - manual USB tethering toggling between WiFi and mobile
Bug: 32163131
Change-Id: I57edf5114b6361f320577c7870e40f8b3cdf74ce
2017-03-07 17:18:06 +09:00
Erik Kline
0fd4b155a5 Merge "Always send all available state when calling onAvailable()." am: 8fdbb6d6e2 am: b90963fe4d
am: 3765538bab

Change-Id: Ic82e3cb92841ea99972faad6ae004d77c725831b
2017-03-07 06:08:40 +00:00
Erik Kline
b90963fe4d Merge "Always send all available state when calling onAvailable()."
am: 8fdbb6d6e2

Change-Id: I81e70fecf060a4103b51084a60a32c78f6219f6b
2017-03-07 06:00:09 +00:00
Treehugger Robot
8fdbb6d6e2 Merge "Always send all available state when calling onAvailable()." 2017-03-07 05:51:41 +00:00
Erik Kline
99f301bdfd Always send all available state when calling onAvailable().
The state that needs to be transferred includes:
    - NetworkCapabilities
    - LinkProperties
    - whether the network is currently suspended

Additionally:
    - Rename notifyNetworkCallback() to notifyNetworkAvailable()
      in order to clarify its real function.
    - fix previous copy/paste error in unittest

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - USB tethering with mobile and Wi-Fi upstream toggling
Bug: 32163131
Change-Id: Ib4460bcd5d08863a9feac9e8ab41a238897bb3ea
2017-03-07 12:57:26 +09:00
Hugo Benichi
ca809f4260 Merge "Revert "ConnectivityManager: no double NetworkCallback registration" because oit caused regressions http://b/35955593, http://b/35921499." am: 704520c392 am: e8a3a43193
am: 22d4258a75

Change-Id: I8e66e223003a38735b707d21d7bedb19170b1937
2017-03-06 12:45:10 +00:00
Hugo Benichi
e8a3a43193 Merge "Revert "ConnectivityManager: no double NetworkCallback registration" because oit caused regressions http://b/35955593, http://b/35921499."
am: 704520c392

Change-Id: Ia0ae78f8406b81377491407cf5ef8ca339952def
2017-03-06 12:30:05 +00:00
Hugo Benichi
1d6742c945 Revert "ConnectivityManager: no double NetworkCallback registration" because oit caused regressions http://b/35955593, http://b/35921499.
This reverts commit ca4bf6edc3.

Change-Id: I86c07c113f24753be7c977e6d7f570b99391e1b5
2017-03-06 06:16:51 +00:00
Etan Cohen
f67bde923c [CM] Allow timeout in request network
Add (unhide) a public API which provides network requests with a
timeout. When timed-out the (newly unhidden) onUnavailable() callback
is triggered.

Note: this CL does not add a handler to the API to be consistent
with the existing APIs. There is a separate effort (b/32130437)
to update these APIs with Handlers.

Bug: 31399536
Test: unit tests and CTS (new)
Change-Id: I45ce9ada63372cb56937bb620bfbb7729e5e25d2
2017-03-02 08:06:27 -08:00
Hugo Benichi
a5dd9aba90 Merge "ConnectivityManager: no double NetworkCallback registration" am: 06a192fa49 am: e71290cc46
am: 974e83cc0b

Change-Id: I73569fd084c14a78067e09565418f296994cd424
2017-03-02 08:12:09 +00:00
Hugo Benichi
e71290cc46 Merge "ConnectivityManager: no double NetworkCallback registration"
am: 06a192fa49

Change-Id: I250fa7d3c5e37a66caa41cc898a44bcb18c9a0c4
2017-03-02 08:04:03 +00:00
Hugo Benichi
ca4bf6edc3 ConnectivityManager: no double NetworkCallback registration
Test: new test in ConnectivityManagerTest
Bug: 20701525
Change-Id: I205333d31d43e6e6c7fe704ce63b458065f345ce
2017-03-02 15:19:37 +09:00
Geoffrey Pitsch
9b561aa6f8 Channels for Frameworks notifications
Adapts all notifications used by system services to use channels.
Channels are initialized by SystemServer after the NotificationService
has started.

Test: runtest systemui-notification
Change-Id: I25c45293b786adb57787aeab4c2613c9d7c89dab
2017-03-01 10:17:15 -05:00
Erik Kline
37bb686bb7 Merge "Also test for additional NetworkCallback calls" am: dff6c5c30d am: 6978b2427c
am: 02310829cf

Change-Id: I0264a471312423e896a1c2f479c0eeda737a1567
2017-03-01 11:13:14 +00:00
Erik Kline
6978b2427c Merge "Also test for additional NetworkCallback calls"
am: dff6c5c30d

Change-Id: I00b3f7be06bde167872d0cdefe940cda5e138846
2017-03-01 11:03:08 +00:00
Erik Kline
4f89af67b2 Also test for additional NetworkCallback calls
Specifcally:
    - onCapabilitiesChanged
    - onLinkPropertiesChanged
    - onNetworkSuspended

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 32163131

Change-Id: Ie0f7c8ac21313b11980bb335c89ecde6fd8e311c
2017-03-01 18:24:36 +09:00
Erik Kline
2762541780 Merge "Update UpstreamNetworkMonitor to use custom Handlers" am: 35c89886c2 am: baaa19d65a
am: c239511cdb

Change-Id: I9a210b4896810e7365b2403495716395b3866650
2017-02-24 08:24:51 +00:00
Erik Kline
baaa19d65a Merge "Update UpstreamNetworkMonitor to use custom Handlers"
am: 35c89886c2

Change-Id: I76433822a9b7c124e4b7cfcf2a20cb0e43a60199
2017-02-24 08:15:19 +00:00
Erik Kline
7807ff12af Update UpstreamNetworkMonitor to use custom Handlers
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 32130437
Bug: 32163131

Change-Id: I2bc3f87cdf7fa6392b4750eb8adb4ea33c6a3f43
2017-02-24 13:06:51 +09:00
Hugo Benichi
9840818598 Merge "IP connectivity metrics: cleanup obsolete code" 2017-02-23 07:02:30 +00:00
Hugo Benichi
8f5e49bbe3 Merge "ConnectivityManager: allow custom Handlers" am: ef69246260 am: 585855decf
am: 0f99e5367b

Change-Id: I9f7fc64c2d3d6f88344c9547b8e1ac17cf3d1104
2017-02-22 05:59:44 +00:00
Hugo Benichi
f3fe279f50 IP connectivity metrics: cleanup obsolete code
This patch cleans obsolete code related to IP connectivity metrics:
 - remove @SystemApi on android.net.metrics: now that metrics events
   are processed and serialized in the frameworks only, event classes
   should not appear in the system apis.
 - remove obsolete Logger classes: ConnectivityMetrics app was the
   unique user of ConnectivityMetricsLogger until nyc-mr1. From nyc-mr1
   the app started using dumpsys to get metrics for IpConnectivity and
   Telephony, which made ConnectivityMetricsLogger obsolete.
 - simplifications in MetricsTestUtil

Test: - runtest frameworks-net
      - manually verified $ adb shell dumpsys connmetrics
Bug: 30054585
Bug: 32648597
Change-Id: I85ef65f7f69eb9299e4636cc7af54067201d9daf
2017-02-22 12:56:38 +09:00
Hugo Benichi
585855decf Merge "ConnectivityManager: allow custom Handlers"
am: ef69246260

Change-Id: I8da5540f6561cdef4adc91bbeeb9c21a91c08d49
2017-02-22 03:48:10 +00:00
Hugo Benichi
fd44e91bcb ConnectivityManager: allow custom Handlers
This patch adds overloaded version of registerDefaultNetworkCallback
registerNetworkCallback, and requestNetwork with an additional Handler
argument that is used for running the caller provided NetworkCallback.

It also clarifies the documentation of the existing methods that
implicitly uses the internal singleton ConnectivityThread about which
internal Handler is used for running NetworkCallbacks.

Test: build, flashed, booted device
Bug: 32130437
Change-Id: Iae15f81e47e2dc0355baf2f2c1679b77e56af299
2017-02-22 09:24:01 +09:00
Robin Lee
0b86c5519c Merge "Reinstate USER_PRESENT for ConnectivityService" am: ba7503a1eb am: 02f7e1039b
am: 4d00a13c35

Change-Id: Id22859b30b848418cbc1bcf46c74ebd2aa88cd06
2017-02-21 18:13:12 +00:00
Robin Lee
02f7e1039b Merge "Reinstate USER_PRESENT for ConnectivityService"
am: ba7503a1eb

Change-Id: If8b7239cdabdd79d9ea24baf99e95c6ec1a9acf3
2017-02-21 17:55:07 +00:00
Treehugger Robot
ba7503a1eb Merge "Reinstate USER_PRESENT for ConnectivityService" 2017-02-21 13:23:41 +00:00
sj.cha
4b03d2d6d5 Merge "Infinite reboot when OS upgrade from M to N with set Always-on VPN" am: 63ca8979e4 am: b4b83c82cd am: 65373db594
am: 9b75c75197

Change-Id: Ib7e586a778c6fb9b920f0790e4b343c122250bb7
2017-02-17 13:32:07 +00:00
sj.cha
9b75c75197 Merge "Infinite reboot when OS upgrade from M to N with set Always-on VPN" am: 63ca8979e4 am: b4b83c82cd
am: 65373db594

Change-Id: I5e0faee7a0b1c6bdfafe77560a91e999f40edc4a
2017-02-17 13:27:04 +00:00
sj.cha
65373db594 Merge "Infinite reboot when OS upgrade from M to N with set Always-on VPN" am: 63ca8979e4
am: b4b83c82cd

Change-Id: I82c297e654af6690c6a3be216a0da08a3aff5b9d
2017-02-17 13:21:34 +00:00
sj.cha
b4b83c82cd Merge "Infinite reboot when OS upgrade from M to N with set Always-on VPN"
am: 63ca8979e4

Change-Id: I21a69eb02b13b20f66996836d54b8aadadfa80ec
2017-02-17 13:17:00 +00:00
Treehugger Robot
63ca8979e4 Merge "Infinite reboot when OS upgrade from M to N with set Always-on VPN" 2017-02-17 13:07:21 +00:00
Etan Cohen
e4d934db90 Merge changes from topic 'cm_request_to' am: d6877b2576 am: 0a8122afa9 am: 6e3ea85738
am: a8bb0c7fdd

Change-Id: I2cef23ff183428041273007cf9bb1b655f92372a
2017-02-16 14:46:52 +00:00
Etan Cohen
a8bb0c7fdd Merge changes from topic 'cm_request_to' am: d6877b2576 am: 0a8122afa9
am: 6e3ea85738

Change-Id: Ief32189b0f6f2c70d7e4097f70dbdf8195bd8713
2017-02-16 14:38:28 +00:00
Etan Cohen
6e3ea85738 Merge changes from topic 'cm_request_to' am: d6877b2576
am: 0a8122afa9

Change-Id: I2720e64e4af88df9d3a7b6209e9fcef4a0340986
2017-02-16 14:29:29 +00:00
Etan Cohen
0a8122afa9 Merge changes from topic 'cm_request_to'
am: d6877b2576

Change-Id: I9ca18c0570be831ab37cdf200c28b0778117198d
2017-02-16 14:23:18 +00:00
Etan Cohen
d6877b2576 Merge changes from topic 'cm_request_to'
* changes:
  [CM] Remove maximum timeout value for request network
  [CM] Remove non-functional timeout from request network
2017-02-16 14:15:44 +00:00
Etan Cohen
8500016ea4 [CM] Remove maximum timeout value for request network
The request network with timeout was originally created with a
check of max timeout against a constant of 100 minutes. However,
the API was not public and did not implement a timeout. Any users
were internal and never got any onUnavailable() callback (since
timeout never triggered).

There is no reason to have a max timeout so the constant is
remove.

Bug: 31399536
Test: unit tests and CTS of ConnectivityManager
Change-Id: Icbedfb4299d75b6a7e3e43720111531f1faafd06
2017-02-16 14:15:16 +00:00
Hugo Benichi
6987c7d743 Merge "ConnectivityManager: fix potential NPE" am: b688dd18ab am: 95d22b0c92 am: 3b0915b6f5
am: 47be55d3ec

Change-Id: I628fdf36a5a80a2d93ff4c4785253cb16a9e4ad2
2017-02-15 01:29:31 +00:00
Hugo Benichi
47be55d3ec Merge "ConnectivityManager: fix potential NPE" am: b688dd18ab am: 95d22b0c92
am: 3b0915b6f5

Change-Id: I6f487ce9da656610c939ddc78e834ac8ef5f8135
2017-02-15 01:24:29 +00:00
Hugo Benichi
3b0915b6f5 Merge "ConnectivityManager: fix potential NPE" am: b688dd18ab
am: 95d22b0c92

Change-Id: I72e114037ce6a0ec53863749b8ffa34513c9fdce
2017-02-15 01:09:58 +00:00
Hugo Benichi
95d22b0c92 Merge "ConnectivityManager: fix potential NPE"
am: b688dd18ab

Change-Id: If562fc6a921569ad9d3141cac72b6f395a30da9e
2017-02-15 01:05:24 +00:00