2595 Commits

Author SHA1 Message Date
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
Brian Carlstrom
9f8203a159 Remove libdvm dependency
Change-Id: I7d37db4e72e9435ecd514340cf61a051dc272f04
2013-06-20 16:34:45 -07:00
Svetoslav Ganov
ff4adde573 Generate PDF from Canvas.
This change adds simple APIs that enable an Android application
to generate a PDF document by drawing content on a canvas.

Change-Id: Ibac93d7c37b01a376ce7c48238657d8c7698d588
2013-06-19 19:35:38 -07:00
Dianne Hackborn
94c747db09 am 2f3f86c1: am 1d4cd879: am 11cd57ca: Merge "Avoid unnecessary FindClass("java/lang/String")."
* commit '2f3f86c113f10b841b8597a05f724a996ba76641':
  Avoid unnecessary FindClass("java/lang/String").
2013-06-17 18:33:49 -07:00
Dianne Hackborn
1d4cd87904 am 11cd57ca: Merge "Avoid unnecessary FindClass("java/lang/String")."
* commit '11cd57caee4058dab743b91e715d7469c59a5c2f':
  Avoid unnecessary FindClass("java/lang/String").
2013-06-17 18:21:41 -07:00
Chris Craik
49cc5d7119 Merge "Handle all text bounds as post-translated" 2013-06-17 22:50:39 +00:00
Chris Craik
f09b746acb Handle all text bounds as post-translated
We were treating immediate mode bounds as pre translate, which is
inconsistent with using them for quickRejection.

