summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/a2dp
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2014-10-28 14:07:00 -0700
committerMike Lockwood <lockwood@google.com>2014-10-28 14:07:00 -0700
commit838949d46a4cc054985a8cfd682004f8dd6d3bbb (patch)
tree6f773ca4465af83fd3bd6b7ed1284e9181a13d14 /src/com/android/bluetooth/a2dp
parent9b95221e5d4efc1678f3342a15c05f293cc79a05 (diff)
downloadandroid_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')
-rwxr-xr-xsrc/com/android/bluetooth/a2dp/A2dpService.java11
-rw-r--r--src/com/android/bluetooth/a2dp/A2dpSinkService.java8
-rw-r--r--src/com/android/bluetooth/a2dp/A2dpSinkStateMachine.java9
-rwxr-xr-xsrc/com/android/bluetooth/a2dp/A2dpStateMachine.java8
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;