Commit Graph

1294 Commits

Author SHA1 Message Date
Jeff Sharkey
ec43a6bc17 Better --unplugged support when dumping battery.
Also fixes logBatteryStatsLocked() to output valid dump data, instead
of just a usage message.

Bug: 8708665
Change-Id: Ie0d8d90e1a470b7e1e902643333309c2cf7bdb72
2013-04-30 13:33:18 -07:00
Amith Yamasani
fe9270712e am 83a61421: am bbd90f8e: Merge "Hide isLinkedUser()" into jb-mr2-dev
* commit '83a6142173fbd3ddf5c4285e2b6359e44beaddb0':
  Hide isLinkedUser()
2013-04-25 21:26:59 -07:00
Jeff Sharkey
3e013e85b0 Track foreground activities in battery stats.
To help correlate battery usage against actual foreground app usage,
start tracking time on a per UID basis.  It uses the nesting feature
of StopwatchTimer to track multiple PIDs inside the same UID.

Improves units on docs, and persists foreground CPU time with a
consistent ordering.  Reports foreground activities time and
foreground CPU time.

Change-Id: I95d12963923e3fd421730f6fbfc842dfd8d3a055
2013-04-25 17:01:37 -07:00
Amith Yamasani
2555dafce8 Hide isLinkedUser()
It's not the best API to use to determine anything. Defer to other
APIs such as UserManager.getUserRestrictions()

Bug: 8720520
Change-Id: Ie49589056ab52b4fdbcc736f8cdefadb8ba5d9d8
2013-04-25 13:39:27 -07:00
Ian Rogers
023c1f4a1e am 896ee5b6: am be4536d2: Merge "Adding matching @deprecated."
* commit '896ee5b6f8354567464a371025088156ed49bc32':
  Adding matching @deprecated.
2013-04-23 15:01:30 -07:00
Ian Rogers
282a7e1b1d Adding matching @deprecated.
Bug: 8657266

(Cherry-pick of c2a3adbd56)

Change-Id: Idbd22dc647f11441d15da12eb23723539768cf4c
2013-04-23 11:36:28 -07:00
Dianne Hackborn
eadbcd3352 resolved conflicts for merge of 8c3cb811 to master
Change-Id: I1cd4186b6b2dcb3d1d7d21c346384dbcc6e6a8df
2013-04-23 10:56:23 -07:00
Ian Rogers
896ee5b6f8 am be4536d2: Merge "Adding matching @deprecated."
* commit 'be4536d214eedc3d12b50f0f30b47bba773b8dbc':
  Adding matching @deprecated.
2013-04-23 09:15:58 -07:00
Dianne Hackborn
d2eeed635d JB MR2 == API 18.
Change-Id: Ia62a81f8ebc79ae0e01b181f4ef47ef192c71592
2013-04-22 13:28:47 -07:00
Jeff Sharkey
94e602d7b5 am 1b50e4ea: am ca2a6374: Merge "Environment should only warn when asked." into jb-mr2-dev
* commit '1b50e4ead5463f4dcc03f9c5ed64963af0d4d9eb':
  Environment should only warn when asked.
2013-04-19 14:38:36 -07:00
Jeff Sharkey
48749fc78a Environment should only warn when asked.
Instead of warning on Process.SYSTEM_UID, which is also used by the
Settings app, change to have the parent process explicitly ask for
warnings.

Bug: 8667286
Change-Id: Ib26676694a4041ff4e6d3ffdcc14055b7eba13c7
2013-04-19 13:27:43 -07:00
Jeff Sharkey
50474f91e3 am dde9559b: am 24b55f25: Merge "Deprecate StatFs methods returning small values." into jb-mr2-dev
* commit 'dde9559b78a93344ec0b568c2bac7329621de31f':
  Deprecate StatFs methods returning small values.