This fixes the overdraw counter not drawing correctly (since it uses
immediate mode drawing.

Change-Id: I1c734d367a00942bd7d9b041822c0a9f284e70a8
2013-06-17 15:17:11 -07:00
Romain Guy
fb5c905097 Merge "Cancel layer update when a layer is about to be destroyed Bug #9310706" 2013-06-17 20:39:45 +00:00
Romain Guy
e93482f5ea Cancel layer update when a layer is about to be destroyed
Bug #9310706

Change-Id: I73eea6314c326f15a979617e3a05b525935f0d3f
2013-06-17 13:35:03 -07:00
Victoria Lease
8870538f7c make setHinting(HINTING_ON) kNormal_Hinting
Previously, the default hinting mode for a freshly-constructed Paint
object is equivalent to Skia's kNormal_Hinting mode, in which font
hints are respected if available. Calling
Paint.setHinting(HINTING_ON), however, is equivalent to setting
Skia's kSlight_Hinting mode, in which font hints are ignored in
favour of freetype-generated autohints.

This discrepancy is bad for a variety of reasons:
- Once Paint.setHinting() has been called, it is impossible to return
  to the default hinting level.
- Calling paint.setHinting(otherPaint.getHinting()) can result in
  paint having a different hinting level than otherPaint.
- Paint.setHinting(HINTING_ON) actually results in font hints being
  ignored, which is perhaps the opposite of the intended behaviour.

This commit resolves these discrepancies by making HINTING_ON
correspond to Skia's kNormal_Hinting setting.

Change-Id: Iefb8e051ef53bea783e6f3be37748985ec397bc5
Bug: 9466164
2013-06-17 11:57:37 -07:00
Vladimir Marko
aa5fe3d206 Avoid unnecessary FindClass("java/lang/String").
Use previously retrieved global reference instead.
Check for NULL after creating the global reference.

Change-Id: I21670d2ef0f63ddb5801dd21e7e56359e5519479
2013-06-17 17:54:58 +01:00
Chris Craik
d1f9aaa5d7 Merge "Fix various draw ops that may incorrectly not scissor" 2013-06-14 01:06:30 +00:00
Chris Craik
39a908c1df Fix various draw ops that may incorrectly not scissor
bug:8965976

Also consolidates quickReject scissor-ing and scissor-less paths.
Renamed plain 'quickReject' method, as it has sideEffects beyond what
the java and skia canvases do.

Change-Id: I4bdf874d3c8f469d283eae1e71c5e7ea53d47016
2013-06-13 16:16:13 -07:00
buzbee
34761a3abf Merge "Process new system property for max JIT cache size" 2013-06-13 19:57:25 +00:00
Romain Guy
405436021d Restore buildLayer()'s old behavior; it's synchronous again
Bug #9193833

Change-Id: I4ee07e65c0a8967f0b55da030ecaad6dfc46136f
2013-06-12 15:31:28 -07:00
Chris Craik
34bff87b32 Merge "Add support for post-decode density scaling with reuse" 2013-06-06 21:04:49 +00:00
Chris Craik
1e97ceb469 Merge "Support all formats for BitmapFactory.Options.inBitmap" 2013-06-06 16:13:30 +00:00
Chris Craik
905e8246ef Add support for post-decode density scaling with reuse
Also, simplifies scaling path, removing java variant - we always do
the scaling in native, which has the benefit of avoiding non-native
temporary allocations

Change-Id: I39c2219f5d77a267719629704e65611cf4388a82
2013-06-05 16:09:31 -07:00
Chris Craik
7e8c03c0fe Support all formats for BitmapFactory.Options.inBitmap
bug:9194265

Instead of using custom code in skia to avoid allocations, use a
custom allocator that reuses the allocations from the inBitmap.

In order to avoid inconsistent state, the decode is done in a
separate bitmap and swapped into the existing native bitmap.

Eventually, we'd like to support inScaled=true completely avoiding
java allocations.

Change-Id: Ic4a2f2373b100a80a32c1cdebb7bcb726711c8a7
2013-06-03 18:14:44 -07:00
Dmitry Shmidt
e659f12f0f Merge "wifi: Match function prototype from libhardware_legacy" 2013-05-30 20:00:51 +00:00
Derek Sollenberger
c648ed7303 Merge "Modifications needed for updating Skia to r9286." 2013-05-30 12:06:47 +00:00
Dmitry Shmidt
ffa0242dd4 wifi: Match function prototype from libhardware_legacy
Change-Id: Ibfffd347e22f71753b085d16f185407308b9be36
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-05-29 18:10:06 -07:00
Romain Guy
80b12fcaae Disable the AssetAtlas when running under valgrind
Bug #9191438

When running under valgrind, the ppid will be different from the ppid
of the system server (which always gets forked from zygote.)

Change-Id: I42cbf99fd0084aeab76c30de9beb7c49ed1fc7d8
2013-05-29 16:01:36 -07:00
Chris Craik
9f58361e98 Support larger bitmaps in BitmapFactory.Options.inBitmap
bug:8121994

Adds a new distiction between bitmap size and the allocation
(pixel ref/buffer) used to store its data.

BitmapFactory.inBitmap will allow a bitmap to be reinitialized with
new data if the bitmap being decoded is (after sampleSize) equal or
smaller.

Change-Id: I747750a735c858882df3af74fca6cdc46f2a9f81
2013-05-28 13:50:33 -07:00
Derek Sollenberger
d7a80774f0 Modifications needed for updating Skia to r9286.
bug: 8719528
Change-Id: I260fefb93c5a8c5dec86acdec66cbe55a2ee8a92
2013-05-28 10:44:26 -04:00
buzbee
b63de6de02 Process new system property for max JIT cache size
To allow low-memory devices to reduce (or eliminate entirely)
the RAM used by the JIT, dalvikvm has a new command-line
option to set the max size of the JIT's translation cache.
In this CL, we pass that new option based on a system property.

Change-Id: I2a01da4d19c1922b6ed52791ee513efef9caf3d4
2013-05-24 13:14:08 -07:00
Dianne Hackborn
64770d16b0 Some improvements to meminfo output.
- Rename "Swappable PSS" to "PSS Clean" which I think is what it
  means and is consistent with the other memory metrics.
- Split at the top level the dalvik heap from other dalvik allocations,
  so when you look on the dalvik allocations line things are consistent
  with the allocator's data and it is clear what are app allocations vs.
  other data in dalvik.
- Don't print lines that are all 0.
- Don't print the detailed Dalvik allocation data by default; add a new
  option to have it printed.

Here's what a typical system process dump now looks like:

** MEMINFO in pid 6358 [system] **
                   Pss      Pss   Shared  Private   Shared  Private     Heap     Heap     Heap
                 Total    Clean    Dirty    Dirty    Clean    Clean     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap        0        0        0        0        0        0     6964     3599     2048
  Dalvik Heap     7541        0     4344     7356        0        0    11768    11194      574
 Dalvik Other     3553        0     2792     3448        0        0
        Stack       28        0        8       28        0        0
       Cursor        4        0        0        4        0        0
       Ashmem        5        0       12        0        0        0
    Other dev     4004        0       24     4000        0        4
     .so mmap     3959      684     2500     2280     5468      684
    .apk mmap      173       68        0        0      692       68
    .dex mmap     4358     3068        0        0     9276     3068
   Other mmap       60        0        8        8      244       36
      Unknown     4387        0      508     4380        0        0
        TOTAL    28072     3820    10196    21504    15680     3860    18732    14793     2622

 Objects
               Views:       10         ViewRootImpl:        1
         AppContexts:        8           Activities:        0
              Assets:        3        AssetManagers:        3
       Local Binders:      176        Proxy Binders:      341
    Death Recipients:      141
     OpenSSL Sockets:        0

 SQL
         MEMORY_USED:      473
  PAGECACHE_OVERFLOW:       98          MALLOC_SIZE:       62

 DATABASES
      pgsz     dbsz   Lookaside(b)          cache  Dbname
         4       68             49         7/21/7  /data/data/com.android.providers.settings/databases/settings.db
         4       20             17         0/13/1  /data/system/locksettings.db
         4       20             21        96/14/2  /data/system/locksettings.db (1)
         4       20             21        75/13/2  /data/system/locksettings.db (2)
         4       80             29         4/17/3  /data/system/users/0/accounts.db

Change-Id: Ifd511a7baaa8808f82f39509a5a15c71c41d1bac
2013-05-24 10:47:03 -07:00
Anwar Ghuloum
dadfb9c9bf Merge "Add more memory usage stats" 2013-05-23 22:14:34 +00:00
Anwar Ghuloum
27ff7ba394 Merge "More stats for meminfo" 2013-05-23 22:13:52 +00:00
Anwar Ghuloum
9a78222df2 Merge "break out boot.art" 2013-05-23 22:13:28 +00:00
Anwar Ghuloum
17082e0452 Merge "Break out Oat footprint for ram" 2013-05-23 22:13:04 +00:00
Romain Guy
6080940411 Merge "Add PerfHUD ES profiling capabilities" 2013-05-23 19:50:58 +00:00
Romain Guy
e9bc11f712 Add PerfHUD ES profiling capabilities
The eglGetSystemTimeNV extension can be used to enable profiling
in PerfHUD ES. When the delta of two calls to eglGetSystemTimeNV
equals 0, we now cancels display lists updates. This allows the
tool to redraw the same frame several times in a row to run its
analysis.

For better results profiling should only be attempted after
setting viewroot.profile_rendering to true using adb shell
setprop.

Change-Id: I02e3c237418004cff8d6cb0b9a37126efae44c90
2013-05-23 12:50:13 -07:00
Anwar Ghuloum
3c61506b71 Add more memory usage stats
Added support for teasing apart different parts of the dalvik heap.

Note this adds more public api and we should talk to hackbod before going into master with this.

(cherry picked from commit 73407daf3f6110e933d8614605b21586c4c5fde2)

Change-Id: If4431f50e67e18bcc42e00694c97805477bd6815
2013-05-23 12:30:42 -07:00
Anwar Ghuloum
3a8ce1bec8 More stats for meminfo
Added shared clean tracking (for pageable stuff).  Renamed .oat and .art mmap.

(cherry picked from commit 967d53b17b6010c3a675ca9c3bbd0e9dd2f2f092)

Change-Id: I741e0dbe0d3f9aee6975c6fad8af9905942962d4
2013-05-23 12:29:59 -07:00
Anwar Ghuloum
88887d0a53 break out boot.art
breaking out boot.art mapped pages

(cherry picked from commit eaa3f2d59adaeb87cd8d1726b696521f984659c4)

Change-Id: Ie89477bd3a93a15de3a4db76ef5eae497c3087e3
2013-05-23 12:29:37 -07:00
Anwar Ghuloum
8884ef4fe8 Break out Oat footprint for ram
Breaking out oat footprint in meminfo.

(cherry picked from commit c92f177d96b5952e0bfde01597972fc607aed93a)

Change-Id: I7b0452045c265b7544c41d3a5953e10a081c5315
2013-05-23 12:28:08 -07:00