summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AndroidManifest.xml6
-rw-r--r--src/com/cyngn/audiofx/receiver/ServiceDispatcher.java35
2 files changed, 2 insertions, 39 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 5533e3c..cf38f0c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -93,16 +93,14 @@
</intent-filter>
</activity>
- <service android:name=".service.AudioFxService"/>
-
- <receiver android:name=".receiver.ServiceDispatcher">
+ <service android:name=".service.AudioFxService">
<intent-filter>
<action android:name="android.media.action.OPEN_AUDIO_EFFECT_CONTROL_SESSION"/>
<action android:name="android.media.action.CLOSE_AUDIO_EFFECT_CONTROL_SESSION"/>
<action android:name="android.media.AUDIO_BECOMING_NOISY"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
- </receiver>
+ </service>
<receiver android:name=".service.BootReceiver">
<intent-filter>
diff --git a/src/com/cyngn/audiofx/receiver/ServiceDispatcher.java b/src/com/cyngn/audiofx/receiver/ServiceDispatcher.java
deleted file mode 100644
index c36a246..0000000
--- a/src/com/cyngn/audiofx/receiver/ServiceDispatcher.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.cyngn.audiofx.receiver;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.media.audiofx.AudioEffect;
-import android.util.Log;
-
-import com.cyngn.audiofx.service.AudioFxService;
-
-public class ServiceDispatcher extends BroadcastReceiver {
- @Override
- public void onReceive(Context context, Intent intent) {
-
- Intent service = new Intent(context, AudioFxService.class);
- String action = intent.getAction();
-
- // We can also get AUDIO_BECOMING_NOISY, which means a device change is
- // coming and we should wake up to handle it.
- if (action.equals(AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION) ||
- action.equals(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION)) {
- int sessionId = intent.getIntExtra(AudioEffect.EXTRA_AUDIO_SESSION, 0);
- String pkg = intent.getStringExtra(AudioEffect.EXTRA_PACKAGE_NAME);
- service.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, sessionId);
- service.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, pkg);
- }
-
- service.setAction(action);
- context.startService(service);
- if (AudioFxService.DEBUG) {
- Log.d("AudioFX-Dispatcher", "Received " + action);
- }
-
- }
-}