Report ANR, dumpsys after releasing lock on Monkey.this.
This ensures the availability of the lock to Activity controller's
appNotResponding.
Reporting dumpsys while holding the lock on this causes a cyclic
deadlock, when twoANRs are reported (one after the other).
Monkey's ActivityController is registered to ActivityManagerService
for handling ANR.The first ANR caused by either service timeout or
broadcast timeout is reported byActivityManagerService to Monkey's
ActivityController via Binder. Meanwhile, the lock on
ActivityManagerService is held by serviceTimeout or broadcastTimeout.
appNotResponding corresponding to first ANR reports procrank and
acquires a lock onMonkey.this and sets few bool variables like
mRequestAnrTraces and mRequestDumpsysMemInfoand returns the control
to ActivityManagerService's service/broadcast timeout.
VM executing monkey process switches the control to main monkey
thread and it acquires thelock on Monkey.this and proceeds to report
ANR traces.
Meanwhile, a second ANR occurs and Activity Manager Service invokes
ActivityController's appNotResponding (via binder). appNotResponding
reports the procrank and waits to acquire the lock on Monkey.this
which is being held by Monkey's main thread(busy reporting first ANR).
This results in a blocking wait for ActivityManagerService's
appNotRespondingLocked() (corresponding to second ANR).
Meanwhile, the monkey's main thread (holding lock on Monkey.this)
tries to report the meminfo for first ANR, invokes
reportDumpsysMemInfo(), which in turn causes the android runtime to
launch dumpsys process. The dumpsys process queries service manager
to get a reference to meminfo service and invoke dump() on the same.
The meminfo service is created by ActivityManagerService's
setSystemProcess(). The dump() method tries to acquire a lock on
ActivityManagerService which is held by ActivityManagerService's
service/broadcasttimeout (awaiting the response from
ActivityController for the second ANR).
This cyclic deadlock continues for a minute after which WatchDog
thread of system_server kills system_server as it hasn't got the
response from ActivityManagerService's monitor(). The monitor()
of ActivityManagerService too tries to acquire lock on this and is
invoked once in every minute.
DEADLOCK:
--------
ActivityManager --> ActivityController --> Monkey Main --> MemInfo
--> ActivityManager
Change-Id: I7718eff332e5551b1950ab1c45395bf1ff4b1bda
Removed Alarmclock app, due it's not needed any more and causes Errors with DeskClock
Removed not existing google Folders in out dir
Corrected path for frameworks/ex
Change-Id: I9d947f1e257cacc2142b141c2f2fe77076330705
Merge commit '3d81d6a2eb8be4649891687cb3354a66b981dfc8' into gingerbread-plus-aosp
* commit '3d81d6a2eb8be4649891687cb3354a66b981dfc8':
ndk: add tests/run-all.sh to run all automated tests.
Merge commit '284e3ae11c6f1fee5b2d417eea16b3a2126a04a5' into gingerbread-plus-aosp
* commit '284e3ae11c6f1fee5b2d417eea16b3a2126a04a5':
NDK access to the Asset Manager
Merge commit '435959e72b623a41ff4384862b924102dd7a1bc6' into gingerbread-plus-aosp
* commit '435959e72b623a41ff4384862b924102dd7a1bc6':
update notepad tutorial to change activity title in NoteEdit class
Merge commit 'f0f2aba8925b7f88af6c3af479c560e4e6b67ee4' into gingerbread
* commit 'f0f2aba8925b7f88af6c3af479c560e4e6b67ee4':
update notepad tutorial to change activity title in NoteEdit class
Merge commit '288d90c212b534e85ccf12d7bc1b5bd1d0562c5b' into gingerbread-plus-aosp
* commit '288d90c212b534e85ccf12d7bc1b5bd1d0562c5b':
The "current" SDK stubs jar should use the full apk that's exported, not the product-specific one.
Merge commit '4619318dd1398bd4f87b2e74827b9fb9796a2643' into gingerbread-plus-aosp
* commit '4619318dd1398bd4f87b2e74827b9fb9796a2643':
Sample code to illustrate how to use the accelerometer
Make the "glue library" part of the NDK as an importable module,
this has several benefits:
- no need to distribute a binary here with no easy way to regenerate it
- no need to explicitely list -lthreaded_app in your LOCAL_LDLIBS
(this is handled automatically by the module import capability)
- allows easier native debugging of what's really happening.
Note that the header is renamed <threaded_native_app.h>
+ Modify the native-activity sample to use and import the new module
+ Start documenting usage in the header file. We probably need something
better, and will probably put it under development/ndk/docs/ at some
point.
After this patch, we should be able to get rid of the code under
framework/base/native/{include.glue}
Change-Id: I6e81d70a225a6ca006beabf6e8b42529e8f371b9
this is a small particle + physics system that shows how
to integrate accleration data into positions accurately.
Change-Id: I3bbdc433f52d98464269ac8cb996c4cf037ae8d6
Merge commit '98b2c359c2b3361f43e14b0c5d07a02c055dd10e' into gingerbread-plus-aosp
* commit '98b2c359c2b3361f43e14b0c5d07a02c055dd10e':
Copy over updated NDK APIs and follow other API changes.
Merge commit 'fd606bc303bdf1fafefc4a6b79d050faa26d0800' into gingerbread-plus-aosp
* commit 'fd606bc303bdf1fafefc4a6b79d050faa26d0800':
Migrate to new keycode constants in keycodes.h.
Merge commit '5ef6b2f2568944e9dedf31c83716b8dd94dd506a' into gingerbread-plus-aosp
* commit '5ef6b2f2568944e9dedf31c83716b8dd94dd506a':
ndk sample hello-neon: use $(call import-module) to access the 'cpufeatures' library
This shows direct drawing to an ANativeWindow's bits.
Update the NDK API, and fix a bug in the native-activity app where it
would hang while exiting.
Change-Id: I4fa98d083405eb0d1b22b10a73a2ef18d45fdb59
Merge commit 'f68d6af83f8f99714c139d867e8328f558480f28' into gingerbread-plus-aosp
* commit 'f68d6af83f8f99714c139d867e8328f558480f28':
ndk: Add a test to check that prebuilt libraries work as expected.
Merge commit 'eefb5c2dca087c2b0a0ef90e15db00fb5523d8af' into gingerbread-plus-aosp
* commit 'eefb5c2dca087c2b0a0ef90e15db00fb5523d8af':
Update native_activity sample to use new glue code.