Methods Summary |
---|
public final void | addListener(android.telecom.Phone$Listener listener)Adds a listener to this {@code Phone}.
mListeners.add(listener);
|
public final boolean | canAddCall()Returns if the {@code Phone} can support additional calls.
return mCanAddCall;
|
private void | checkCallTree(ParcelableCall parcelableCall)
if (parcelableCall.getParentCallId() != null &&
!mCallByTelecomCallId.containsKey(parcelableCall.getParentCallId())) {
Log.wtf(this, "ParcelableCall %s has nonexistent parent %s",
parcelableCall.getId(), parcelableCall.getParentCallId());
}
if (parcelableCall.getChildCallIds() != null) {
for (int i = 0; i < parcelableCall.getChildCallIds().size(); i++) {
if (!mCallByTelecomCallId.containsKey(parcelableCall.getChildCallIds().get(i))) {
Log.wtf(this, "ParcelableCall %s has nonexistent child %s",
parcelableCall.getId(), parcelableCall.getChildCallIds().get(i));
}
}
}
|
final void | destroy()Called to destroy the phone and cleanup any lingering calls.
for (Call call : mCalls) {
if (call.getState() != Call.STATE_DISCONNECTED) {
call.internalSetDisconnected();
}
}
|
private void | fireAudioStateChanged(AudioState audioState)
for (Listener listener : mListeners) {
listener.onAudioStateChanged(this, audioState);
}
|
private void | fireBringToForeground(boolean showDialpad)
for (Listener listener : mListeners) {
listener.onBringToForeground(this, showDialpad);
}
|
private void | fireCallAdded(Call call)
for (Listener listener : mListeners) {
listener.onCallAdded(this, call);
}
|
private void | fireCallRemoved(Call call)
for (Listener listener : mListeners) {
listener.onCallRemoved(this, call);
}
|
private void | fireCanAddCallChanged(boolean canAddCall)
for (Listener listener : mListeners) {
listener.onCanAddCallChanged(this, canAddCall);
}
|
public final AudioState | getAudioState()Obtains the current phone call audio state of the {@code Phone}.
return mAudioState;
|
public final java.util.List | getCalls()Obtains the current list of {@code Call}s to be displayed by this in-call experience.
return mUnmodifiableCalls;
|
final void | internalAddCall(ParcelableCall parcelableCall){@hide}
Call call = new Call(this, parcelableCall.getId(), mInCallAdapter);
mCallByTelecomCallId.put(parcelableCall.getId(), call);
mCalls.add(call);
checkCallTree(parcelableCall);
call.internalUpdate(parcelableCall, mCallByTelecomCallId);
fireCallAdded(call);
|
final void | internalAudioStateChanged(AudioState audioState){@hide}
if (!Objects.equals(mAudioState, audioState)) {
mAudioState = audioState;
fireAudioStateChanged(audioState);
}
|
final void | internalBringToForeground(boolean showDialpad){@hide}
fireBringToForeground(showDialpad);
|
final Call | internalGetCallByTelecomId(java.lang.String telecomId){@hide}
return mCallByTelecomCallId.get(telecomId);
|
final void | internalRemoveCall(Call call){@hide}
mCallByTelecomCallId.remove(call.internalGetCallId());
mCalls.remove(call);
fireCallRemoved(call);
|
final void | internalSetCanAddCall(boolean canAddCall){@hide}
if (mCanAddCall != canAddCall) {
mCanAddCall = canAddCall;
fireCanAddCallChanged(canAddCall);
}
|
final void | internalSetPostDialWait(java.lang.String telecomId, java.lang.String remaining){@hide}
Call call = mCallByTelecomCallId.get(telecomId);
if (call != null) {
call.internalSetPostDialWait(remaining);
}
|
final void | internalUpdateCall(ParcelableCall parcelableCall){@hide}
Call call = mCallByTelecomCallId.get(parcelableCall.getId());
if (call != null) {
checkCallTree(parcelableCall);
call.internalUpdate(parcelableCall, mCallByTelecomCallId);
}
|
public final void | removeListener(android.telecom.Phone$Listener listener)Removes a listener from this {@code Phone}.
if (listener != null) {
mListeners.remove(listener);
}
|
public final void | setAudioRoute(int route)Sets the audio route (speaker, bluetooth, etc...). When this request is honored, there will
be change to the {@link #getAudioState()}.
mInCallAdapter.setAudioRoute(route);
|
public final void | setMuted(boolean state)Sets the microphone mute state. When this request is honored, there will be change to
the {@link #getAudioState()}.
mInCallAdapter.mute(state);
|
public final void | setProximitySensorOff(boolean screenOnImmediately)Turns the proximity sensor off. When this request is made, the proximity sensor will
become inactive, and no longer affect the touch screen and display. This operation is a
no-op on devices that do not have a proximity sensor.
mInCallAdapter.turnProximitySensorOff(screenOnImmediately);
|
public final void | setProximitySensorOn()Turns the proximity sensor on. When this request is made, the proximity sensor will
become active, and the touch screen and display will be turned off when the user's face
is detected to be in close proximity to the screen. This operation is a no-op on devices
that do not have a proximity sensor.
mInCallAdapter.turnProximitySensorOn();
|