| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 int microphone = intent.getIntExtra("microphone", HAS_NO_MIC); | 233 int microphone = intent.getIntExtra("microphone", HAS_NO_MIC); |
| 234 String name = intent.getStringExtra("name"); | 234 String name = intent.getStringExtra("name"); |
| 235 Log.d(TAG, "BroadcastReceiver.onReceive" + AppRTCUtils.getThreadInfo() | 235 Log.d(TAG, "BroadcastReceiver.onReceive" + AppRTCUtils.getThreadInfo() |
| 236 + ": " | 236 + ": " |
| 237 + "a=" + intent.getAction() | 237 + "a=" + intent.getAction() |
| 238 + ", s=" + (state == STATE_UNPLUGGED ? "unplugged" : "plugged") | 238 + ", s=" + (state == STATE_UNPLUGGED ? "unplugged" : "plugged") |
| 239 + ", m=" + (microphone == HAS_MIC ? "mic" : "no mic") | 239 + ", m=" + (microphone == HAS_MIC ? "mic" : "no mic") |
| 240 + ", n=" + name | 240 + ", n=" + name |
| 241 + ", sb=" + isInitialStickyBroadcast()); | 241 + ", sb=" + isInitialStickyBroadcast()); |
| 242 | 242 |
| 243 boolean hasWiredHeadset = (state == STATE_PLUGGED) ? true : false; | 243 boolean hasWiredHeadset = (state == STATE_PLUGGED); |
| 244 switch (state) { | 244 switch (state) { |
| 245 case STATE_UNPLUGGED: | 245 case STATE_UNPLUGGED: |
| 246 updateAudioDeviceState(hasWiredHeadset); | 246 updateAudioDeviceState(hasWiredHeadset); |
| 247 break; | 247 break; |
| 248 case STATE_PLUGGED: | 248 case STATE_PLUGGED: |
| 249 if (selectedAudioDevice != AudioDevice.WIRED_HEADSET) { | 249 if (selectedAudioDevice != AudioDevice.WIRED_HEADSET) { |
| 250 updateAudioDeviceState(hasWiredHeadset); | 250 updateAudioDeviceState(hasWiredHeadset); |
| 251 } | 251 } |
| 252 break; | 252 break; |
| 253 default: | 253 default: |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 Log.e(TAG, "Invalid device list"); | 347 Log.e(TAG, "Invalid device list"); |
| 348 } | 348 } |
| 349 | 349 |
| 350 if (onStateChangeListener != null) { | 350 if (onStateChangeListener != null) { |
| 351 // Run callback to notify a listening client. The client can then | 351 // Run callback to notify a listening client. The client can then |
| 352 // use public getters to query the new state. | 352 // use public getters to query the new state. |
| 353 onStateChangeListener.run(); | 353 onStateChangeListener.run(); |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 } | 356 } |
| OLD | NEW |