summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiangyi <sam.andrew.jiang@gmail.com>2014-11-06 11:41:52 -0500
committerJiangyi <sam.andrew.jiang@gmail.com>2014-11-06 11:48:59 -0500
commitc11a5f227dd80c545c5b84b849d2a545373457cc (patch)
tree75f6056ee6938ebbc2e5e25d4f634faf0bb9887e
parentc1caf56610072721c0515df0cc6131fe978b70a4 (diff)
DSPManager: Update *_AUDIO_PLUG APIs
These were moved from Intent to AudioManager. https://github.com/omnirom/android_frameworks_base/commit/c5258433dd353769ccfa2e5e769a7379378a3a0b Change-Id: I0334e2d004d76744310db2d96e63e98cbb6a7a42
-rw-r--r--src/com/bel/android/dspmanager/service/HeadsetService.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/bel/android/dspmanager/service/HeadsetService.java b/src/com/bel/android/dspmanager/service/HeadsetService.java
index cafdfba..9399420 100644
--- a/src/com/bel/android/dspmanager/service/HeadsetService.java
+++ b/src/com/bel/android/dspmanager/service/HeadsetService.java
@@ -10,6 +10,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
+import android.media.AudioManager;
import android.media.audiofx.AudioEffect;
import android.media.audiofx.BassBoost;
import android.media.audiofx.Equalizer;
@@ -215,9 +216,9 @@ public class HeadsetService extends Service {
Log.i(TAG, "onReceive " + action);
final boolean prevUseHeadset = mUseHeadset;
final boolean prevUseUSB = mUseUSB;
- if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
+ if (action.equals(AudioManager.ACTION_HEADSET_PLUG)) {
mUseHeadset = intent.getIntExtra("state", 0) == 1;
- } else if (action.equals(Intent.ACTION_ANALOG_AUDIO_DOCK_PLUG)) {
+ } else if (action.equals(AudioManager.ACTION_ANALOG_AUDIO_DOCK_PLUG)) {
mUseUSB = intent.getIntExtra("state", 0) == 1;
}
Log.i(TAG, "Headset=" + mUseHeadset + " ; USB=" + mUseUSB);
@@ -266,8 +267,8 @@ public class HeadsetService extends Service {
audioFilter.addAction(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
registerReceiver(mAudioSessionReceiver, audioFilter);
- final IntentFilter intentFilter = new IntentFilter(Intent.ACTION_HEADSET_PLUG);
- intentFilter.addAction(Intent.ACTION_ANALOG_AUDIO_DOCK_PLUG);
+ final IntentFilter intentFilter = new IntentFilter(AudioManager.ACTION_HEADSET_PLUG);
+ intentFilter.addAction(AudioManager.ACTION_ANALOG_AUDIO_DOCK_PLUG);
registerReceiver(mRoutingReceiver, intentFilter);
registerReceiver(mPreferenceUpdateReceiver,