Commit Graph

702 Commits

Author SHA1 Message Date
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
Sohani Rao
cbd14a4f62 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
2016-11-10 15:49:00 -08:00
Stephen Chen
4f1700dd16 Fix documentation for NetworkStatsManager methods.
Test: N/A
Change-Id: I054ce104e561ece8e414c7ddad718665e51a692e
2016-11-07 11:31:24 -08:00
Stephen Chen
357f8fabc8 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.

Change-Id: I968b9e3352d7880e3fc438f12de628a2da057e0a
2016-11-04 09:55:21 -07:00
Stephen Chen
ed7fcb4d26 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
Change-Id: I0eccd10c0316357abb03af4d9cf0c4191a66abfb
2016-10-25 18:16:15 -07:00
Jeremy Joslin
1f23c3b1af VPN network stat accounting changes. am: 218bfe7a33 am: 0d309b7a47
am: e8c39cab9e

Change-Id: I1edec6bf2a590f5b0ff010adfd6f2785a1aaa994
2016-10-21 23:47:35 +00:00
Jeremy Joslin
e8c39cab9e VPN network stat accounting changes. am: 218bfe7a33
am: 0d309b7a47

Change-Id: I797ac586581f83ada0e94639dd435122c987f1c1
2016-10-21 23:43:06 +00:00
Jeremy Joslin
218bfe7a33 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
Change-Id: I62a75a0c0c0111e052b7903baa9f5d6d94ef57fd
2016-10-21 18:47:57 +09:00
Mitchell Wills
ddfcbf9669 DO NOT MERGE Manually merge commit 'f28778064383821ccf48c9570191f34a24aa513f' into nyc-mr1-dev-plus-aosp
am: 3c46ac731a  -s ours

Change-Id: Ic63cc762aa0a73af972539e5d08ef5a691babff7
2016-08-31 03:47:37 +00:00
Mitchell Wills
3c46ac731a DO NOT MERGE Manually merge commit 'f28778064383821ccf48c9570191f34a24aa513f' into nyc-mr1-dev-plus-aosp
Change-Id: I7cb1f97a5b931c2057a811d7947f47ad7320ef1c
2016-08-29 17:46:44 -07:00
Roshan Pius
88e33a2864 IpConfigStore: Changes for parsing old wifi backup
Some changes in IpConfigStore to parse old backup data. The old backup
data contained a raw byte dump of the ipconfig.txt. So, make changes in
IpConfigStore to parse the inputstream from backup data into
IpConfiguration objects.

Changes in the CL:
1. Make the |readIpAndProxyConfigurations| method static so that
it can be used as a utility for parsing the backup data.
2. Create a new version of |readIpAndProxyConfigurations| method to
accept an input stream parameter.
3. Make |writeConfig| method static so that it can be used for
unit-testing the backup migration logic.

BUG: 29075035
Change-Id: Ic074952d9f9ef143089a371e6c527470cb1c229c
(cherry picked from commit ad683cadb2)
2016-08-26 13:22:45 -07:00
Jack Yu
eb0b6630bb Do not print misleading debug messages in some scenarios. am: 05cca1a4cb am: d330f0ccc4
am: cc2b91697f

Change-Id: I18d2899cf7ac747a1789e17a2b9786aa9c49c002
2016-08-26 18:55:06 +00:00
Jack Yu
05cca1a4cb Do not print misleading debug messages in some scenarios.
When the mobile network is not active, querying the network
information might trigger the misleading debug messages. Added
some condition checks to prevent this.

bug: 30850733
Change-Id: Ice6d548a56f98bac7fe2ca6a06148350b505533d
2016-08-23 16:09:36 -07:00
Jeremy Joslin
12255e3655 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
Change-Id: I62a75a0c0c0111e052b7903baa9f5d6d94ef57fd
2016-08-16 15:53:57 -07:00
Jeff Sharkey
bed14ecfc5 Avoid caching services with missing binders.
When fetching system services early during boot, if the underlying
binder interface hasn't been published yet, we end up caching a
manager class that is broken for the remainder of the process
lifetime, and innocent downstream callers end up using the broken
cached manager.

Fix this by using an explicit exception to quickly abort manager
creation when the underlying binder is missing.  The exception is
only used to skip the remainder of the manager creation, and it
doesn't actually crash the process.

Bug: 28634953
Change-Id: I0cb62261e6d6833660704b93a11185aa11a2ac97
2016-08-11 09:44:30 -06:00
Daniel 2 Olofsson
0b9f2f715f Merge \\"Fix NativeDaemonConnectorException issue accessing null object\\" into nyc-mr1-dev am: 6ba04e354e
am: 961490e8ae

Change-Id: I7f4be199eded99a3abc06321083a80f861f66ab9
2016-06-30 00:31:19 +00:00
TreeHugger Robot
6ba04e354e Merge "Fix NativeDaemonConnectorException issue accessing null object" into nyc-mr1-dev 2016-06-30 00:20:51 +00:00
Jack Yu
3f28642bf1 Merge \"Merge \\"Added a virtual interface for Video Telephony call usage counting\\" into nyc-mr1-dev am: 83e96c1957\" into nyc-mr1-dev-plus-aosp
am: 3249cf25bd

Change-Id: I57546ac79c77543384fc5e0b327deda019ecc2b8
2016-06-29 22:17:39 +00:00
Daniel 2 Olofsson
ab17d3a113 Fix NativeDaemonConnectorException issue accessing null object
When function getCode is called on
NativeDaemonConnectorException object it may throw exception
due to mEvent object not being set for certain constructors.
Fix is to return a default error code as expected if mEvent
object has not been set rather than trying to call
mEvent.getCode().

Change-Id: Ia8aa23deb8871bb4df73096cc489b685a1765f16
2016-06-29 14:53:28 -06:00
Jack Yu
e544a48eb2 Added a virtual interface for Video Telephony call usage counting
1. Added a virtual VT interface.
2. Qeury VT usage from telephony service.

bug: 20888836
Change-Id: I3df0c22922f8394554230b53f8ae091e17c95595
2016-06-29 11:54:56 -07:00
Antonio Cansado
02f3b13b51 Merge \\\"Fix infinite loop when registering data usage callback.\\\" into nyc-dev am: 55e82ab60f am: 13cf0e7d54
am: 1d4fd3ed27

Change-Id: I5140373d930726e0b93fa62ac03315a37c581b5b
2016-06-20 22:44:51 +00:00
Antonio Cansado
55e82ab60f Merge "Fix infinite loop when registering data usage callback." into nyc-dev 2016-06-20 22:23:36 +00:00
Antonio Cansado
320e313d2c Fix infinite loop when registering data usage callback.
Trivial fix is to call the method that takes the handler as a param.

Bug: 29508547
Change-Id: I75ba30a1663be265eed56b24deda82e83fd47a43
2016-06-20 15:03:03 -07:00