Commit 4cd2be4c authored by Sébastien Toque's avatar Sébastien Toque
Browse files

init headset detection option

parent b5f020a5
......@@ -32,9 +32,11 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.IBinder;
import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.util.Log;
import android.widget.RemoteViews;
......@@ -80,6 +82,9 @@ public class AudioServiceController implements AudioPlayerControl {
// Register controller to the service
try {
mAudioServiceBinder.addAudioCallback(mCallback);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(MainActivity.getInstance());
boolean enableHS = prefs.getBoolean("enable_headset_detection", false);
AudioServiceController.getInstance().detectHeadset(enableHS);
} catch (RemoteException e) {
Log.e(TAG, "remote procedure call failed: addAudioCallback()");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment