Commit Graph

3124 Commits

Author SHA1 Message Date
Ryuki Nakamura
8d2a076b4e Merge "Fix NPE while performing NetworkStatsService.removeUidsLocked()"
am: a6ce3f3021

Change-Id: I3f43b25622e5052e6336983da84b92e12f3e06dc
2017-03-20 17:05:16 +00:00
Ryuki Nakamura
662a01236a Fix NPE while performing NetworkStatsService.removeUidsLocked()
Symptom:
NPE occurred while performing NetworkStatsService.removeUidsLocked().

Root cause:
NetworkStatsService refers to mUidRecorder at
NetworkStatsService.removeUidsLocked() when mUserReceiver received
Intent.ACTION_USER_REMOVED.
However NetworkStatsService sets mUidRecorder to null without
unregistering mUserReceiver when mShutdownReceiver received
Intent.ACTION_SHUTDOWN.
Therefore NPE occurred when mUserReceiver received
Intent.ACTION_USER_REMOVED after mShutdownReceiver received
Intent.ACTION_SHUTDOWN.

Solution:
Unregister mUserReceiver before setting mUidRecorder to null when
mShutdownReceiver received Intent.ACTION_SHUTDOWN.

Bug: 36015339

Change-Id: I9279e4c6ae07d94e7ec519c40b2d973c84d8fef1
2017-03-07 07:12:51 +00:00
Nathan Harold
fab5eff9a6 Merge "Add API Surface for creating IpSec Transforms" am: 7645fa2816 am: 5466fbdc27
am: 3ddaf3e6b0

Change-Id: Idceae0e5a1af2f357378b03fc0d257dab605b217
2017-03-01 14:22:57 +00:00
Nathan Harold
5466fbdc27 Merge "Add API Surface for creating IpSec Transforms"
am: 7645fa2816

Change-Id: Ibe70a60c5c5808a7877145cccefcc1f11bfacc51
2017-03-01 14:12:55 +00:00
Nathan Harold
b1f605fc33 Add API Surface for creating IpSec Transforms
This CL adds an API to set up an IPSec Security Association
and Security Policy to perform Transport-Mode and Tunnel-Mode encapuslation
of IP Packets.

Bug: 30984788
Bug: 34811752
Test: 34812052, 34811227
Change-Id: Ic9f63c7bb366302a24baa3e1b79020210910ac0a
2017-02-28 22:01:20 -08:00
Stephen Chen
a86d26ef4b Merge commit '29a9cf2250e0eaed062fd0f990a04b923896279b' into nyc-mr1-dev-plus-aosp am: 8aa88a533c
am: 30fb2f228b

Change-Id: I318efe59e1967150338a7bd8001c27d9ebe3cf75
2017-01-27 07:42:07 +00:00
Hugo Benichi
7ee689b582 Merge commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1' into nyc-mr1-dev-plus-aosp am: cf7d2e1221 -s ours
am: d44a2395e3

Change-Id: I7028ef23f597e6e82ecdb6c11a6c8dcdb1d1f77b
2017-01-27 07:40:56 +00:00
Stephen Chen
30fb2f228b Merge commit '29a9cf2250e0eaed062fd0f990a04b923896279b' into nyc-mr1-dev-plus-aosp
am: 8aa88a533c

Change-Id: I3de8f91b1c9d0160ec58be8347502769580e0159
2017-01-27 07:29:07 +00:00
Hugo Benichi
d44a2395e3 Merge commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1' into nyc-mr1-dev-plus-aosp
am: cf7d2e1221  -s ours

Change-Id: Ie2f8c1e18acf57238fe4816812562ecd1644cf51
2017-01-27 07:28:06 +00:00
The Android Automerger
8aa88a533c Merge commit '29a9cf2250e0eaed062fd0f990a04b923896279b' into nyc-mr1-dev-plus-aosp
* commit '29a9cf2250e0eaed062fd0f990a04b923896279b':
  Implement metered tracking for NetworkStats summary queries.
2017-01-27 06:39:41 +00:00
The Android Automerger
cf7d2e1221 Merge commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1' into nyc-mr1-dev-plus-aosp
* commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1': (35 commits)
  NetworkMonitor: send one DNS probe per web probe
  NetworkMonitor metrics: add first validation information
  APF: also drop any ICMPv6 RSs
  ConnectivityServiceTest: fix testAvoidBadWifiSettings
  Fix ConnectivityServiceTest testRequestBenchmark
  Switch over to new "time.android.com" NTP pool.
  Define API for metering network stats buckets.
  Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
  Use @Ignore to explicitly disable a @Test method.
  Fixed NetworkStatsServiceTest and converted it to JUnit4.
  VPN network stat accounting changes.
  ConnectivityThread: use lazy holder idiom
  ConnectivityManager: use ConnectivityThread looper
  ConnectivityManager: a simpler CallbackHandler
  Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
  Add a null check for the OnStartTetheringCallback.
  TokenBucket for rate-limiting and throttling
  IpConnectivityMetrics reads buffer size in settings
  CaptivePortalLogin: set mixed content policy to compatibility.
  Add IP conn metrics to dumpsys and bug reports
  ...
2017-01-27 06:39:05 +00:00
Stephen Chen
29a9cf2250 Implement metered tracking for NetworkStats summary queries.
Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 357f8fabc8)

Change-Id: I46da93ba4afa968facf98f7c3d844fd0c469095a
2017-01-26 18:52:32 +09:00
Stephen Chen
a471b1647e Define API for metering network stats buckets.
This is a continuation of b/26545374, since now we can also set the
metered bit with NetworkScorer. The tracking of metered state changes
will be implemented in a seperate CL.

Bug: 31015360
Bug: 26545374
Test: N/A

(cherry picked from commit ed7fcb4d26)

Change-Id: I6a2fcc8577d62daa8823dff9e0128a5cf39ede7b
2017-01-26 18:52:08 +09:00
Jeremy Joslin
921f6f6797 VPN network stat accounting changes.
Properly account for VPN apps that make heavy use of the tun
interface. Prior to this change a VPN app could be incorrectly charged
for more data than it actually used if it sent more traffic through
the tun interface than the underlying interface.

This change excludes VPN app traffic on the tun interface from the
adjustment pool and doesn't redistribute traffic to the VPN app.
Instead all of the redistributed traffic is deducted from the VPN app
which effectively represents any overhead incurred by the VPN app.

BUG: 30557871

(cherry picked from commit 12255e3655)

Change-Id: I06f01aa8fe5fdc06b2d36cfb9c68feb244c2e5de
2017-01-26 18:51:53 +09:00
Jeff Sharkey
289eac11a2 StrictMode to detect untagged network traffic.
Network usage is tracked by the kernel at the UID level, which is
granular enough for normal apps, but large components (such as the
system server) are impossible to debug without adding additional
socket tagging to help identify subsystems within a UID.

To help ensure that system components tag all their network traffic,
this change offers a new StrictMode option to detect and report
untagged sockets.

Test: builds, boots, all common traffic tagged
Bug: 30943431, 30414041
Change-Id: I825c7941076054732264690247de2863342638e2
2017-01-19 20:52:05 -07:00
Makoto Onuki
3f75b41a1c Merge "Support protofied dumpsys for NetStats" 2017-01-18 21:30:20 +00:00
Stephen Chen
ff7dba4721 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
am: f57c4def50  -s ours

Change-Id: I970aed286a5bcc69d2ee69ea23b53af36dc2bbea
2017-01-18 10:48:16 +00:00
Stephen Chen
1390fbbed8 DO NOT MERGE: Define API for metering network stats buckets.
am: 88b52b25f7  -s ours

