OSDN Git Service

Cherrypick d1ed33c4 from hc-mr1. do not merge.
authorXavier Ducrohet <xav@android.com>
Sat, 4 Jun 2011 00:25:48 +0000 (17:25 -0700)
committerXavier Ducrohet <xav@android.com>
Sat, 4 Jun 2011 01:37:09 +0000 (18:37 -0700)
commit156a211b21fbaeb6391162a056390b9cd8748fae
tree8160f75bb58fa7317256f1ba09530573686ef9f9
parent21726044a934f3f4f9827a05bbc8db2477220fa1
Cherrypick d1ed33c4 from hc-mr1. do not merge.

Fix zombie threads in the Layoutlib.

Some widgets can create (indirectly) HandlerThread which are started
but never stopped.

This patch use the delegate methods to override the thread run method
to record which threads are started to be able to call quit() on them
after a render.

Note that we should really fix layoutlib_create to be able to call
the default implementation from a delegate to remove code duplication.

Change-Id: Iaf5432623e9704bb3114a8e0583c8553282c205e
tools/layoutlib/bridge/src/android/os/HandlerThread_Delegate.java [new file with mode: 0644]
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java
tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java