diff options
Diffstat (limited to 'telecomm/java')
20 files changed, 428 insertions, 10 deletions
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index f149f24..721e4726 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -206,8 +206,32 @@ public final class Call { */ public static final int CAPABILITY_CAN_PAUSE_VIDEO = 0x00100000; + /** + * Call has voice privacy capability. + * @hide + */ + public static final int CAPABILITY_VOICE_PRIVACY = 0x00400000; + + /** + * Local device supports downgrading a video call to a voice-only call. + * @hide + */ + public static final int CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL = 0x00800000; + + /** + * Remote device supports downgrading a video call to a voice-only call. + * @hide + */ + public static final int CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE = 0x01000000; + + /** + * Add participant in an active or conference call option + * @hide + */ + public static final int CAPABILITY_ADD_PARTICIPANT = 0x02000000; + //****************************************************************************************** - // Next CAPABILITY value: 0x00004000 + // Next CAPABILITY value: 0x04000000 //****************************************************************************************** /** @@ -321,6 +345,12 @@ public final class Call { if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_TX)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_TX"); } + if (can(capabilities, CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL)) { + builder.append(" CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL"); + } + if (can(capabilities, CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE)) { + builder.append(" CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE"); + } if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL"); } @@ -333,6 +363,12 @@ public final class Call { if (can(capabilities, CAPABILITY_CAN_PAUSE_VIDEO)) { builder.append(" CAPABILITY_CAN_PAUSE_VIDEO"); } + if (can(capabilities, CAPABILITY_VOICE_PRIVACY)) { + builder.append(" CAPABILITY_VOICE_PRIVACY"); + } + if (can(capabilities, CAPABILITY_ADD_PARTICIPANT)) { + builder.append(" CAPABILITY_ADD_PARTICIPANT"); + } builder.append("]"); return builder.toString(); } @@ -682,6 +718,28 @@ public final class Call { private Details mDetails; /** + * when mIsActiveSub True indicates this call belongs to active subscription + * Calls belonging to active subscription are shown to user. + */ + private boolean mIsActiveSub = false; + + /** + * Set this call object as active subscription. + * @hide + */ + public void setActive() { + mIsActiveSub = true; + } + + /** + * return if this call object belongs to active subscription. + * @hide + */ + public boolean isActive() { + return mIsActiveSub; + } + + /** * Obtains the post-dial sequence remaining to be emitted by this {@code Call}, if any. * * @return The remaining post-dial sequence, or {@code null} if there is no post-dial sequence @@ -971,11 +1029,22 @@ public final class Call { } /** {@hide} */ - Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter) { + Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, boolean isActiveSub) { mPhone = phone; mTelecomCallId = telecomCallId; mInCallAdapter = inCallAdapter; mState = STATE_NEW; + mIsActiveSub = isActiveSub; + } + + /** {@hide} */ + Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, int state, + boolean isActiveSub) { + mPhone = phone; + mTelecomCallId = telecomCallId; + mInCallAdapter = inCallAdapter; + mState = state; + mIsActiveSub = isActiveSub; } /** {@hide} */ @@ -1028,9 +1097,10 @@ public final class Call { } int state = parcelableCall.getState(); - boolean stateChanged = mState != state; + boolean stateChanged = (mState != state) || (mIsActiveSub != parcelableCall.isActive()); if (stateChanged) { mState = state; + mIsActiveSub = parcelableCall.isActive(); } String parentId = parcelableCall.getParentCallId(); @@ -1107,6 +1177,11 @@ public final class Call { } } + /** {@hide} */ + final void onMergeFailed() { + fireStateChanged(mState); + } + private void fireStateChanged(final int newState) { for (CallbackRecord<Callback> record : mCallbackRecords) { final Call call = this; diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index 77fdb65..f6a6dcc 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -160,7 +160,10 @@ public abstract class Conference extends Conferenceable { * @hide */ public void removeCapability(int capability) { - mConnectionCapabilities &= ~capability; + int newCapabilities = mConnectionCapabilities; + newCapabilities &= ~capability; + + setConnectionCapabilities(newCapabilities); } /** @@ -170,7 +173,10 @@ public abstract class Conference extends Conferenceable { * @hide */ public void addCapability(int capability) { - mConnectionCapabilities |= capability; + int newCapabilities = mConnectionCapabilities; + newCapabilities |= capability; + + setConnectionCapabilities(newCapabilities); } /** @@ -222,6 +228,14 @@ public abstract class Conference extends Conferenceable { public void onSeparate(Connection connection) {} /** + * Invoked when the conference adds a participant to the conference call. + * + * @param participant The participant to be added with conference call. + * @hide + */ + public void onAddParticipant(String participant) {} + + /** * Invoked when the specified {@link Connection} should merged with the conference call. * * @param connection The {@code Connection} to merge. @@ -559,6 +573,7 @@ public abstract class Conference extends Conferenceable { private void setState(int newState) { if (newState != Connection.STATE_ACTIVE && + newState != Connection.STATE_DIALING && newState != Connection.STATE_HOLDING && newState != Connection.STATE_DISCONNECTED) { Log.w(this, "Unsupported state transition for Conference call.", diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 7b277c5..f025955 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -227,6 +227,13 @@ public abstract class Connection extends Conferenceable { public static final int CAPABILITY_CAN_PAUSE_VIDEO = 0x00100000; /** + * Add participant in an active or conference call option + * + * @hide + */ + public static final int CAPABILITY_ADD_PARTICIPANT = 0x02000000; + + /** * For a conference, indicates the conference will not have child connections. * <p> * An example of a conference with child connections is a GSM conference call, where the radio @@ -247,9 +254,26 @@ public abstract class Connection extends Conferenceable { * @hide */ public static final int CAPABILITY_CONFERENCE_HAS_NO_CHILDREN = 0x00200000; + /** + * Call has voice privacy capability. + * @hide + */ + public static final int CAPABILITY_VOICE_PRIVACY = 0x00400000; + + /** + * Local device supports voice telephony. + * @hide + */ + public static final int CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL = 0x00800000; + + /** + * Remote device supports voice telephony. + * @hide + */ + public static final int CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE = 0x01000000; //********************************************************************************************** - // Next CAPABILITY value: 0x00400000 + // Next CAPABILITY value: 0x04000000 //********************************************************************************************** /** @@ -275,6 +299,13 @@ public abstract class Connection extends Conferenceable { */ public static final String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT"; + /** + * Call extras key to pack/unpack call history info. + * The value for this key should be an ArrayList of Strings. + * @hide + */ + public static final String EXTRA_CALL_HISTORY_INFO = "EXTRA_CALL_HISTORY_INFO"; + // Flag controlling whether PII is emitted into the logs private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG); @@ -364,6 +395,12 @@ public abstract class Connection extends Conferenceable { if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL"); } + if (can(capabilities, CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL)) { + builder.append(" CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL"); + } + if (can(capabilities, CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE)) { + builder.append(" CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE"); + } if (can(capabilities, CAPABILITY_HIGH_DEF_AUDIO)) { builder.append(" CAPABILITY_HIGH_DEF_AUDIO"); } @@ -418,6 +455,7 @@ public abstract class Connection extends Conferenceable { public void onConferenceStarted() {} public void onConferenceMergeFailed(Connection c) {} public void onExtrasChanged(Connection c, Bundle extras) {} + public void onCdmaConnectionTimeReset(Connection c) {} } /** @@ -1582,6 +1620,16 @@ public abstract class Connection extends Conferenceable { } /** + *@hide + * Resets the cdma connection time. + */ + public final void resetCdmaConnectionTime() { + for (Listener l : mListeners) { + l.onCdmaConnectionTimeReset(this); + } + } + + /** * Returns the connections or conferences with which this connection can be conferenced. */ public final List<Conferenceable> getConferenceables() { @@ -1707,6 +1755,12 @@ public abstract class Connection extends Conferenceable { public void onStopDtmfTone() {} /** + * Notifies this to set local call hold. + * {@hide} + */ + public void setLocalCallHold(boolean lchState) {} + + /** * Notifies this Connection of a request to disconnect. */ public void onDisconnect() {} diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java index 6863214..2e8f8fd 100644 --- a/telecomm/java/android/telecom/ConnectionRequest.java +++ b/telecomm/java/android/telecom/ConnectionRequest.java @@ -28,7 +28,7 @@ import android.os.Parcelable; public final class ConnectionRequest implements Parcelable { // TODO: Token to limit recursive invocations - private final PhoneAccountHandle mAccountHandle; + private PhoneAccountHandle mAccountHandle; private final Uri mAddress; private final Bundle mExtras; private final int mVideoState; @@ -74,6 +74,9 @@ public final class ConnectionRequest implements Parcelable { */ public PhoneAccountHandle getAccountHandle() { return mAccountHandle; } + /** {@hide} */ + public void setAccountHandle(PhoneAccountHandle acc) { mAccountHandle = acc; } + /** * The handle (e.g., phone number) to which the {@link Connection} is to connect. */ diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 383e45b..1560af8 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -101,6 +101,9 @@ public abstract class ConnectionService extends Service { private static final int MSG_ANSWER_VIDEO = 17; private static final int MSG_MERGE_CONFERENCE = 18; private static final int MSG_SWAP_CONFERENCE = 19; + private static final int MSG_SET_LOCAL_HOLD = 20; + //Proprietary values starts after this. + private static final int MSG_ADD_PARTICIPANT_WITH_CONFERENCE = 30; private static Connection sNullConnection; @@ -199,6 +202,14 @@ public abstract class ConnectionService extends Service { } @Override + public void setLocalCallHold(String callId, boolean lchState) { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.argi1 = lchState ? 1 : 0; + mHandler.obtainMessage(MSG_SET_LOCAL_HOLD, args).sendToTarget(); + } + + @Override public void conference(String callId1, String callId2) { SomeArgs args = SomeArgs.obtain(); args.arg1 = callId1; @@ -212,6 +223,14 @@ public abstract class ConnectionService extends Service { } @Override + public void addParticipantWithConference(String callId, String participant) { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = participant; + mHandler.obtainMessage(MSG_ADD_PARTICIPANT_WITH_CONFERENCE, args).sendToTarget(); + } + + @Override public void mergeConference(String callId) { mHandler.obtainMessage(MSG_MERGE_CONFERENCE, callId).sendToTarget(); } @@ -322,6 +341,17 @@ public abstract class ConnectionService extends Service { case MSG_STOP_DTMF_TONE: stopDtmfTone((String) msg.obj); break; + case MSG_SET_LOCAL_HOLD: { + SomeArgs args = (SomeArgs) msg.obj; + try { + String callId = (String) args.arg1; + boolean lchStatus = (args.argi1 == 1); + setLocalCallHold(callId, lchStatus); + } finally { + args.recycle(); + } + break; + } case MSG_CONFERENCE: { SomeArgs args = (SomeArgs) msg.obj; try { @@ -336,6 +366,17 @@ public abstract class ConnectionService extends Service { case MSG_SPLIT_FROM_CONFERENCE: splitFromConference((String) msg.obj); break; + case MSG_ADD_PARTICIPANT_WITH_CONFERENCE: { + SomeArgs args = (SomeArgs) msg.obj; + try { + String callId = (String) args.arg1; + String participant = (String) args.arg2; + addParticipantWithConference(callId, participant); + } finally { + args.recycle(); + } + break; + } case MSG_MERGE_CONFERENCE: mergeConference((String) msg.obj); break; @@ -584,6 +625,12 @@ public abstract class ConnectionService extends Service { mAdapter.setExtras(id, extras); } } + + @Override + public void onCdmaConnectionTimeReset(Connection c) { + String id = mIdByConnection.get(c); + mAdapter.resetCdmaConnectionTime(id); + } }; /** {@inheritDoc} */ @@ -737,6 +784,11 @@ public abstract class ConnectionService extends Service { } } + private void setLocalCallHold(String callId, boolean lchStatus) { + Log.d(this, "setLocalCallHold %s", callId); + findConnectionForAction(callId, "setLocalCallHold").setLocalCallHold(lchStatus); + } + private void conference(String callId1, String callId2) { Log.d(this, "conference %s, %s", callId1, callId2); @@ -799,6 +851,17 @@ public abstract class ConnectionService extends Service { } } + private void addParticipantWithConference(String callId, String participant) { + Log.d(this, "ConnectionService addParticipantWithConference(%s, %s)", participant, callId); + Conference conference = findConferenceForAction(callId, "addParticipantWithConference"); + Connection connection = findConnectionForAction(callId, "addParticipantWithConnection"); + if (connection != getNullConnection()) { + onAddParticipant(connection, participant); + } else if (conference != getNullConference()) { + conference.onAddParticipant(participant); + } + } + private void mergeConference(String callId) { Log.d(this, "mergeConference(%s)", callId); Conference conference = findConferenceForAction(callId, "mergeConference"); @@ -1085,6 +1148,19 @@ public abstract class ConnectionService extends Service { public void onConference(Connection connection1, Connection connection2) {} /** + * Add participant with connection. Invoked when user has made a request to add + * participant with specified connection. In response, the participant should add with + * the connection. + * + * @param connection A connection where participant need to add. + * @param participant Address of participant which will be added. + * @return + * + * @hide + */ + public void onAddParticipant(Connection connection, String participant) {} + + /** * Indicates that a remote conference has been created for existing {@link RemoteConnection}s. * When this method is invoked, this {@link ConnectionService} should create its own * representation of the conference call and send it to telecom using {@link #addConference}. diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java index 4562514..30bd373 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java @@ -230,6 +230,18 @@ final class ConnectionServiceAdapter implements DeathRecipient { } /** + * Resets the cdma connection time. + */ + void resetCdmaConnectionTime(String callId) { + for (IConnectionServiceAdapter adapter : mAdapters) { + try { + adapter.resetCdmaConnectionTime(callId); + } catch (RemoteException e) { + } + } + } + + /** * Indicates that the call no longer exists. Can be used with either a call or a conference * call. * diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java index 293dc11..b8e7c22 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java @@ -419,6 +419,10 @@ final class ConnectionServiceAdapterServant { args.arg2 = extras; mHandler.obtainMessage(MSG_SET_EXTRAS, args).sendToTarget(); } + + @Override + public void resetCdmaConnectionTime(String callId) { + } }; public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) { diff --git a/telecomm/java/android/telecom/InCallAdapter.java b/telecomm/java/android/telecom/InCallAdapter.java index 0cf7212..7d0f5a7 100644 --- a/telecomm/java/android/telecom/InCallAdapter.java +++ b/telecomm/java/android/telecom/InCallAdapter.java @@ -273,4 +273,17 @@ public final class InCallAdapter { } catch (RemoteException ignored) { } } + + /** + * Instructs Telecomm to switch to other active subscripion + * + * @param subid switch to subscription denoted by subId + * {@hide} + */ + public void switchToOtherActiveSub(String subId) { + try { + mAdapter.switchToOtherActiveSub(subId); + } catch (RemoteException e) { + } + } } diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java index 19c613d..1b6a98f 100644 --- a/telecomm/java/android/telecom/InCallService.java +++ b/telecomm/java/android/telecom/InCallService.java @@ -73,6 +73,7 @@ public abstract class InCallService extends Service { private static final int MSG_ON_CALL_AUDIO_STATE_CHANGED = 5; private static final int MSG_BRING_TO_FOREGROUND = 6; private static final int MSG_ON_CAN_ADD_CALL_CHANGED = 7; + private static final int MSG_ON_MERGE_FAILED = 8; /** Default Handler used to consolidate binder method calls onto a single thread. */ private final Handler mHandler = new Handler(Looper.getMainLooper()) { @@ -91,6 +92,9 @@ public abstract class InCallService extends Service { case MSG_ADD_CALL: mPhone.internalAddCall((ParcelableCall) msg.obj); break; + case MSG_ON_MERGE_FAILED: + mPhone.onMergeFailed((ParcelableCall) msg.obj); + break; case MSG_UPDATE_CALL: mPhone.internalUpdateCall((ParcelableCall) msg.obj); break; @@ -156,6 +160,11 @@ public abstract class InCallService extends Service { } @Override + public void onMergeFailed(ParcelableCall call) { + mHandler.obtainMessage(MSG_ON_MERGE_FAILED, call).sendToTarget(); + } + + @Override public void bringToForeground(boolean showDialpad) { mHandler.obtainMessage(MSG_BRING_TO_FOREGROUND, showDialpad ? 1 : 0, 0).sendToTarget(); } @@ -301,6 +310,18 @@ public abstract class InCallService extends Service { } /** + * Instructs Telecomm to switch to other active subscripion + * + * @param subId switch to this subscription + * @hide + */ + public void switchToOtherActiveSub(String subId) { + if (mPhone != null) { + mPhone.switchToOtherActiveSub(subId); + } + } + + /** * Sets the audio route (speaker, bluetooth, etc...). When this request is honored, there will * be change to the {@link #getCallAudioState()}. * diff --git a/telecomm/java/android/telecom/ParcelableCall.java b/telecomm/java/android/telecom/ParcelableCall.java index 8cf4aeb..20a4455 100644 --- a/telecomm/java/android/telecom/ParcelableCall.java +++ b/telecomm/java/android/telecom/ParcelableCall.java @@ -56,6 +56,7 @@ public final class ParcelableCall implements Parcelable { private final List<String> mConferenceableCallIds; private final Bundle mIntentExtras; private final Bundle mExtras; + private final boolean mIsActiveSub; public ParcelableCall( String id, @@ -79,7 +80,8 @@ public final class ParcelableCall implements Parcelable { int videoState, List<String> conferenceableCallIds, Bundle intentExtras, - Bundle extras) { + Bundle extras, + boolean isActiveSub) { mId = id; mState = state; mDisconnectCause = disconnectCause; @@ -102,6 +104,7 @@ public final class ParcelableCall implements Parcelable { mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds); mIntentExtras = intentExtras; mExtras = extras; + mIsActiveSub = isActiveSub; } /** The unique ID of the call. */ @@ -259,6 +262,13 @@ public final class ParcelableCall implements Parcelable { return mIsVideoCallProviderChanged; } + /** + * return if this call object belongs to active subscription. + */ + public boolean isActive() { + return mIsActiveSub; + } + /** Responsible for creating ParcelableCall objects for deserialized Parcels. */ public static final Parcelable.Creator<ParcelableCall> CREATOR = new Parcelable.Creator<ParcelableCall> () { @@ -291,6 +301,7 @@ public final class ParcelableCall implements Parcelable { source.readList(conferenceableCallIds, classLoader); Bundle intentExtras = source.readBundle(classLoader); Bundle extras = source.readBundle(classLoader); + boolean isActiveSub = (source.readInt() == 1) ? true : false; return new ParcelableCall( id, state, @@ -313,7 +324,8 @@ public final class ParcelableCall implements Parcelable { videoState, conferenceableCallIds, intentExtras, - extras); + extras, + isActiveSub); } @Override @@ -354,6 +366,7 @@ public final class ParcelableCall implements Parcelable { destination.writeList(mConferenceableCallIds); destination.writeBundle(mIntentExtras); destination.writeBundle(mExtras); + destination.writeInt(mIsActiveSub ? 1 : 0); } @Override diff --git a/telecomm/java/android/telecom/Phone.java b/telecomm/java/android/telecom/Phone.java index 47154da..0fd124d 100644 --- a/telecomm/java/android/telecom/Phone.java +++ b/telecomm/java/android/telecom/Phone.java @@ -123,7 +123,7 @@ public final class Phone { final void internalAddCall(ParcelableCall parcelableCall) { Call call = new Call(this, parcelableCall.getId(), mInCallAdapter, - parcelableCall.getState()); + parcelableCall.getState(), parcelableCall.isActive()); mCallByTelecomCallId.put(parcelableCall.getId(), call); mCalls.add(call); checkCallTree(parcelableCall); @@ -179,6 +179,12 @@ public final class Phone { } } + final void onMergeFailed(ParcelableCall parcelableCall) { + Call call = mCallByTelecomCallId.get(parcelableCall.getId()); + if (call != null) { + call.onMergeFailed(); + } + } /** * Called to destroy the phone and cleanup any lingering calls. */ @@ -280,6 +286,16 @@ public final class Phone { } /** + * Instructs Telecomm to switch to other active subscripion + * + * @param subId switch to this subscription + * {@hide} + */ + public void switchToOtherActiveSub(String subId) { + mInCallAdapter.switchToOtherActiveSub(subId); + } + + /** * Obtains the current phone call audio state of the {@code Phone}. * * @return An object encapsulating the audio state. diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index cdb0bf2..f890f4d 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -34,6 +34,7 @@ import android.text.TextUtils; import java.lang.String; import java.util.ArrayList; +import java.util.BitSet; import java.util.Collections; import java.util.List; import java.util.MissingResourceException; @@ -366,6 +367,43 @@ public final class PhoneAccount implements Parcelable { } /** + * Contains information related to + * LCH and ACTIVE. + */ + private BitSet callsStatus = new BitSet(); + + /** + * {@hide} + */ + public static final int LCH = 1; + + /** + * {@hide} + */ + public static final int ACTIVE = 2; + + /** + * {@hide} + */ + public void setBit(int bit) { + callsStatus.set(bit); + } + + /** + * {@hide} + */ + public void unSetBit(int bit) { + callsStatus.set(bit, false); + } + + /** + * {@hide} + */ + public boolean isSet(int bit) { + return callsStatus.get(bit); + } + + /** * Returns a builder initialized with the current {@link PhoneAccount} instance. * * @return The builder. diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java index dc0de0c..372d736 100644 --- a/telecomm/java/android/telecom/RemoteConnectionService.java +++ b/telecomm/java/android/telecom/RemoteConnectionService.java @@ -330,6 +330,10 @@ final class RemoteConnectionService { .setExtras(extras); } } + + @Override + public void resetCdmaConnectionTime(String callId) { + } }; private final ConnectionServiceAdapterServant mServant = diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 067e734..673adb2 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -22,6 +22,7 @@ import android.net.Uri; import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; +import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; @@ -1039,6 +1040,37 @@ public class TelecomManager { } /** + * Returns current active subscription. + * Active subscription is the one from which calls are displayed to user when there are actve + * calls on both subscriptions. + * @hide + */ + public int getActiveSubscription() { + try { + if (isServiceConnected()) { + return getTelecomService().getActiveSubscription(); + } + } catch (RemoteException e) { + Log.e(TAG, "RemoteException attempting to get the active subsription.", e); + } + return SubscriptionManager.INVALID_SUBSCRIPTION_ID; + } + + /** + * switches to other active subscription. + * @hide + */ + public void switchToOtherActiveSub(int subId) { + try { + if (isServiceConnected()) { + getTelecomService().switchToOtherActiveSub(subId); + } + } catch (RemoteException e) { + Log.e(TAG, "RemoteException attempting to switchToOtherActiveSub.", e); + } + } + + /** * Registers a new incoming call. A {@link ConnectionService} should invoke this method when it * has an incoming call. The specified {@link PhoneAccountHandle} must have been registered * with {@link #registerPhoneAccount}. Once invoked, this method will cause the system to bind diff --git a/telecomm/java/android/telecom/VideoCallImpl.java b/telecomm/java/android/telecom/VideoCallImpl.java index c8072d1..93484cd 100644 --- a/telecomm/java/android/telecom/VideoCallImpl.java +++ b/telecomm/java/android/telecom/VideoCallImpl.java @@ -57,13 +57,20 @@ public class VideoCallImpl extends VideoCall { private final class VideoCallListenerBinder extends IVideoCallback.Stub { @Override public void receiveSessionModifyRequest(VideoProfile videoProfile) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_RECEIVE_SESSION_MODIFY_REQUEST, videoProfile).sendToTarget(); + } @Override public void receiveSessionModifyResponse(int status, VideoProfile requestProfile, VideoProfile responseProfile) { + if (mHandler == null) { + return; + } SomeArgs args = SomeArgs.obtain(); args.arg1 = status; args.arg2 = requestProfile; @@ -74,12 +81,18 @@ public class VideoCallImpl extends VideoCall { @Override public void handleCallSessionEvent(int event) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_HANDLE_CALL_SESSION_EVENT, event) .sendToTarget(); } @Override public void changePeerDimensions(int width, int height) { + if (mHandler == null) { + return; + } SomeArgs args = SomeArgs.obtain(); args.arg1 = width; args.arg2 = height; @@ -88,18 +101,27 @@ public class VideoCallImpl extends VideoCall { @Override public void changeVideoQuality(int videoQuality) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_CHANGE_VIDEO_QUALITY, videoQuality, 0) .sendToTarget(); } @Override public void changeCallDataUsage(long dataUsage) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_CHANGE_CALL_DATA_USAGE, dataUsage) .sendToTarget(); } @Override public void changeCameraCapabilities(VideoProfile.CameraCapabilities cameraCapabilities) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_CHANGE_CAMERA_CAPABILITIES, cameraCapabilities).sendToTarget(); } diff --git a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl index c2e8530..23d70d5 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl @@ -71,4 +71,8 @@ oneway interface IConnectionService { void swapConference(String conferenceCallId); void onPostDialContinue(String callId, boolean proceed); + + void setLocalCallHold(String callId, boolean lchState); + + void addParticipantWithConference(String callId, String recipients); } diff --git a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl index 7647444..ef4915c 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl @@ -86,4 +86,6 @@ oneway interface IConnectionServiceAdapter { void addExistingConnection(String callId, in ParcelableConnection connection); void setExtras(String callId, in Bundle extras); + + void resetCdmaConnectionTime(String callId); } diff --git a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl index 863fff2..ee51efa 100644 --- a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl +++ b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl @@ -60,4 +60,6 @@ oneway interface IInCallAdapter { void turnOnProximitySensor(); void turnOffProximitySensor(boolean screenOnImmediately); + + void switchToOtherActiveSub(String subId); } diff --git a/telecomm/java/com/android/internal/telecom/IInCallService.aidl b/telecomm/java/com/android/internal/telecom/IInCallService.aidl index ded47d5..f4ba9a0 100644 --- a/telecomm/java/com/android/internal/telecom/IInCallService.aidl +++ b/telecomm/java/com/android/internal/telecom/IInCallService.aidl @@ -45,4 +45,6 @@ oneway interface IInCallService { void bringToForeground(boolean showDialpad); void onCanAddCallChanged(boolean canAddCall); + + void onMergeFailed(in ParcelableCall call); } diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl index 2e07759..cad8c5d 100644 --- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl +++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl @@ -232,4 +232,14 @@ interface ITelecomService { * @see TelecomServiceImpl#setDefaultDialer */ boolean setDefaultDialer(in String packageName); + + /** + * @see TelecommManager#getActiveSubscription + */ + int getActiveSubscription(); + + /** + * @see TelecommManager#switchToOtherActiveSub + */ + void switchToOtherActiveSub(int subId); } |