2631 Commits

Author SHA1 Message Date
Igor Murashkin
6944165014 Merge "camera2 api: marshal rect, size, string for metadata" 2013-07-22 21:38:55 +00:00
Glenn Kasten
70c17f4703 Merge "Inform AudioFlinger of device's low RAM attribute" 2013-07-22 15:02:29 +00:00
Mathias Agopian
d84feebba4 Merge "update to new Consumer APIs" 2013-07-20 01:03:22 +00:00
Michael Wright
7caaeeb6a8 Merge "Add input device property for buttons under touchpads" 2013-07-19 22:45:51 +00:00
Igor Murashkin
3710db80d4 camera2 api: marshal rect, size, string for metadata
Change-Id: Iec2fd823bc92394da44abb32ca38a625d7638e3d
2013-07-19 12:04:48 -07:00
Mike Lockwood
757ec7837d Merge "LocalSocket: Add support for SOCK_DGRAM and SOCK_SEQPACKET" 2013-07-19 17:39:28 +00:00
Chris Craik
ef5498edf6 Merge "Add reconfigure method to Bitmap" 2013-07-18 22:55:44 +00:00
Glenn Kasten
fd116ad1ab Inform AudioFlinger of device's low RAM attribute
to help it configure it's memory

Bug: 9798886
Change-Id: Ia2df59cfcb76f5ff48cca92b107915e2adde899c
2013-07-18 10:03:27 -07:00
Eric Laurent
230e0120a4 Merge "Fix media server restart detection mechanism" 2013-07-18 16:12:59 +00:00
Eric Laurent
ca35e48234 Fix media server restart detection mechanism
There is a flaw in the mechanism used by AudioService
to detect the fact that mediaserver process did crash and restart.
It relies on polling AudioFlinger service until a successful
connection triggers a callback into AudioSystem JNI and then into AudioService.
But if another thread in system_server process, not attached to the
JNI environment, reconnects before AudioService, the callback is called in
a detached context and dropped.

The fix consists in attaching the thread executing the callback
and detaching it if needed.

Bug: 9693068.
Change-Id: I184308b12a3f87653bf818abf0159e0e45a66ef0
2013-07-18 09:10:56 -07:00
Michael Wright
7ddd11035b Add input device property for buttons under touchpads
Bug: 8990644
Change-Id: I2cc10457595a861b707c0394bd435d60efa8405b
2013-07-17 16:19:25 -07:00
Chris Craik
c84d203da2 Add reconfigure method to Bitmap
bug:9797004

Grants a means to reuse a bitmap's allocation for different
width/height/Config without going through
BitmapFactoryOptions.inBitmap

Change-Id: Ib62319f3bd96c451fc1636288adf06a8275b4e3d
2013-07-17 12:08:01 -07:00
Mathias Agopian
e32632682c update to new Consumer APIs
Change-Id: I8649f3add40e0aeeeb0396b98e2cb93312e8e990
2013-07-16 23:14:24 -07:00
Mike Lockwood
e7d309a929 LocalSocket: Add support for SOCK_DGRAM and SOCK_SEQPACKET
Also replaced some JNI code with libcore IO support

Change-Id: I091e2b6b8dd1fec554936c1ffab29e50f0979e4a
2013-07-16 17:31:15 -07:00
Dianne Hackborn
cdae0f3c60 Merge "Switch proc stats to use new process state constants." 2013-07-16 18:15:09 +00:00
Glenn Kasten
78b6a8615c Merge "AudioTrack write() on a full buffer while paused returns 0" 2013-07-16 17:54:26 +00:00
Rom Lemarchand
0a880d0402 Merge "Increase swappiness of processes when memcgroups are enabled" 2013-07-16 02:32:13 +00:00
Mathias Agopian
377d7bd543 Merge "always pass the BufferQueue explicitely to consumers" 2013-07-16 02:17:56 +00:00
Jeff Brown
11093285c2 Completely remove skia dependency from libinput.
Change-Id: I943d0e5b7bb6e922803e14b8c3a3564e82fc5e63
2013-07-15 18:05:59 -07:00
Jeff Brown
48a3d98d1f Fix PDK build.
Change-Id: Ide48ea30c2f7f24d20ab6fcdc47c806ac1f133ee
2013-07-15 17:31:32 -07:00
Dianne Hackborn
c823051972 Switch proc stats to use new process state constants.
These new constants are a better mapping to the kind of
information that procstats is wanting to collect about
processes.  In doing this, the process states are tweaked
to have a bit more information that we care about for
procstats.

