Merge "Fix bug with null pointer exception with conference call"
diff --git a/src/com/android/telecomm/HeadsetMediaButton.java b/src/com/android/telecomm/HeadsetMediaButton.java
index dab2475..a0d5858 100644
--- a/src/com/android/telecomm/HeadsetMediaButton.java
+++ b/src/com/android/telecomm/HeadsetMediaButton.java
@@ -31,37 +31,6 @@
*/
final class HeadsetMediaButton extends CallsManagerListenerBase {
- /**
- * Broadcast receiver for the ACTION_MEDIA_BUTTON broadcast intent.
- *
- * This functionality isn't lumped in with the other intents in TelecommBroadcastReceiver
- * because we instantiate this as a totally separate BroadcastReceiver instance, since we need
- * to manually adjust its IntentFilter's priority (to make sure we get these intents *before*
- * the media player.)
- */
- private final class MediaButtonBroadcastReceiver extends BroadcastReceiver {
- @Override
- public void onReceive(Context context, Intent intent) {
- KeyEvent event = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
- Log.v(this, "MediaButtonBroadcastReceiver.onReceive()... event = %s.", event);
- if ((event != null) && (event.getKeyCode() == KeyEvent.KEYCODE_HEADSETHOOK)) {
- boolean consumed = handleHeadsetHook(event);
- Log.v(this, "==> handleHeadsetHook(): consumed = %b.", consumed);
- if (consumed) {
- abortBroadcast();
- }
- } else {
- if (CallsManager.getInstance().hasAnyCalls()) {
- // If the phone is anything other than completely idle, then we consume and
- // ignore any media key events, otherwise it is too easy to accidentally start
- // playing music while a phone call is in progress.
- Log.v(this, "MediaButtonBroadcastReceiver: consumed");
- abortBroadcast();
- }
- }
- }
- }
-
// Types of media button presses
static final int SHORT_PRESS = 1;
static final int LONG_PRESS = 2;
@@ -79,9 +48,6 @@
}
};
- private final MediaButtonBroadcastReceiver mMediaButtonReceiver =
- new MediaButtonBroadcastReceiver();
-
private final CallsManager mCallsManager;
private final MediaSession mSession;
@@ -89,23 +55,6 @@
HeadsetMediaButton(Context context, CallsManager callsManager) {
mCallsManager = callsManager;
- // Use a separate receiver (from TelecommBroadcastReceiver) for ACTION_MEDIA_BUTTON
- // broadcasts, since we need to manually adjust its priority (to make sure we get these
- // intents *before* the media player.)
- IntentFilter mediaButtonIntentFilter =
- new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
-
- // Make sure we're higher priority than the media player's MediaButtonIntentReceiver (which
- // currently has the default priority of zero; see apps/Music/AndroidManifest.xml.)
- mediaButtonIntentFilter.setPriority(1);
-
- context.registerReceiver(mMediaButtonReceiver, mediaButtonIntentFilter);
-
- // register the component so it gets priority for calls
- AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
- am.registerMediaButtonEventReceiverForCalls(new ComponentName(context.getPackageName(),
- MediaButtonBroadcastReceiver.class.getName()));
-
// Register a MediaSession but don't enable it yet. This is a
// replacement for MediaButtonReceiver
MediaSessionManager msm =
diff --git a/tests/src/com/android/telecomm/testapps/TestDialerActivity.java b/tests/src/com/android/telecomm/testapps/TestDialerActivity.java
index 5f3c999..405bca5 100644
--- a/tests/src/com/android/telecomm/testapps/TestDialerActivity.java
+++ b/tests/src/com/android/telecomm/testapps/TestDialerActivity.java
@@ -3,7 +3,6 @@
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
-import android.telecomm.TelecommConstants;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
@@ -48,9 +47,7 @@
}
private void setDefault() {
- final Intent intent = new Intent(TelecommConstants.ACTION_CHANGE_DEFAULT_PHONE);
- intent.putExtra(TelecommConstants.EXTRA_PACKAGE_NAME, this.getBasePackageName());
- startActivity(intent);
+ // TODO: Send a request to become the default dialer application
}
private void placeCall() {