2013-04-19 12:49:34 -07:00
Ian Rogers
c2a3adbd56 Adding matching @deprecated.
Bug: 8657266
Change-Id: Idbd22dc647f11441d15da12eb23723539768cf4c
2013-04-19 11:31:48 -07:00
Jeff Sharkey
b81440bd9b Deprecate StatFs methods returning small values.
Bug: 8656794
Change-Id: Ic904bd1bc016ef48b5a304b7c68250afe23e98bc
2013-04-19 10:52:42 -07:00
Jeff Brown
8844892a88 am ba8fdcac: am 6f575bb3: Merge "Fix change of behavior in Looper.quit()." into jb-mr2-dev
* commit 'ba8fdcac4cc4ae3d9dcac8fa6a64c55facd6f25f':
  Fix change of behavior in Looper.quit().
2013-04-18 19:14:54 -07:00
Jeff Brown
8b60e45147 Fix change of behavior in Looper.quit().
It seems some applications rely on Looper.quit() terminating the
loop immediately without processing all messages.  Rather than
risk breaking them, make the safer behavior optional.

Also take care to properly drain the message queue before quitting
so that all of the Message instances are recycled.  This may
help release storage sooner in case the Looper doesn't get GC'd
promptly and its remaining queue of undelivered messages sticks
around.

Improve docs on runWithScissors.

Bug: 8596303
Change-Id: I8cbeb6f7a5f6b8e618b5109f87a03defc1486b9f
2013-04-18 19:04:39 -07:00
Amith Yamasani
c1ce6e1a79 am ac16c21d: am a0042742: Merge "Modify restrictions bundle per api council recommendations" into jb-mr2-dev
* commit 'ac16c21d11c1545efb8deafbcb7c120a5e0821a1':
  Modify restrictions bundle per api council recommendations
2013-04-17 11:34:28 -07:00
Amith Yamasani
7e99bc02c8 Modify restrictions bundle per api council recommendations
Use a Bundle for persisting and passing to the application, but use a
list to return data back from an application that's exposing restrictions.

Changed the xml reading/writing code to store the value type in the Bundle
so that it can be reproduced when reading. Earlier we were assuming only
String and String[].

Bug: 8633967

Change-Id: I523d5553728edcf28a1e9d432f490b4956f34215
2013-04-17 10:44:44 -07:00
Jamie Gennis
a720a87fde am a0b28ca7: am 95a869f9: Merge "Disable tracing from Zygote" into jb-mr2-dev
* commit 'a0b28ca74806dcf46300d82ebb689b002bd36955':
  Disable tracing from Zygote
2013-04-16 17:01:12 -07:00
Doug Zongker
057d3eb1bd Merge "RecoverySystem: update comment to reflect signature changes" 2013-04-16 23:56:28 +00:00
Jamie Gennis
6ad0452e63 Disable tracing from Zygote
This change disables all atrace tracing in Zygote immediately after it is
initialized.  This is necessary because Zygote has no way to receive
notifications that the enabled trace tags have been changed.  Tracing is
re-enabled when other processes fork from Zygote.

Change-Id: If2983858fb0c4890ba9ab041849b1c4d98f66c13
2013-04-16 22:15:21 +00:00
Amith Yamasani
6011355635 am 6064c5cf: am e1375908: Rename isUserLimited to isLinkedUser
* commit '6064c5cf22b16464a82f04f0a9560f412ba2a90a':
  Rename isUserLimited to isLinkedUser
2013-04-13 17:25:16 -07:00
Amith Yamasani
e1375908a5 Rename isUserLimited to isLinkedUser
A linked user is derived from another user and shares their accounts.

Change-Id: Ia2e63d573ccb635495ec54f31ac7b174725ad7a8
2013-04-13 16:48:35 -07:00
Dianne Hackborn
11dc37686f am 18e99d1d: am 15fed390: Merge "Add new resources trace, also trace apk dex loading." into jb-mr2-dev
* commit '18e99d1d5f7bb2e35fb9f5c3edbb4265d66e3d93':
  Add new resources trace, also trace apk dex loading.
2013-04-12 17:06:37 -07:00
Dianne Hackborn
15fed390c4 Merge "Add new resources trace, also trace apk dex loading." into jb-mr2-dev 2013-04-12 23:58:50 +00:00
Amith Yamasani
8c176b2513 am b0511d47: am e107aa43: Merge "Rename isUserRestricted to isUserLimited" into jb-mr2-dev
* commit 'b0511d47eb15f4f7941d278467964f2cd6dd2871':
  Rename isUserRestricted to isUserLimited