This changes the format of the data printed by procstats,
so the checkin version is bumped to 2.  The structure is
the same, however the codes for process states have all
changed.  The new codes are, in order of precedence:

p -- persistent system process.
t -- top activity; actually any visible activity.
f -- important foreground process (ime, wallpaper, etc).
b -- important background process
u -- performing backup operation.
w -- heavy-weight process (currently not used).
s -- background process running a service.
r -- process running a receiver.
h -- process hosting home/launcher app when not on top.
l -- process hosting the last app the user was in.
a -- cached process hosting a previous activity.
c -- cached process hosting a client activity.
e -- cached process that is empty.

In addition, we are now collecting uss along with pss
data for each process, so the pss checkin entries now
have three new values at the end of the min/avg/max uss
values of that process.

With this switch to using process state constants more
fundamentally, I realized that they could actually be
used by the core oom adj code to make it a lot cleaner.
So that change has been made, that code has changed quite
radically, and lost a lot of its secondary states and flags
that it used to use in its computation, now relying on
primarily the oom_adj and proc state values for the process.

This also cleaned up a few problems -- for example for
purposes of determing the memory level of the device, if a
long-running service dropped into the cached oom_adj level,
it would start being counted as a cached process and thus
make us think that the memory state is better than it is.
Now we do this based on the proc state, which always stays
as a service regardless of what is happening like this, giving
as a more consistent view of the memory state of the device.

Making proc state a more fundamentally part of the oom adj
computation means that the values can also be more carefully
tuned in semantic meaning so the value assigned to a process
doesn't tend to change unless the semantics of the process
has really significantly changed.

For example, a process will be assigned the service state
regardless of whether that services is executing operations
in the foreground, running normally, or has been dropped to
the lru list for pruning.  The top state is used for everything
related to activities visible to the user: when actually on
top, visible but not on top, currently pausing, etc.

There is a new Context.BIND_SHOWING_UI added for when system
services bind to apps, to explicitly indicate that the app
is showing UI for the system.  This gives us a better metric
to determine when it is showing UI, and thus when it needs
to do a memory trim when it is no longer in that state.  Without
this, services could get in bad states of continually trimming.

Finally, more HashSet containers have been changed to ArraySet,
reducing the temporary iterators created for iterating over
them.

Change-Id: I1724113f42abe7862e8aecb6faae5a7620245e89
2013-07-15 16:21:35 -07:00
Geremy Condra
045ad910b7 Merge changes Ia6646363,I94389b64
* changes:
  Add per user VPN support
  Add NetworkUtil function for marking sockets
2013-07-15 21:56:30 +00:00
Rom Lemarchand
5534ba91ac Increase swappiness of processes when memcgroups are enabled
When memcgroups are enabled, migrate heavier and lower priority processes
to the sw memcgroup.

Change-Id: Iba07a723037a599736ef23dea16a30a26634428a
2013-07-15 13:19:27 -07:00
Chris Craik
d63ee75652 Merge "Add webp to BitmapFactory.Options outMimetype" 2013-07-15 19:29:10 +00:00
Mathias Agopian
b550929b7a always pass the BufferQueue explicitely to consumers
Change-Id: I32e380979a3f4c6b1dfb440cc5b5c3d30d7607db
2013-07-12 22:06:31 -07:00
Chris Craik
95587f9045 Add webp to BitmapFactory.Options outMimetype
Change-Id: Id0d5b4d6c2c5b21fa0b31f1a5ada6275fdc38f44
2013-07-12 19:46:19 -07:00
Glenn Kasten
2dafbe78c1 Merge "Return correct status for android.media.AudioTrack.write(short[]...)" 2013-07-12 20:13:00 +00:00
Chad Brubaker
12324b4604 Add NetworkUtil function for marking sockets
Add NetworkUtil function for setting the SO_MARK field of sockets

Change-Id: I94389b64296d87ee928293f24a26f8dd08c3bf37
2013-07-12 19:48:32 +00:00
Romain Guy
6b217a4d2a Merge "Trace bitmaps decoding" 2013-07-12 00:41:24 +00:00
Romain Guy
787e35793f Trace bitmaps decoding
Also remove dead code

