diff options
| author | 2014-12-23 22:52:34 +0800 | |
|---|---|---|
| committer | 2014-12-23 22:52:34 +0800 | |
| commit | 9ac9609f4d078dc0d7fe7c703fb88d20fd629bfe (patch) | |
| tree | 5d11d1e306e61b6ef4b41992e95b1afceced9973 /libs/hwui/PathCache.cpp | |
| parent | 2b20efa728f79ef9322930aefbbf0483a578ee74 (diff) | |
[ActivityManager] Prevent application holding AMS lock
Symptom:
Watchdog timeout.
Reproduce code:
String action = "lets.deadlock";
Uri baseUri = Uri.parse("content://i.am.bad");
Uri uri = ContentUris.withAppendedId(baseUri, 1);
Intent intent = new Intent(action, uri);
sendStickyBroadcast(intent);
IntentFilter filter = new IntentFilter(action);
filter.addDataScheme(baseUri.getScheme());
filter.addDataAuthority(baseUri.getAuthority(), null);
filter.addDataPath(uri.getPath(), 0);
registerReceiver(null, filter);
In target provider's getType:
Invoke AMS function will result deadlock.
Or sleep a long time will also trigger watchdog timeout.
Root Cause:
If broadcast is sticky with content scheme intent.
Register receiver will trigger access provider when
matching intent with IntentFilter, and it executes
in ActivityManagerService's lock.
Solution:
Obtain necessary data to local to split lock block.
Change-Id: I0fb94472cdc478997e40ba2a60a988c5f53badb2
Diffstat (limited to 'libs/hwui/PathCache.cpp')
0 files changed, 0 insertions, 0 deletions