Commit Graph

3295 Commits

Author SHA1 Message Date
Jeff Sharkey
ffd48a2cf8 Return NetworkStats bundle from NM service.
Introduce NetworkStats which is a collection of network statistics,
which should match the structure communicated by kernel module through
netd.  Will introduce tags and fg/bg stats later.  Kept entirely in a
flat data structure to optimize parcel speed.

Initial pass at returning NetworkStats from NetworkManagementService,
both summary and details.  Will eventually pull data from kernel module
over netd connection.

Change-Id: I92d9f61678ec8c22e2ce26775fb035a0cf32413f
2011-05-04 16:07:21 -07:00
Elliott Hughes
df7efc2c9f More native code cleanup.
Use ScopedUtfChars (fixes a leak in TrafficStats, and fixes a crash in Wifi in
a case where GetStringChars could have been called with a pending exception).

Change-Id: I3465ff392b4038dfdafa6af80ec1314cc6d6a11c
2011-04-13 10:34:23 -07:00
Irfan Sheriff
042f4e10f0 data activity reporting on wifi
Initial checkin, need icons to complete the feature

Bug: 3412258

Change-Id: I9a3ecc8159cc314d84707065dafe23d402409a84
2011-02-17 13:57:55 -08:00
Brad Fitzpatrick
cfb77b9e4f am b05fcac4: am a62bf8bb: am 6e5a04af: am c6a47e98: Merge "Fix a race condition in NativeDaemonConnector"
* commit 'b05fcac4a906ce067d701a4767e94bc6beb4969e':
  Fix a race condition in NativeDaemonConnector
2011-02-07 13:51:43 -08:00
Brad Fitzpatrick
b05fcac4a9 am a62bf8bb: am 6e5a04af: am c6a47e98: Merge "Fix a race condition in NativeDaemonConnector"
* commit 'a62bf8bb6b7a547802fb384b497e955940befa9c':
  Fix a race condition in NativeDaemonConnector
2011-02-07 10:09:29 -08:00
Brad Fitzpatrick
6e5a04af0d am c6a47e98: Merge "Fix a race condition in NativeDaemonConnector"
* commit 'c6a47e98717df6980abc56c93a0dcc83c71f9d96':
  Fix a race condition in NativeDaemonConnector
2011-02-07 10:04:54 -08:00
Brad Fitzpatrick
c6a47e9871 Merge "Fix a race condition in NativeDaemonConnector" 2011-02-07 09:55:34 -08:00
anga
c4faee0b10 Fix a race condition in NativeDaemonConnector
Fixes a race between the onDaemonConnected callback and setting the
mOutputStream in NativeDaemonConnector.

MountService connects to vold using the NativeDaemonConnector.
Throws a “NativeDaemonConnectorException: No output stream!”
when the onDaemonConnected callback in MountService calls the doListCommand.

Change-Id: Ib895bab37f7df680e4362df6366198c0a673c5e9
2011-02-07 09:53:59 -08:00
Ashish Sharma
ee18e9a7f0 Merge "Fix a minor documentation bug in TrafficStats." 2011-01-31 17:32:40 -08:00
Ashish Sharma
2e11488c90 Fix a minor documentation bug in TrafficStats.
Change-Id: I3cf2199797d875ccb6ab432c298afaace44c7527
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
2011-01-31 14:30:16 -08:00
The Android Open Source Project
8eb67e74ab am 4d271f15: Reconcile gingerbread-plus-aosp and honeycomb
* commit '4d271f15beec4c091a62791af51cf2ac68cd4e4e':
  resolved conflicts for merge of a314f32b to honeycomb-merge
2011-01-30 12:54:18 -08:00
The Android Open Source Project
4d271f15be Reconcile gingerbread-plus-aosp and honeycomb
Change-Id: I7ca5acfee971105e3f3d6a674f82da0e890b0434
2011-01-30 12:40:39 -08:00
Irfan Sheriff
b00c85fc8d am 4170b463: Merge "Do not add unsolicited events to queue" into gingerbread
* commit '4170b46329ed91e81cf22dba82e2dadc326b3e3d':
  Do not add unsolicited events to queue
2011-01-27 17:04:07 -08:00
Ashish Sharma
df852d8860 TrafficStats: Include UDP stats and packet count to API
Change-Id: I70063e6033d3c181bcc5b9e401f9474900e25281
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
2011-01-27 15:52:38 -08:00
Irfan Sheriff
a29e945814 am ef76b830: am 4170b463: Merge "Do not add unsolicited events to queue" into gingerbread
* commit 'ef76b8306fd6147d9dd7e3b7dce10354eff8033c':
  Do not add unsolicited events to queue