Change-Id: I03a015bbc76c762d48688b1c66562bbd599d4265
2017-01-18 10:44:12 +00:00
Philip P. Moltmann
ade5083d25 DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
am: 8ad38f0f6c  -s ours

Change-Id: I7d66e82b940bd88c7e5da0d4a4f2008f14d98a2e
2017-01-18 10:37:37 +00:00
Stephen Chen
f57c4def50 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 357f8fabc8)

(cherry picked from commit 92b6175069)

Change-Id: I79e401fc4159264a075febba82bd8c295b8e677f
2017-01-18 19:08:41 +09:00
Stephen Chen
88b52b25f7 DO NOT MERGE: Define API for metering network stats buckets.
This is a continuation of b/26545374, since now we can also set the
metered bit with NetworkScorer. The tracking of metered state changes
will be implemented in a seperate CL.

Bug: 31015360
Bug: 26545374
Test: N/A

(cherry picked from commit ed7fcb4d26)

(cherry picked from commit ebace40092)

Change-Id: I01ebb270c5bf7f2383e8923cce72545ca1bee118
2017-01-18 19:08:32 +09:00
Philip P. Moltmann
8ad38f0f6c DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
Fixes: 28530428

(cherry picked from commit 79a3c031a0)

(cherry picked from commit 2838d9bb56)

Change-Id: Ib8f8da947af804c8b203928e57ed6a8aedbf0684
2017-01-18 19:08:16 +09:00
Makoto Onuki
feb5df9814 Support protofied dumpsys for NetStats
Bug 34228873
Test: manual tests with "incident_report netstats"

Change-Id: I359b364c64d9798fd4229018a905658d5d46ea5c
2017-01-17 14:16:01 -08:00
Jeff Davidson
601bc9b9a7 Merge "Add Log.wtf when getSummaryForAllUid NPEs." 2016-12-14 19:29:15 +00:00
Jeff Davidson
ed23aa6ca4 Add Log.wtf when getSummaryForAllUid NPEs.
This will provide stack trace information from the system process
which should enable us to more easily track down where the crash is
occurring.

Test: Builds locally
Bug: 33427276
Change-Id: I584a568fc038771afb28a534e2eefe2f763ed5e1
2016-12-12 12:11:16 -08:00
Lorenzo Colitti
34af49bb01 Merge changes from topic 'framework-net-aosp' am: a79b99893c am: 1a2fa0f372 am: c1c6b379c4
am: 20b77883fa

Change-Id: Ic6ee235cfbe3eea990f729de36119f8ce12a6a17
2016-12-09 11:25:03 +00:00
Stephen Chen
0e271e1517 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries. am: 92b6175069 -s ours am: 3f5785260e -s ours am: c8be8d5853
am: 9b8712a3a0  -s ours

Change-Id: I8d502d83e00fdc1cb295b32c557ab253f4b5c091
2016-12-09 11:10:40 +00:00
Stephen Chen
597d0445ce DO NOT MERGE: Define API for metering network stats buckets. am: ebace40092 -s ours am: 419a061017 -s ours am: f394f5c66f
am: c13d7998dc  -s ours

Change-Id: Ia147a494bf908d64d938355bd357d570ac783b76
2016-12-09 11:03:13 +00:00
Jeremy Joslin
ff852600b5 DO NOT MERGE: VPN network stat accounting changes. am: b135f1d5a8 -s ours am: 12bb3f057b -s ours am: 0e885ddad1
am: 483611214d  -s ours

Change-Id: I356877d99b1304777d3d9103e9e0d421b1bb112b
2016-12-09 10:59:11 +00:00
Philip P. Moltmann
473af6b8f1 DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service. am: 2838d9bb56 -s ours am: 6e8a33a583 -s ours am: 4ede7f4df7
am: 6c6a790ddc  -s ours

Change-Id: Ie5b45503c2917340397abdbd6df5ecc407d90c26
2016-12-09 10:55:07 +00:00
Lorenzo Colitti
c1c6b379c4 Merge changes from topic 'framework-net-aosp' am: a79b99893c
am: 1a2fa0f372

