diff options
author | Mike Lockwood <lockwood@google.com> | 2014-10-28 14:07:00 -0700 |
---|---|---|
committer | Mike Lockwood <lockwood@google.com> | 2014-10-28 14:07:00 -0700 |
commit | 838949d46a4cc054985a8cfd682004f8dd6d3bbb (patch) | |
tree | 6f773ca4465af83fd3bd6b7ed1284e9181a13d14 /src/com/android/bluetooth/a2dp | |
parent | 9b95221e5d4efc1678f3342a15c05f293cc79a05 (diff) | |
download | android_packages_apps_Bluetooth-838949d46a4cc054985a8cfd682004f8dd6d3bbb.tar.gz android_packages_apps_Bluetooth-838949d46a4cc054985a8cfd682004f8dd6d3bbb.tar.bz2 android_packages_apps_Bluetooth-838949d46a4cc054985a8cfd682004f8dd6d3bbb.zip |
Add dumpsys support for bluetooth
Bug: 18159457
Change-Id: I807a7d921b6e5baf111d0f0e3e182c6633a93b7c
Diffstat (limited to 'src/com/android/bluetooth/a2dp')
4 files changed, 34 insertions, 2 deletions
diff --git a/src/com/android/bluetooth/a2dp/A2dpService.java b/src/com/android/bluetooth/a2dp/A2dpService.java index 808ec9890..bae637398 100755 --- a/src/com/android/bluetooth/a2dp/A2dpService.java +++ b/src/com/android/bluetooth/a2dp/A2dpService.java @@ -297,4 +297,15 @@ public class A2dpService extends ProfileService { return service.isA2dpPlaying(device); } }; + + @Override + public void dump(StringBuilder sb) { + super.dump(sb); + if (mStateMachine != null) { + mStateMachine.dump(sb); + } + if (mAvrcp != null) { + mAvrcp.dump(sb); + } + } } diff --git a/src/com/android/bluetooth/a2dp/A2dpSinkService.java b/src/com/android/bluetooth/a2dp/A2dpSinkService.java index bd27952d2..5dcec7347 100644 --- a/src/com/android/bluetooth/a2dp/A2dpSinkService.java +++ b/src/com/android/bluetooth/a2dp/A2dpSinkService.java @@ -210,4 +210,12 @@ public class A2dpSinkService extends ProfileService { return service.getAudioConfig(device); } }; + + @Override + public void dump(StringBuilder sb) { + super.dump(sb); + if (mStateMachine != null) { + mStateMachine.dump(sb); + } + } } diff --git a/src/com/android/bluetooth/a2dp/A2dpSinkStateMachine.java b/src/com/android/bluetooth/a2dp/A2dpSinkStateMachine.java index 929676fdf..d57a0ca95 100644 --- a/src/com/android/bluetooth/a2dp/A2dpSinkStateMachine.java +++ b/src/com/android/bluetooth/a2dp/A2dpSinkStateMachine.java @@ -156,7 +156,14 @@ final class A2dpSinkStateMachine extends StateMachine { mAudioConfigs.clear(); } - private class Disconnected extends State { + public void dump(StringBuilder sb) { + ProfileService.println(sb, "mCurrentDevice: " + mCurrentDevice); + ProfileService.println(sb, "mTargetDevice: " + mTargetDevice); + ProfileService.println(sb, "mIncomingDevice: " + mIncomingDevice); + ProfileService.println(sb, "StateMachine: " + this.toString()); + } + + private class Disconnected extends State { @Override public void enter() { log("Enter Disconnected: " + getCurrentMessage().what); diff --git a/src/com/android/bluetooth/a2dp/A2dpStateMachine.java b/src/com/android/bluetooth/a2dp/A2dpStateMachine.java index 94cc391a1..19d4ebdde 100755 --- a/src/com/android/bluetooth/a2dp/A2dpStateMachine.java +++ b/src/com/android/bluetooth/a2dp/A2dpStateMachine.java @@ -134,7 +134,6 @@ final class A2dpStateMachine extends StateMachine { mIntentBroadcastHandler = new IntentBroadcastHandler(); mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); - } static A2dpStateMachine make(A2dpService svc, Context context) { @@ -753,6 +752,13 @@ final class A2dpStateMachine extends StateMachine { } } + public void dump(StringBuilder sb) { + ProfileService.println(sb, "mCurrentDevice: " + mCurrentDevice); + ProfileService.println(sb, "mTargetDevice: " + mTargetDevice); + ProfileService.println(sb, "mIncomingDevice: " + mIncomingDevice); + ProfileService.println(sb, "mPlayingA2dpDevice: " + mPlayingA2dpDevice); + ProfileService.println(sb, "StateMachine: " + this.toString()); + } // Event types for STACK_EVENT message final private static int EVENT_TYPE_NONE = 0; |