summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'InCallUI/src/com/android')
-rw-r--r--InCallUI/src/com/android/incallui/AudioModeProvider.java12
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonFragment.java40
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonPresenter.java12
-rw-r--r--InCallUI/src/com/android/incallui/ProximitySensor.java10
-rw-r--r--InCallUI/src/com/android/incallui/ringtone/InCallTonePlayer.java4
5 files changed, 39 insertions, 39 deletions
diff --git a/InCallUI/src/com/android/incallui/AudioModeProvider.java b/InCallUI/src/com/android/incallui/AudioModeProvider.java
index 961fb11ff..ea56dd624 100644
--- a/InCallUI/src/com/android/incallui/AudioModeProvider.java
+++ b/InCallUI/src/com/android/incallui/AudioModeProvider.java
@@ -16,9 +16,9 @@
package com.android.incallui;
-import com.google.common.collect.Lists;
+import android.telecom.CallAudioState;
-import com.android.dialer.compat.CallAudioStateCompat;
+import com.google.common.collect.Lists;
import java.util.List;
@@ -30,11 +30,11 @@ public class AudioModeProvider {
static final int AUDIO_MODE_INVALID = 0;
private static AudioModeProvider sAudioModeProvider = new AudioModeProvider();
- private int mAudioMode = CallAudioStateCompat.ROUTE_EARPIECE;
+ private int mAudioMode = CallAudioState.ROUTE_EARPIECE;
private boolean mMuted = false;
- private int mSupportedModes = CallAudioStateCompat.ROUTE_EARPIECE
- | CallAudioStateCompat.ROUTE_BLUETOOTH | CallAudioStateCompat.ROUTE_WIRED_HEADSET
- | CallAudioStateCompat.ROUTE_SPEAKER;
+ private int mSupportedModes = CallAudioState.ROUTE_EARPIECE
+ | CallAudioState.ROUTE_BLUETOOTH | CallAudioState.ROUTE_WIRED_HEADSET
+ | CallAudioState.ROUTE_SPEAKER;
private final List<AudioModeListener> mListeners = Lists.newArrayList();
public static AudioModeProvider getInstance() {
diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java
index d9e474de5..9859f4e7b 100644
--- a/InCallUI/src/com/android/incallui/CallButtonFragment.java
+++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java
@@ -39,6 +39,7 @@ import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Bundle;
+import android.telecom.CallAudioState;
import android.util.SparseIntArray;
import android.view.ContextThemeWrapper;
import android.view.HapticFeedbackConstants;
@@ -55,7 +56,6 @@ import android.widget.PopupMenu.OnMenuItemClickListener;
import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette;
import com.android.dialer.R;
-import com.android.dialer.compat.CallAudioStateCompat;
/**
* Fragment for call control buttons
@@ -523,17 +523,17 @@ public class CallButtonFragment
Log.d(this, " id: " + item.getItemId());
Log.d(this, " title: '" + item.getTitle() + "'");
- int mode = CallAudioStateCompat.ROUTE_WIRED_OR_EARPIECE;
+ int mode = CallAudioState.ROUTE_WIRED_OR_EARPIECE;
int resId = item.getItemId();
if (resId == R.id.audio_mode_speaker) {
- mode = CallAudioStateCompat.ROUTE_SPEAKER;
+ mode = CallAudioState.ROUTE_SPEAKER;
} else if (resId == R.id.audio_mode_earpiece || resId == R.id.audio_mode_wired_headset) {
// InCallCallAudioState.ROUTE_EARPIECE means either the handset earpiece,
// or the wired headset (if connected.)
- mode = CallAudioStateCompat.ROUTE_WIRED_OR_EARPIECE;
+ mode = CallAudioState.ROUTE_WIRED_OR_EARPIECE;
} else if (resId == R.id.audio_mode_bluetooth) {
- mode = CallAudioStateCompat.ROUTE_BLUETOOTH;
+ mode = CallAudioState.ROUTE_BLUETOOTH;
} else {
Log.e(this, "onMenuItemClick: unexpected View ID " + item.getItemId()
+ " (MenuItem = '" + item + "')");
@@ -561,9 +561,9 @@ public class CallButtonFragment
*/
private void onAudioButtonClicked() {
Log.d(this, "onAudioButtonClicked: " +
- CallAudioStateCompat.audioRouteToString(getPresenter().getSupportedAudio()));
+ CallAudioState.audioRouteToString(getPresenter().getSupportedAudio()));
- if (isSupported(CallAudioStateCompat.ROUTE_BLUETOOTH)) {
+ if (isSupported(CallAudioState.ROUTE_BLUETOOTH)) {
showAudioModePopup();
} else {
getPresenter().toggleSpeakerphone();
@@ -598,8 +598,8 @@ public class CallButtonFragment
* are visible based on the supported audio formats.
*/
private void updateAudioButtons(int supportedModes) {
- final boolean bluetoothSupported = isSupported(CallAudioStateCompat.ROUTE_BLUETOOTH);
- final boolean speakerSupported = isSupported(CallAudioStateCompat.ROUTE_SPEAKER);
+ final boolean bluetoothSupported = isSupported(CallAudioState.ROUTE_BLUETOOTH);
+ final boolean speakerSupported = isSupported(CallAudioState.ROUTE_SPEAKER);
boolean audioButtonEnabled = false;
boolean audioButtonChecked = false;
@@ -619,9 +619,9 @@ public class CallButtonFragment
showMoreIndicator = true;
// Update desired layers:
- if (isAudio(CallAudioStateCompat.ROUTE_BLUETOOTH)) {
+ if (isAudio(CallAudioState.ROUTE_BLUETOOTH)) {
showBluetoothIcon = true;
- } else if (isAudio(CallAudioStateCompat.ROUTE_SPEAKER)) {
+ } else if (isAudio(CallAudioState.ROUTE_SPEAKER)) {
showSpeakerphoneIcon = true;
} else {
showHandsetIcon = true;
@@ -640,7 +640,7 @@ public class CallButtonFragment
// The audio button *is* a toggle in this state, and indicated the
// current state of the speakerphone.
- audioButtonChecked = isAudio(CallAudioStateCompat.ROUTE_SPEAKER);
+ audioButtonChecked = isAudio(CallAudioState.ROUTE_SPEAKER);
mAudioButton.setSelected(audioButtonChecked);
// update desired layers:
@@ -701,20 +701,20 @@ public class CallButtonFragment
// If bluetooth is not supported, the audio buttion will toggle, so use the label "speaker".
// Otherwise, use the label of the currently selected audio mode.
- if (!isSupported(CallAudioStateCompat.ROUTE_BLUETOOTH)) {
+ if (!isSupported(CallAudioState.ROUTE_BLUETOOTH)) {
stringId = R.string.audio_mode_speaker;
} else {
switch (mode) {
- case CallAudioStateCompat.ROUTE_EARPIECE:
+ case CallAudioState.ROUTE_EARPIECE:
stringId = R.string.audio_mode_earpiece;
break;
- case CallAudioStateCompat.ROUTE_BLUETOOTH:
+ case CallAudioState.ROUTE_BLUETOOTH:
stringId = R.string.audio_mode_bluetooth;
break;
- case CallAudioStateCompat.ROUTE_WIRED_HEADSET:
+ case CallAudioState.ROUTE_WIRED_HEADSET:
stringId = R.string.audio_mode_wired_headset;
break;
- case CallAudioStateCompat.ROUTE_SPEAKER:
+ case CallAudioState.ROUTE_SPEAKER:
stringId = R.string.audio_mode_speaker;
break;
}
@@ -744,7 +744,7 @@ public class CallButtonFragment
// See comments below for the exact logic.
final MenuItem speakerItem = menu.findItem(R.id.audio_mode_speaker);
- speakerItem.setEnabled(isSupported(CallAudioStateCompat.ROUTE_SPEAKER));
+ speakerItem.setEnabled(isSupported(CallAudioState.ROUTE_SPEAKER));
// TODO: Show speakerItem as initially "selected" if
// speaker is on.
@@ -753,7 +753,7 @@ public class CallButtonFragment
final MenuItem earpieceItem = menu.findItem(R.id.audio_mode_earpiece);
final MenuItem wiredHeadsetItem = menu.findItem(R.id.audio_mode_wired_headset);
- final boolean usingHeadset = isSupported(CallAudioStateCompat.ROUTE_WIRED_HEADSET);
+ final boolean usingHeadset = isSupported(CallAudioState.ROUTE_WIRED_HEADSET);
earpieceItem.setVisible(!usingHeadset);
earpieceItem.setEnabled(!usingHeadset);
wiredHeadsetItem.setVisible(usingHeadset);
@@ -763,7 +763,7 @@ public class CallButtonFragment
// bluetoothIndicatorOn are both false.
final MenuItem bluetoothItem = menu.findItem(R.id.audio_mode_bluetooth);
- bluetoothItem.setEnabled(isSupported(CallAudioStateCompat.ROUTE_BLUETOOTH));
+ bluetoothItem.setEnabled(isSupported(CallAudioState.ROUTE_BLUETOOTH));
// TODO: Show bluetoothItem as initially "selected" if
// bluetoothIndicatorOn is true.
diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
index fd0dd7639..e8c2d4b13 100644
--- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
@@ -31,12 +31,12 @@ import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_UPGRADE_TO_
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
+import android.telecom.CallAudioState;
import android.telecom.InCallService.VideoCall;
import android.telecom.VideoProfile;
import com.android.contacts.common.compat.CallSdkCompat;
import com.android.contacts.common.compat.SdkVersionOverride;
-import com.android.dialer.compat.CallAudioStateCompat;
import com.android.dialer.compat.UserManagerCompat;
import com.android.incallui.AudioModeProvider.AudioModeListener;
import com.android.incallui.InCallCameraManager.Listener;
@@ -189,7 +189,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
// an update for onAudioMode(). This will make UI response immediate
// if it turns out to be slow
- Log.d(this, "Sending new Audio Mode: " + CallAudioStateCompat.audioRouteToString(mode));
+ Log.d(this, "Sending new Audio Mode: " + CallAudioState.audioRouteToString(mode));
TelecomAdapter.getInstance().setAudioRoute(mode);
}
@@ -198,7 +198,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
*/
public void toggleSpeakerphone() {
// this function should not be called if bluetooth is available
- if (0 != (CallAudioStateCompat.ROUTE_BLUETOOTH & getSupportedAudio())) {
+ if (0 != (CallAudioState.ROUTE_BLUETOOTH & getSupportedAudio())) {
// It's clear the UI is wrong, so update the supported mode once again.
Log.e(this, "toggling speakerphone not allowed when bluetooth supported.");
@@ -206,11 +206,11 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
return;
}
- int newMode = CallAudioStateCompat.ROUTE_SPEAKER;
+ int newMode = CallAudioState.ROUTE_SPEAKER;
// if speakerphone is already on, change to wired/earpiece
- if (getAudioMode() == CallAudioStateCompat.ROUTE_SPEAKER) {
- newMode = CallAudioStateCompat.ROUTE_WIRED_OR_EARPIECE;
+ if (getAudioMode() == CallAudioState.ROUTE_SPEAKER) {
+ newMode = CallAudioState.ROUTE_WIRED_OR_EARPIECE;
}
setAudioMode(newMode);
diff --git a/InCallUI/src/com/android/incallui/ProximitySensor.java b/InCallUI/src/com/android/incallui/ProximitySensor.java
index 733a67d5d..3c9fd9370 100644
--- a/InCallUI/src/com/android/incallui/ProximitySensor.java
+++ b/InCallUI/src/com/android/incallui/ProximitySensor.java
@@ -23,9 +23,9 @@ import android.content.res.Configuration;
import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManager.DisplayListener;
import android.os.PowerManager;
+import android.telecom.CallAudioState;
import android.view.Display;
-import com.android.dialer.compat.CallAudioStateCompat;
import com.android.incallui.AudioModeProvider.AudioModeListener;
import com.android.incallui.InCallPresenter.InCallState;
import com.android.incallui.InCallPresenter.InCallStateListener;
@@ -228,9 +228,9 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene
// turn proximity sensor off and turn screen on immediately if
// we are using a headset, the keyboard is open, or the device
// is being held in a horizontal position.
- boolean screenOnImmediately = (CallAudioStateCompat.ROUTE_WIRED_HEADSET == audioMode
- || CallAudioStateCompat.ROUTE_SPEAKER == audioMode
- || CallAudioStateCompat.ROUTE_BLUETOOTH == audioMode
+ boolean screenOnImmediately = (CallAudioState.ROUTE_WIRED_HEADSET == audioMode
+ || CallAudioState.ROUTE_SPEAKER == audioMode
+ || CallAudioState.ROUTE_BLUETOOTH == audioMode
|| mIsHardKeyboardOpen);
// We do not keep the screen off when the user is outside in-call screen and we are
@@ -254,7 +254,7 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene
.add("offhook", mIsPhoneOffhook ? 1 : 0)
.add("hor", horizontal ? 1 : 0)
.add("ui", mUiShowing ? 1 : 0)
- .add("aud", CallAudioStateCompat.audioRouteToString(audioMode))
+ .add("aud", CallAudioState.audioRouteToString(audioMode))
.toString());
if (mIsPhoneOffhook && !screenOnImmediately) {
diff --git a/InCallUI/src/com/android/incallui/ringtone/InCallTonePlayer.java b/InCallUI/src/com/android/incallui/ringtone/InCallTonePlayer.java
index 6ef4e259a..d930a92fd 100644
--- a/InCallUI/src/com/android/incallui/ringtone/InCallTonePlayer.java
+++ b/InCallUI/src/com/android/incallui/ringtone/InCallTonePlayer.java
@@ -23,9 +23,9 @@ import android.media.AudioManager;
import android.media.ToneGenerator;
import android.provider.MediaStore.Audio;
import android.support.annotation.Nullable;
+import android.telecom.CallAudioState;
import com.android.contacts.common.testing.NeededForTesting;
-import com.android.dialer.compat.CallAudioStateCompat;
import com.android.incallui.AudioModeProvider;
import com.android.incallui.Log;
import com.android.incallui.async.PausableExecutor;
@@ -110,7 +110,7 @@ public class InCallTonePlayer {
}
private int getPlaybackStream() {
- if (mAudioModeProvider.getAudioMode() == CallAudioStateCompat.ROUTE_BLUETOOTH) {
+ if (mAudioModeProvider.getAudioMode() == CallAudioState.ROUTE_BLUETOOTH) {
// TODO (maxwelb): b/26932998 play through bluetooth
// return AudioManager.STREAM_BLUETOOTH_SCO;
}