Change-Id: I746ee7fd37946df2ba31ca8aee928fa3ef04591c
2016-12-09 10:18:11 +00:00
Stephen Chen
c8be8d5853 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries. am: 92b6175069 -s ours
am: 3f5785260e  -s ours

Change-Id: Ib6f4a4af04c3f4e26028604c66f6cc4f1720a801
2016-12-09 10:04:41 +00:00
Stephen Chen
f394f5c66f DO NOT MERGE: Define API for metering network stats buckets. am: ebace40092 -s ours
am: 419a061017  -s ours

Change-Id: Ide68c11828a6473e330715bb4efe4d0ade9a46a2
2016-12-09 09:58:05 +00:00
Jeremy Joslin
0e885ddad1 DO NOT MERGE: VPN network stat accounting changes. am: b135f1d5a8 -s ours
am: 12bb3f057b  -s ours

Change-Id: Id9d26bf1b9512a85cd9b6a3253b86b77a6f62e77
2016-12-09 09:54:07 +00:00
Philip P. Moltmann
4ede7f4df7 DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service. am: 2838d9bb56 -s ours
am: 6e8a33a583  -s ours

Change-Id: I95d1b3e8b676572dd3fb78aa750731e4c4c6a31f
2016-12-09 09:50:04 +00:00
Lorenzo Colitti
a79b99893c Merge changes from topic 'framework-net-aosp'
* changes:
  DO NOT MERGE: frameworks-test: adding missing @SmallTest
  DO NOT MERGE: Netd events: record connect() success/errno
  DO NOT MERGE: Add missing dependency.
  DO NOT MERGE: Show notification for always-on app VPN
  DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
  DO NOT MERGE: NetworkMonitor: send one DNS probe per web probe
  DO NOT MERGE: NetworkMonitor metrics: add first validation information
  DO NOT MERGE: APF: also drop any ICMPv6 RSs
  DO NOT MERGE: ConnectivityServiceTest: fix testAvoidBadWifiSettings
  DO NOT MERGE: Fix ConnectivityServiceTest testRequestBenchmark
  DO NOT MERGE: Switch over to new "time.android.com" NTP pool.
  DO NOT MERGE: Define API for metering network stats buckets.
  DO NOT MERGE: Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
  DO NOT MERGE: Use @Ignore to explicitly disable a @Test method.
  DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4.
  DO NOT MERGE: VPN network stat accounting changes.
  DO NOT MERGE: ConnectivityThread: use lazy holder idiom
  DO NOT MERGE: ConnectivityManager: use ConnectivityThread looper
  DO NOT MERGE: ConnectivityManager: a simpler CallbackHandler
  DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
  DO NOT MERGE: Add a null check for the OnStartTetheringCallback.
2016-12-09 09:11:22 +00:00
Stephen Chen
92b6175069 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 357f8fabc8)

Change-Id: I46da93ba4afa968facf98f7c3d844fd0c469095a
2016-12-09 13:59:33 +09:00
Stephen Chen
ebace40092 DO NOT MERGE: Define API for metering network stats buckets.
This is a continuation of b/26545374, since now we can also set the
metered bit with NetworkScorer. The tracking of metered state changes
will be implemented in a seperate CL.

Bug: 31015360
Bug: 26545374
Test: N/A

(cherry picked from commit ed7fcb4d26)

Change-Id: I6a2fcc8577d62daa8823dff9e0128a5cf39ede7b
2016-12-09 13:59:17 +09:00
Jeremy Joslin
b135f1d5a8 DO NOT MERGE: VPN network stat accounting changes.
Properly account for VPN apps that make heavy use of the tun
interface. Prior to this change a VPN app could be incorrectly charged
for more data than it actually used if it sent more traffic through
the tun interface than the underlying interface.

