diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-12 18:15:32 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-12 18:15:32 +0000 |
commit | 881ba376eea77856097e12b1ca8fc98a6664d452 (patch) | |
tree | cce1db26efdcaf20aafba2812f62fc88e1164b0a | |
parent | f3f1fdd09cd7a9bec348244d05c7ee401168d7b6 (diff) | |
parent | 3567c39730825390da6c625cdc01403f656a4ad3 (diff) | |
download | platform_packages_apps_Test_connectivity-881ba376eea77856097e12b1ca8fc98a6664d452.tar.gz platform_packages_apps_Test_connectivity-881ba376eea77856097e12b1ca8fc98a6664d452.tar.bz2 platform_packages_apps_Test_connectivity-881ba376eea77856097e12b1ca8fc98a6664d452.zip |
release-request-dabd8cf7-7af2-48e9-a296-ccc6a71cc25d-for-git_oc-m2-release-4328410 snap-temp-L55300000101694322android-8.1.0_r8android-8.1.0_r52android-8.1.0_r50android-8.1.0_r47android-8.1.0_r46android-8.1.0_r43android-8.1.0_r41android-8.1.0_r36android-8.1.0_r35android-8.1.0_r33android-8.1.0_r30android-8.1.0_r26android-8.1.0_r25android-8.1.0_r20android-8.1.0_r2oreo-m7-releaseoreo-m6-s4-releaseoreo-m6-s3-releaseoreo-m6-s2-releaseoreo-m2-s5-releaseoreo-m2-s4-releaseoreo-m2-s3-releaseoreo-m2-s2-releaseoreo-m2-s1-releaseoreo-m2-release
Change-Id: Ia2cabb62e70bd959f7e09163f9a9cd302d12e975
-rw-r--r-- | PMC/src/com/android/pmc/A2dpReceiver.java | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/PMC/src/com/android/pmc/A2dpReceiver.java b/PMC/src/com/android/pmc/A2dpReceiver.java index 7cb4ece..676093b 100644 --- a/PMC/src/com/android/pmc/A2dpReceiver.java +++ b/PMC/src/com/android/pmc/A2dpReceiver.java @@ -142,8 +142,6 @@ public class A2dpReceiver extends BroadcastReceiver { private boolean initialize() { Log.d(TAG, "Start initialize()"); - mPMCStatusLogger = new PMCStatusLogger(TAG + ".log", TAG); - // Check if any Bluetooth devices are connected ArrayList<BluetoothDevice> results = new ArrayList<BluetoothDevice>(); Set<BluetoothDevice> bondedDevices = mBluetoothAdapter.getBondedDevices(); @@ -207,6 +205,9 @@ public class A2dpReceiver extends BroadcastReceiver { String musicUrl; String tmpStr; + // Create the logger object + mPMCStatusLogger = new PMCStatusLogger(TAG + ".log", TAG); + // For a baseline case when Blueooth is off but music is playing with speaker is muted boolean bt_off_mute = false; @@ -216,10 +217,19 @@ public class A2dpReceiver extends BroadcastReceiver { Log.e(TAG, "No parameters specified"); return; } - // Always initialize() - if (!initialize()) { - mPMCStatusLogger.logStatus("initialize() Failed"); - return; + + if (extras.containsKey("BT_OFF_Mute")) { + Log.v(TAG, "Mute is specified for Bluetooth off baseline case"); + bt_off_mute = true; + } + + // initialize() if we are testing over Bluetooth, we do NOT test + // over bluetooth for the play music with Bluetooth off test case. + if (!bt_off_mute) { + if (!initialize()) { + mPMCStatusLogger.logStatus("initialize() Failed"); + return; + } } // Check if it is baseline Bluetooth is on but not stream if (extras.containsKey("BT_ON_NotPlay")) { @@ -251,11 +261,7 @@ public class A2dpReceiver extends BroadcastReceiver { return; } // Check if it is the baseline that Bluetooth is off but streaming with speakers muted - if (extras.containsKey("BT_OFF_Mute")) { - Log.v(TAG, "Mute is specified for Bluetooth off baseline case"); - bt_off_mute = true; - } else { - + if (!bt_off_mute) { if (!extras.containsKey("CodecType")) { Log.e(TAG, "No Codec Type specified"); return; @@ -313,7 +319,7 @@ public class A2dpReceiver extends BroadcastReceiver { if (codecType == BluetoothCodecConfig.SOURCE_CODEC_TYPE_INVALID || sampleRate == BluetoothCodecConfig.SAMPLE_RATE_NONE || bitsPerSample == BluetoothCodecConfig.BITS_PER_SAMPLE_NONE) { - Log.d(TAG, "Invalid paramters"); + Log.d(TAG, "Invalid parameters"); return; } } @@ -338,7 +344,7 @@ public class A2dpReceiver extends BroadcastReceiver { * Function to setup MediaPlayer and play music * * @param musicURL - Music URL - * @param bt_off_mute - true is to mute speakers + * @param btOffMute - true is to mute speakers * */ private boolean playMusic(String musicURL, boolean btOffMute) { @@ -357,7 +363,6 @@ public class A2dpReceiver extends BroadcastReceiver { Log.d(TAG, "Set Normal Volume for speakers"); mPlayer.setVolume(NORMAL_VOLUME, NORMAL_VOLUME); } - // Play Music now and setup looping mPlayer.start(); mPlayer.setLooping(true); |