Change-Id: Ie931b21858ccbe6ee4def54caf028fd2aed23317
2013-07-11 17:37:31 -07:00
Igor Murashkin
b519cc52ec camera2 api: Add CameraMetadata get/set support
* Add a Rational class
* Can get/set Key<T> where T is a primitive (or Rational)
* Can get/set Key<T> where T is a primitive array
* Can get/set Key<T> where T is an enum (synthetic constructor only)

Not implemented yet:
* When T is anything else, i.e. Rect, Size, etc

Bug: 9529161
Change-Id: I64438024a1e8327a38dd2672652626f0ffbb70e3
2013-07-11 13:06:56 -07:00
Glenn Kasten
9b53db378a AudioTrack write() on a full buffer while paused returns 0
Change-Id: I85d44452cd8a5f87c7fc9b6a0858569cb5293eb4
2013-07-10 14:13:39 -07:00
Glenn Kasten
f7e0a370e7 Return correct status for android.media.AudioTrack.write(short[]...)
Bug: 9776374
Change-Id: If43c63a4ceeb8fef98708f0d42496d2fb90a21fd
2013-07-10 14:03:03 -07:00
Mathias Agopian
d19db9a7c4 Merge "be more robust with handling unknown sensors" 2013-07-08 22:48:37 +00:00
Mathias Agopian
b25c0efad2 be more robust with handling unknown sensors
- add support for new sensors (post 4.3)
- don't crash when encountering an unknown sensor type
- clean-up

Bug: 9683153
Change-Id: Iecd883e8a7d0297be1bd2bd4f00c5cc3ffcbccfe
2013-07-08 15:24:09 -07:00
Chris Craik
0c20c3898a Use global references for Bitmap AndroidPixelRefs
bug:9621717

Because we're no longer holding onto Bitmaps Java side during
DisplayList lifetime, use global refs to keep the backing byte arrays
around.

Adds back bitmap buffer passing + native ref management removed by
3b748a44c6bd2ea05fe16839caf73dbe50bd7ae9

Adds back globalRef-ing removed by
f890fab5a6715548e520a6f010a3bfe7607ce56e

Change-Id: Ia59ba42f05bea6165aec2b800619221a8083d580
2013-07-08 11:08:02 -07:00
Jeff Brown
9d3b1a424c Move input library code to frameworks/native.
No longer compile libandroidfw as a static library on the device
since it already exists as a shared library.  Keeping the static
library would force us to provide a static library version of
libinput for the device as well which doesn't make sense.

Change-Id: I3517881b87b47dcc209d80dbd0ac6b5cf29a766f
2013-07-01 20:11:42 -07:00
Dianne Hackborn
cfc837f7fa Start really collecting PSS data for process stats.
The activity manager now uses some heuristics to try to
sample PSS data from processes so that it can get enough
data to over reasonable time have something useful, without
doing it too aggressively.

The current policy is:

1. Whenever a significant global change happens (memory state,
   sceen on or off), we collect PSS from all processes; this will
   not happen more than every 10 minutes.
2. When all activities become idle, we will collect PSS from the
   current top process; this will not happen more than every 2
   minutes per process.
3. We will sample the top-most process's PSS every 5 minutes.
4. When an process's oom adj changes and it has been more than
   30 minutes since PSS has been collected from it, we will
   collect a new PSS sample.
5. If a process changes from service A to service B (meaning it
   has been running a service for a long time), we will collect
   a PSS sample from it.
6. If someone explicitly requests PSS data (for running services
   UI or dumpsys), record that.

Also:

- Finish moving the procstats output all to the new format.
- Record information about processes being killed due to excessive
  wake locks or CPU use in procstats.
- Rework how we structure common vs. per-package process stats to
  make it simpler to deal with.
- Optimize the Debug.getPss() implementation (we use it a lot now).
  Should probably optimize it further at some point.

Change-Id: I179f1f7ae5852c7e567de4127d8457b50d27e0f0
2013-06-27 18:56:00 -07:00
Dianne Hackborn
9b43a60405 Merge "Work on issue #9586838: Crash after waking up Hammerhead device" 2013-06-27 18:07:24 +00:00
Oliver Woodman
86bebb4c78 Merge "Expose latency methods through AudioManager and AudioTrack." 2013-06-27 10:40:08 +00:00
Dianne Hackborn
053f61d6a6 Work on issue #9586838: Crash after waking up Hammerhead device
I made the power manager more rigid, not allowing different uids
to use the same wake lock.  This never should happen.  I would
guess there is somewhere that the activity manager is acquiring
the wake lock without clearing the calling identity...  but it is
hard to follow all the paths this may happen in.  So here we add
some checks when acquiring/releasing the wake lock to make sure
it is being done as the system uid.

