Loading android/app/src/com/android/bluetooth/a2dpsink/A2dpSinkStreamHandler.java +13 −2 Original line number Diff line number Diff line Loading @@ -111,8 +111,14 @@ public class A2dpSinkStreamHandler extends Handler { } switch (message.what) { case SRC_STR_START: // Audio stream has started, stop it if we don't have focus. mStreamAvailable = true; // Always request audio focus if on TV. if (isTvDevice()) { if (mAudioFocus == AudioManager.AUDIOFOCUS_NONE) { requestAudioFocus(); } } // Audio stream has started, stop it if we don't have focus. if (mAudioFocus == AudioManager.AUDIOFOCUS_NONE) { sendAvrcpPause(); } else { Loading Loading @@ -142,7 +148,7 @@ public class A2dpSinkStreamHandler extends Handler { case SRC_PLAY: // Remote play command. // If is an iot device gain focus and start avrcp updates. if (isIotDevice()) { if (isIotDevice() || isTvDevice()) { if (mAudioFocus == AudioManager.AUDIOFOCUS_NONE) { requestAudioFocus(); } Loading Loading @@ -367,4 +373,9 @@ public class A2dpSinkStreamHandler extends Handler { private boolean isIotDevice() { return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_EMBEDDED); } private boolean isTvDevice() { return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK); } } Loading
android/app/src/com/android/bluetooth/a2dpsink/A2dpSinkStreamHandler.java +13 −2 Original line number Diff line number Diff line Loading @@ -111,8 +111,14 @@ public class A2dpSinkStreamHandler extends Handler { } switch (message.what) { case SRC_STR_START: // Audio stream has started, stop it if we don't have focus. mStreamAvailable = true; // Always request audio focus if on TV. if (isTvDevice()) { if (mAudioFocus == AudioManager.AUDIOFOCUS_NONE) { requestAudioFocus(); } } // Audio stream has started, stop it if we don't have focus. if (mAudioFocus == AudioManager.AUDIOFOCUS_NONE) { sendAvrcpPause(); } else { Loading Loading @@ -142,7 +148,7 @@ public class A2dpSinkStreamHandler extends Handler { case SRC_PLAY: // Remote play command. // If is an iot device gain focus and start avrcp updates. if (isIotDevice()) { if (isIotDevice() || isTvDevice()) { if (mAudioFocus == AudioManager.AUDIOFOCUS_NONE) { requestAudioFocus(); } Loading Loading @@ -367,4 +373,9 @@ public class A2dpSinkStreamHandler extends Handler { private boolean isIotDevice() { return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_EMBEDDED); } private boolean isTvDevice() { return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK); } }