2011-01-21 14:37:14 -08:00
Irfan Sheriff
bc1c40a484 Do not add unsolicited events to queue
Adding unsolicited events to response queue
results in doCommand() returning the wrong
result.

Pulling this change from master.

Bug: 3258529
Change-Id: I2a4b0bd8bb30b31682d7d61ee94a0d246bf10de2
2011-01-16 14:31:55 -08:00
Robert Greenwalt
2d1da31f08 am 9c38a6dc: am e87ebb08: Merge "Cleanup Netd to prevent getting hung." into gingerbread
Merge commit '9c38a6dc13ba55fccb9c66f347307a1b4ae68105'

* commit '9c38a6dc13ba55fccb9c66f347307a1b4ae68105':
  Cleanup Netd to prevent getting hung.
2010-09-23 09:40:20 -07:00
Robert Greenwalt
56451a4477 Cleanup Netd to prevent getting hung.
If the sending of the command fails we should note it and not wait forever
for the response.

We should also not say we're ready until we actually are.

bug:2993205
Change-Id: I380f0312ac4693ad184a526b330fdfa23f6ac558
2010-09-22 16:43:23 -07:00
Kenny Root
4ad1fbff0f am fb79b7da: am d347480a: Fix buffer compacting in NativeDaemonConnector
Merge commit 'fb79b7dab3ccaf490e8cbb18c9feed7080e4b54f'

* commit 'fb79b7dab3ccaf490e8cbb18c9feed7080e4b54f':
  Fix buffer compacting in NativeDaemonConnector
2010-09-02 22:32:39 -07:00
Kenny Root
d347480a18 Fix buffer compacting in NativeDaemonConnector
The buffer was being compacted in the read loop, but the start offset on
the compacted buffer wasn't being considered after the next read.

Bug: 2501075
Change-Id: I163297d751cf800d0bbc66df66b1a0fa0785de49
2010-09-02 22:24:06 -07:00
Jean-Baptiste Queru
c2ff62b1be am bacc3aa8: am b03c4592: merge -s ours from froyo-release so that upgrading to gingerbread is a git fast-forward
Merge commit 'bacc3aa85ee1a1b5dbf2e92522dde8eb0526bdb7'

