diff options
author | Wale Ogunwale <ogunwale@google.com> | 2015-04-15 10:27:24 -0700 |
---|---|---|
committer | Wale Ogunwale <ogunwale@google.com> | 2015-04-15 12:12:43 -0700 |
commit | 517daeccb29ce42b1ec4b366e7807088cad3f5ed (patch) | |
tree | f0ae2792f32fd0650cf4025a70781807520c79fd /services/core/java/com/android/server/Watchdog.java | |
parent | 1a3c3303ebfa5ca6390f6412653987afa66014b2 (diff) | |
download | frameworks_base-517daeccb29ce42b1ec4b366e7807088cad3f5ed.zip frameworks_base-517daeccb29ce42b1ec4b366e7807088cad3f5ed.tar.gz frameworks_base-517daeccb29ce42b1ec4b366e7807088cad3f5ed.tar.bz2 |
Moved SystemServer binder thread monitor from AMS to Monitor class.
Since to it applies to more than just the ActivityManagerService.
Bug: 19297165
Change-Id: I3affd50aaf8a49589ca48b845d6d31e4a44efb8f
Diffstat (limited to 'services/core/java/com/android/server/Watchdog.java')
-rw-r--r-- | services/core/java/com/android/server/Watchdog.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/Watchdog.java b/services/core/java/com/android/server/Watchdog.java index 69e61f6..772a15c 100644 --- a/services/core/java/com/android/server/Watchdog.java +++ b/services/core/java/com/android/server/Watchdog.java @@ -190,6 +190,17 @@ public class Watchdog extends Thread { } } + /** Monitor for checking the availability of binder threads. The monitor will block until + * there is a binder thread available to process in coming IPCs to make sure other processes + * can still communicate with the service. + */ + private static final class BinderThreadMonitor implements Watchdog.Monitor { + @Override + public void monitor() { + Binder.blockUntilThreadAvailable(); + } + } + public interface Monitor { void monitor(); } @@ -227,6 +238,9 @@ public class Watchdog extends Thread { // And the display thread. mHandlerCheckers.add(new HandlerChecker(DisplayThread.getHandler(), "display thread", DEFAULT_TIMEOUT)); + + // Initialize monitor for Binder threads. + addMonitor(new BinderThreadMonitor()); } public void init(Context context, ActivityManagerService activity) { |