Also:

- Protect the new activity stack calls with a permission, and
make sure to clear the calling uid once past that.
- Collect uid data from process stats so we can correctly
associate CPU use with a uid even if we don't know about the
pid for some reason.
- Fix battery stats dump commands to clear calling uid before
executing so they aren't broken.

Change-Id: I0030d4f7b614e3270d794ecfc3669139a5703ce9
2013-06-26 19:17:15 -07:00
Romain Guy
e3b0a0117a Refcount 9-patches and properly handle GC events
This change adds refcounting of Res_png_9patch instances, the native
data structure used to represent 9-patches. The Dalvik NinePatch class
now holds a native pointer instead of a Dalvik byte[]. This pointer
is used whenever we need to draw the 9-patch (software or hardware.)

Since we are now tracking garbage collection of NinePatch objects
libhwui's PatchCache must keep a list of free blocks in the VBO
used to store the meshes.

This change also removes unnecessary instances tracking from
GLES20DisplayList. Bitmaps and 9-patches are refcounted at the
native level and do not need to be tracked by the Dalvik layer.

Change-Id: Ib8682d573a538aaf1945f8ec5a9bd5da5d16f74b
2013-06-26 17:15:08 -07:00
Dianne Hackborn
49a31e0d67 Merge "Update procstats to start collecting/reporting pss." 2013-06-26 21:11:49 +00:00
Igor Murashkin
70725500dc Initial camera device implementation
* Working streaming preview requests only
* Almost everything else returns empty objects that don't do anything

Bug: 9213377
Change-Id: Ie6f02a7c0952b0f5ebc41905425b15cae221f7d3
2013-06-26 13:19:45 -07:00
Dianne Hackborn
13ac041b9f Update procstats to start collecting/reporting pss.
Completely reworked how it manages its data, since trying
to keep track of all of the possible pss data with the old
data structures would have made it huge.  Now we have a sparse
data structure for pss and process times.  (Will switch service
times over to it soon.)

Currently the only thing that collects pss data is running
"dumpsys meminfo".  More will be added later.

Modified checkin output to also scale better as more distinct
data categories are added, and added output of pss data.  Now
instead of dumping every possible entry as a comma-separated
list, it dumps a comma-separated list of only the entries with
data, tagged with the state they go with.

Also fixed some problems in the checkin reporting of batterystats
(it needs to escape commas), added checkin reporting of the history
list, fixed parsing of kernel wake locks to strip quotes, fixed
wake lock name that the sync manager generates to be more sane.

Change-Id: Ibf4010838a9f685ebe1d93aff86c064ccc52b861
2013-06-26 11:45:36 -07:00
Oliver Woodman
61dcdf3764 Expose latency methods through AudioManager and AudioTrack.
There's a longer term plan to fix audio/video sync, but
this gets the Java level to parity with the native level,
and allows applications in Java to achieve sync in the
same way as the native media player. APIs are left as hidden
for now.

Change-Id: Iaf70baac1ffb50ef48e03355163158568fbd0fe9
2013-06-26 16:33:54 +01:00
Igor Murashkin
36483e9622 Revert "Initial camera device implementation"
This reverts commit 59bc67c732eab53b370b196066e8012d3f6bf09a.

Change-Id: I9e1ce3b9f4af4e2b9b98855c0ca533581c87ea7f
2013-06-25 05:13:55 +00:00
Igor Murashkin
59bc67c732 Initial camera device implementation
* Working streaming preview requests only
* Almost everything else returns empty objects that don't do anything

Bug: 9213377
Change-Id: I183dd47ddd737ec2c3c374e5c3461542a97f09b0
2013-06-24 17:41:10 -07:00
Derek Sollenberger
6b0437c2c7 Fix SkASSERT errors resulting from the order objects are allocated
on the stack.

Change-Id: I24649fed5c069d8d3777d153e8fb31a55a9cf7a1
2013-06-24 15:40:54 -04:00
Svetoslav Ganov
b06accf34f Merge "Generate PDF from Canvas." 2013-06-21 20:09:51 +00:00