* commit 'bacc3aa85ee1a1b5dbf2e92522dde8eb0526bdb7':
  Add a missing break; to restore old functionality and not turn off the screen after 30secs regardless of system preference.
  Amend previous ndc commit
  Add a method to let a properly permissioned app directly
  Changed SyncOperation.toKey() to not rely on the implementation of
  Squashed commit of the following:
  Add more error checking for ndc
  PackageManagerService: always install native binaries from .apk
  Add PhoneSubInfo.getCompleteVoiceMailNumber.
  Fix a bug where we cleaned an apps external data when upgrading it. :(
  Skip hostname verification when using insecure factory
  Flush binder buffer after setting raw heap to avoid leaking a reference.
  Fix issue #2834005: Android Settings.Secure bypass
  Fix issue 2811538: System server crash when disconnecting BT headset after using SCO off call.
  Verify hostname where possible, and clarify where not.
2010-08-24 12:09:03 -07:00
Jean-Baptiste Queru
b03c459224 merge -s ours from froyo-release so that upgrading to gingerbread is a git fast-forward
Change-Id: I69ed3eabde3cd32bea57315c0f031839caea4d4e
2010-08-23 19:08:27 -07:00
Danica Chang
405d5ff482 bluetooth tethering
Change-Id: Id6d5fb1922facc7013abc29214d3e1141995b767
2010-08-18 15:07:50 -07:00
Kenny Root
57b7c0b7a0 am eeeaf73a: (-s ours) Add more error checking for ndc
Merge commit 'eeeaf73a023f66463f83f7048f98cc40a626e59a' into gingerbread

* commit 'eeeaf73a023f66463f83f7048f98cc40a626e59a':
  Add more error checking for ndc
2010-08-18 08:50:56 -07:00
Kenny Root
877d231382 Add more error checking for ndc
In NativeDaemonConnector.doCommand() calls, there was inconsistent error
checking. This change adds error checking for every call and makes it so
that any call to .doCommand() that gets an error code won't cause the
code to hang forever.

Change-Id: If714282b6642f278fb8137f652af1a012670253b
2010-08-17 23:32:20 -07:00
Kenny Root
eeeaf73a02 Add more error checking for ndc
In NativeDaemonConnector.doCommand() calls, there was inconsistent error
checking. This change adds error checking for every call and makes it so
that any call to .doCommand() that gets an error code won't cause the
code to hang forever.

Change-Id: If714282b6642f278fb8137f652af1a012670253b
2010-08-17 23:29:46 -07:00
Kenny Root
ef79060f4e Add more error checking for ndc
In NativeDaemonConnector.doCommand() calls, there was inconsistent error
checking. This change adds error checking for every call and makes it so
that any call to .doCommand() that gets an error code won't cause the
code to hang forever.

Change-Id: I4584953a759a48ad16adfe8ee9e564b5f5796680
2010-06-01 13:29:04 -07:00
Dan Egnor
71d780a711 Fix sim build (sim doesn't have strl*() reliably...)
Just stub out the TrafficStats code for the sim.
Bug: 2578938

Change-Id: Ie555f67f581d05ee446ea29cb2223feb350c52f9
2010-04-08 23:47:06 -07:00
Dan Egnor
eaeb70241c Change TrafficStats to a new JNI implementation.
Also change phone's ConnectionStateTrackers to use it directly,
rather than through the INetStat binder interface.

Bug: 2578938
Change-Id: I8858e2609cbec3be845a0ce5178cb03f67e01b41
2010-04-07 19:06:29 -07:00
Kenny Root
07726310ae Compact when NativeDaemonConnector hits buffer limit
If NativeDaemonConnector hits its buffer limit, it would truncate the
data and lose some information. This change compacts the buffer and then
retries to read the rest of the data.

Change-Id: I0d5fee097bdd6808212ef3ad6fb4abbc6310fd4a
2010-03-22 18:02:45 -07:00
Joe Onorato
f7791634a2 Switch the services library to using the new Slog 2010-03-01 13:06:50 -08:00
San Mehat
6eec2a8bf5 NativeDaemonConnector: Improve bad list IPC diagnostics
Signed-off-by: San Mehat <san@google.com>
2010-02-17 09:05:16 -08:00
San Mehat
f0d2199fc7 NativeDaemonConnector: Improve error reporting and debug formatting
Updated:
  NativeDaemonConnector: Put debugging behind a conditional

Signed-off-by: San Mehat <san@google.com>
2010-02-08 19:29:58 -08:00
Ken Shirriff
c9b5476b73 API review: TrafficStats: rename Pkts to Packets
Rename getMobileTxPackets(), getMobileRxPackets(), getTotalTxPackets(),
getMobileRxPackets()

bug 2420318
2010-02-04 14:37:21 -08:00
San Mehat
a52a743959 NativeDaemonConnector: Improve NativeDaemonException reporting to include the actual error response
Signed-off-by: San Mehat <san@google.com>
2010-02-03 14:37:43 -08:00
San Mehat
0e0980b533 NativeDaemonConnector: Cleanup socket code and use a proper exception
Signed-off-by: San Mehat <san@google.com>
2010-01-29 06:30:23 -08:00
San Mehat
f2b0adabbd NativeDaemonConnector: fix doListCommand() to return *all* list elements
Signed-off-by: San Mehat <san@google.com>
2010-01-26 13:18:03 -08:00
San Mehat
4a32297c1e NativeDaemonConnector: Add a convenience method for obtaining lists
Signed-off-by: San Mehat <san@google.com>
2010-01-20 15:32:02 -08:00
San Mehat
8592334382 services: Introduce NativeDaemonConnector class
This class provides an interface to communicate with native daemons using the
libsysutils framework communication code.

Signed-off-by: San Mehat <san@google.com>

NativeDaemonConnector: fix whitespace

Signed-off-by: San Mehat <san@google.com>

NativeDaemonConnector: Fix review comments

Signed-off-by: San Mehat <san@google.com>

NativeDaemonConnector: On an error, re-try the connection

Signed-off-by: San Mehat <san@google.com>
2010-01-12 13:55:39 -08:00
Ken Shirriff
c640964e95 Migration to TrafficStats.
TrafficStats is the SDK version of NetStat.
2009-12-08 11:14:03 -08:00
Ken Shirriff
ae521152dd Add TrafficStats class to SDK.
This class (a rename of NetStat) provides network byte and packet statistics.
NetStat will be removed separately, to avoid breaking other packages when submitting.
2009-12-08 10:50:25 -08:00
The Android Open Source Project
ac96dda631 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
6145627639 auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
4bc9554dcc auto import from //branches/cupcake/...@130745 2009-02-10 15:44:00 -08:00
The Android Open Source Project
cf7558648b Initial Contribution 2008-10-21 07:00:00 -07:00