2013-04-12 15:39:15 -07:00
Amith Yamasani
e107aa4386 Merge "Rename isUserRestricted to isUserLimited" into jb-mr2-dev 2013-04-12 22:33:05 +00:00
Amith Yamasani
46bc4ebb87 Rename isUserRestricted to isUserLimited
Avoid confusion with user restrictions which can be applied to
non-limited users as well.

Updated the java docs.

Change-Id: I4097c50b528b01a49cebcb0832d09f2b06998faa
2013-04-12 15:13:53 -07:00
Dianne Hackborn
f7be4800df Add new resources trace, also trace apk dex loading.
Change-Id: Ia48566efb21ee018659bd976ddb3a0f4997b9a3a
2013-04-12 14:53:10 -07:00
Romain Guy
190a0f24db am a378bab7: am 50b68bf8: Merge "Add async events tracing to android.os.Trace" into jb-mr2-dev
* commit 'a378bab7a7ea4f748c72b0d14acbdf9359dbebfb':
  Add async events tracing to android.os.Trace
2013-04-12 14:04:07 -07:00
Romain Guy
50b68bf836 Merge "Add async events tracing to android.os.Trace" into jb-mr2-dev 2013-04-12 20:58:00 +00:00
Emily Bernier
d65b268fcd am 9b8abb5a: am ce70311b: Merge "Add user restrictions (credentials, user removal)" into jb-mr2-dev
* commit '9b8abb5abde4264b6ed4e022804c743faf68323d':
  Add user restrictions (credentials, user removal)
2013-04-12 13:29:35 -07:00
Emily Bernier
ce70311b67 Merge "Add user restrictions (credentials, user removal)" into jb-mr2-dev 2013-04-12 20:21:36 +00:00
Jeff Brown
b97ebedeb3 am dc5711ea: am bf26c9cf: Merge "Ensure looper quits after all other messages are handled." into jb-mr2-dev
* commit 'dc5711eaef8662d5299f0088edf6e47fff77a872':
  Ensure looper quits after all other messages are handled.
2013-04-11 21:11:08 -07:00
Jeff Brown
024136f57e Ensure looper quits after all other messages are handled.
Bug: 8596303
Change-Id: Ie8bfbbe810f5ade2afd870c8e675ce1353a80e5d
2013-04-11 20:40:04 -07:00
Emily Bernier
b223f73a69 Add user restrictions (credentials, user removal)
Created constants in current.txt and UserManager.java, modified restrictions access in UserManagerService.java.

Change-Id: If8d778d84af81dcbf5784f6e0afd9ef966cc8ecf
2013-04-11 19:56:49 -04:00
Jamie Gennis
3e4e221e6d am 8a675b9a: am 6e8a2dd3: Merge "Trace: unhide app tracing APIs" into jb-mr2-dev
* commit '8a675b9aca36fdccdefd67d20128c9b5bc03644a':
  Trace: unhide app tracing APIs
2013-04-11 14:58:07 -07:00
Jamie Gennis
6e8a2dd3e6 Merge "Trace: unhide app tracing APIs" into jb-mr2-dev 2013-04-11 19:47:25 +00:00
Jamie Gennis
5800fc881e Trace: unhide app tracing APIs
Change-Id: I48316623fe0394d3fe77e9abca3f6dbf791d0c08
2013-04-10 17:50:32 -07:00
Romain Guy
9425f923fa Add async events tracing to android.os.Trace
Change-Id: I106a50732a88c03a00602c328f8b46626bf66e08
2013-04-10 16:35:48 -07:00
Dianne Hackborn
ea13f6ff99 am a92e95e5: am 064fab54: Merge "Fix issue #7691456: adbd CPU usage identified as Bluetooth in battery stats" into jb-mr2-dev
* commit 'a92e95e5d9c7e6a35541708a0a51ce9b54704b17':
  Fix issue #7691456: adbd CPU usage identified as Bluetooth in battery stats
2013-04-10 14:22:31 -07:00
Dianne Hackborn
2323dd8d1e Fix issue #7691456: adbd CPU usage identified as Bluetooth in battery stats
Bluetooth GID was wrong and pointless and dumb and now gone.