This change excludes VPN app traffic on the tun interface from the
adjustment pool and doesn't redistribute traffic to the VPN app.
Instead all of the redistributed traffic is deducted from the VPN app
which effectively represents any overhead incurred by the VPN app.

BUG: 30557871

(cherry picked from commit 12255e3655)

Change-Id: I06f01aa8fe5fdc06b2d36cfb9c68feb244c2e5de
2016-12-09 13:42:29 +09:00
Philip P. Moltmann
2838d9bb56 DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
Fixes: 28530428

(cherry picked from commit 79a3c031a0)

Change-Id: If2bfc06589adb361f11b89cd5923cb5c255cb680
2016-12-09 13:42:09 +09:00
Amith Yamasani
21c5c6fb0a Secure MATCH_UNINSTALLED_PACKAGES across users
Introduce a new internal flag MATCH_ANY_USER for genuine uses
of searching through all apps on the device.

Some temporary accommodations for Launchers that reach across
to the work profile until we have a new LauncherApps API to do
that officially.

Bug: 31000380
Test: CTS tests added
Change-Id: I2e43dc49d6c2e11814a8f8d1eb07ef557f31af34
2016-11-30 13:24:53 -08:00
Jeff Sharkey
931afb110d Merge "StrictMode to detect untagged network traffic." am: 0bb7880e77 am: bc9c6a91b9 am: 8cbc5e3eac
am: 55727aaede

Change-Id: I272964fc9c2a9e350bacc0586dd6b2d4a23c5f51
2016-11-21 23:05:12 +00:00
Jeff Sharkey
8cbc5e3eac Merge "StrictMode to detect untagged network traffic." am: 0bb7880e77
am: bc9c6a91b9

Change-Id: Id6ce5cfedab250f25c0eb8b0c49971e9e20cbeb2
2016-11-21 21:48:31 +00:00
Jeff Sharkey
bc9c6a91b9 Merge "StrictMode to detect untagged network traffic."
am: 0bb7880e77

Change-Id: I52cdce87d87ec503294e431c8f22e87235bdbf79
2016-11-21 21:43:58 +00:00
Treehugger Robot
0bb7880e77 Merge "StrictMode to detect untagged network traffic." 2016-11-21 21:33:15 +00:00
Jeff Sharkey
66dca17fe7 StrictMode to detect untagged network traffic.
Define some constants for early use in AOSP code.

Test: builds, boots, all common traffic tagged
Bug: 30943431
Change-Id: Ia58a8933bccfddbc027afb78c63ae65bd71ce562
2016-11-21 12:15:16 -07:00
Sohani Rao
07ce01dfa3 Merge "Permissions check for Wifi Display configuration" am: f5c32a411c am: 35b0d6e8a5 am: cc075c5823
am: ac2191ebb0  -s ours

Change-Id: I5a03c8b0f8859fc4cefcdf795a7282543c74d708
2016-11-14 20:07:39 +00:00
Sohani Rao
cc075c5823 Merge "Permissions check for Wifi Display configuration" am: f5c32a411c
am: 35b0d6e8a5

Change-Id: Iac379dace6fd8b01e5bb80a193f79c65ace1f9b9
2016-11-14 19:44:46 +00:00
Sohani Rao
35b0d6e8a5 Merge "Permissions check for Wifi Display configuration"
am: f5c32a411c

Change-Id: I7a1c2d0f48728cd5e056076a2cf1499a7abb2438
2016-11-14 19:33:31 +00:00
Sohani Rao
e2667a9df6 Permissions check for Wifi Display configuration
Wifi Display is configured using the AIDL call setMiracastMode()
and using a message over the async channel SET_WFD_INFO.
Enforce permissions on the calling uid before updating the config

Bug: 18668877
Test: Unit tests
Change-Id: I0be2d2af49070aad759f24bd31331f7df39a0422
Merged-In: I0be2d2af49070aad759f24bd31331f7df39a0422
2016-11-14 10:21:31 -08:00