Change-Id: Ibde563ef0c10c6d316428e1e683b013005b934d4
2013-04-10 12:50:12 -07:00
Doug Zongker
c9a9ffc526 RecoverySystem: update comment to reflect signature changes
No functionality change is needed.

Change-Id: I2dd4775e484ffa96daa0d8778add5feb6c257424
2013-04-10 12:33:01 -07:00
Jamie Gennis
097fc7ef72 am bb2e031a: am 65b08486: Merge "Add APIs for application-generated systrace events" into jb-mr2-dev
* commit 'bb2e031ace9072a0bd71f6316269f3060f04aa27':
  Add APIs for application-generated systrace events
2013-04-09 15:39:55 -07:00
Jamie Gennis
f9c7d6bc15 Add APIs for application-generated systrace events
This change adds new APIs to enable applications to generate custom Systrace
begin/end events.  Application-generated events use the ATRACE_APP_TAG tag,
which is enabled only if either the application has declared itself debuggable
in its manifest or ro.debuggable is set to 1 on the device.

Change-Id: I311d09e2e6ed1a30f5ffa84907f250e11cc0d48d
2013-04-09 11:59:43 -07:00
Jeff Brown
b437a79b05 resolved conflicts for merge of 21dffd5d to master
Change-Id: I37c48dee471c9d43f19c1fe4a01f70db53e2441f
2013-04-08 19:05:15 -07:00
Jeff Brown
3a2854bcee Merge "Queues, queues, queues and input." into jb-mr2-dev 2013-04-08 23:59:24 +00:00
Jeff Brown
f9e989d5f0 Queues, queues, queues and input.
Redesigned how ViewRootImpl delivers input events to views,
the IME and to native activities to fix several issues.

The prior change to make IME input event delegation use
InputChannels failed to take into account that InputMethodManager
is a singleton attached to the main looper whereas UI may be
attached to any looper.  Consequently interactions with the
InputChannel might occur on the wrong thread.  Fixed this
problem by checking the current thread and posting input
events or callbacks to the correct looper when necessary.

NativeActivity has also been broken for a while because the
default event handling logic for joysticks and touch navigation
was unable to dispatch events back into the native activity.
In particular, this meant that DPad synthesis from touch navigation
would not work in any native activity.  The plan is to fix
this problem by passing all events through ViewRootImpl as usual
then forwarding them to native activity as needed.  This should
greatly simplify IME pre-dispatch and system key handling
and make everything more robust overall.

Fixed issues related to when input events are synthesized.
In particular, added a more robust mechanism to ensure that
synthetic events are canceled appropriately when we discover
that events are no longer being resynthesized (because the
application or IME is handling or dropping them).

The new design is structured as a pipeline with a chain of
responsibility consisting of InputStage objects.  Each InputStage
is responsible for some part of handling each input event
such as dispatching to the view hierarchy or to the IME.
As a stage processes an input event, it has the option of
finishing the event, forwarding the event to the next stage
or handling the event asynchronously.  Some queueing logic
takes care to ensure that events are forwarded downstream in
the correct order even if they are handled out of order
by a given stage.

Cleaned up the InputMethodManager singleton initialization logic
to make it clearer that it must be attached to the main looper.
We don't actually need to pass this looper around.

Deleted the LatencyTimer class since no one uses it and we have
better ways of measuring latency these days using systrace.

Added a hidden helper to Looper to determine whether the current
thread is the indicated Looper thread.

Note: NativeActivity's IME dispatch is broken by this patch.
This will be fixed later in another patch.

Bug: 8473020
Change-Id: Iac2a1277545195a7a0137bbbdf04514c29165c60
2013-04-08 15:31:47 -07:00
Jeff Brown
ae9d6aa6d9 am 4c2a7b23: am 4a706bc6: Merge "Correctly manage the lifecycle of IME InputChannels." into jb-mr2-dev
* commit '4c2a7b23f5f012cf00357035f840a32d4da20eb5':
  Correctly manage the lifecycle of IME InputChannels.
2013-04-05 14:09:41 -07:00
Jeff Brown
4a706bc6f1 Merge "Correctly manage the lifecycle of IME InputChannels." into jb-mr2-dev 2013-04-05 20:57:01 +00:00