diff options
Diffstat (limited to 'telecomm/java/android')
-rw-r--r-- | telecomm/java/android/telecomm/Call.java | 4 | ||||
-rw-r--r-- | telecomm/java/android/telecomm/InCallAdapter.java | 4 | ||||
-rw-r--r-- | telecomm/java/android/telecomm/InCallService.java | 34 | ||||
-rw-r--r-- | telecomm/java/android/telecomm/PhoneAccount.java | 2 | ||||
-rw-r--r-- | telecomm/java/android/telecomm/PhoneAccountMetadata.java | 16 | ||||
-rw-r--r-- | telecomm/java/android/telecomm/TelecommConstants.java | 213 | ||||
-rw-r--r-- | telecomm/java/android/telecomm/TelecommManager.java | 202 |
7 files changed, 232 insertions, 243 deletions
diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java index 1398ad3..4cb75be 100644 --- a/telecomm/java/android/telecomm/Call.java +++ b/telecomm/java/android/telecomm/Call.java @@ -431,10 +431,10 @@ public final class Call { * While these tones are playing, this {@code Call} will notify listeners via * {@link Listener#onPostDial(Call, String)}. * - * If the DTMF string contains a {@link TelecommConstants#DTMF_CHARACTER_PAUSE} symbol, this + * If the DTMF string contains a {@link TelecommManager#DTMF_CHARACTER_PAUSE} symbol, this * {@code Call} will temporarily pause playing the tones for a pre-defined period of time. * - * If the DTMF string contains a {@link TelecommConstants#DTMF_CHARACTER_WAIT} symbol, this + * If the DTMF string contains a {@link TelecommManager#DTMF_CHARACTER_WAIT} symbol, this * {@code Call} will pause playing the tones and notify listeners via * {@link Listener#onPostDialWait(Call, String)}. At this point, the in-call app * should display to the user an indication of this state and an affordance to continue diff --git a/telecomm/java/android/telecomm/InCallAdapter.java b/telecomm/java/android/telecomm/InCallAdapter.java index c872c58..5153cf4 100644 --- a/telecomm/java/android/telecomm/InCallAdapter.java +++ b/telecomm/java/android/telecomm/InCallAdapter.java @@ -170,10 +170,10 @@ public final class InCallAdapter { * While these tones are playing, Telecomm will notify the {@link InCallService} that the call * is in the post dial state. * - * If the DTMF string contains a {@link TelecommConstants#DTMF_CHARACTER_PAUSE} symbol, Telecomm + * If the DTMF string contains a {@link TelecommManager#DTMF_CHARACTER_PAUSE} symbol, Telecomm * will temporarily pause playing the tones for a pre-defined period of time. * - * If the DTMF string contains a {@link TelecommConstants#DTMF_CHARACTER_WAIT} symbol, Telecomm + * If the DTMF string contains a {@link TelecommManager#DTMF_CHARACTER_WAIT} symbol, Telecomm * will pause playing the tones and notify the {@link InCallService} that the call is in the * post dial wait state. When the user decides to continue the postdial sequence, the * {@link InCallService} should invoke the {@link #postDialContinue(String,boolean)} method. diff --git a/telecomm/java/android/telecomm/InCallService.java b/telecomm/java/android/telecomm/InCallService.java index 367ef80..07f7cfd 100644 --- a/telecomm/java/android/telecomm/InCallService.java +++ b/telecomm/java/android/telecomm/InCallService.java @@ -17,6 +17,8 @@ package android.telecomm; import android.app.PendingIntent; +import android.app.Service; +import android.content.Intent; import android.os.Handler; import android.os.IBinder; import android.os.Looper; @@ -28,12 +30,11 @@ import com.android.internal.telecomm.IInCallService; /** * This service is implemented by any app that wishes to provide the user-interface for managing - * phone calls. Telecomm binds to this service while there exists a live (active or incoming) - * call, and uses it to notify the in-call app of any live and and recently disconnected calls. - * + * phone calls. Telecomm binds to this service while there exists a live (active or incoming) call, + * and uses it to notify the in-call app of any live and and recently disconnected calls. * TODO(santoscordon): What happens if two or more apps on a given device implement this interface? */ -public abstract class InCallService { +public abstract class InCallService extends Service { private static final int MSG_SET_IN_CALL_ADAPTER = 1; private static final int MSG_ADD_CALL = 2; private static final int MSG_UPDATE_CALL = 3; @@ -103,19 +104,16 @@ public abstract class InCallService { /** Manages the binder calls so that the implementor does not need to deal with it. */ private final class InCallServiceBinder extends IInCallService.Stub { - /** {@inheritDoc} */ @Override public void setInCallAdapter(IInCallAdapter inCallAdapter) { mHandler.obtainMessage(MSG_SET_IN_CALL_ADAPTER, inCallAdapter).sendToTarget(); } - /** {@inheritDoc} */ @Override public void addCall(InCallCall call) { mHandler.obtainMessage(MSG_ADD_CALL, call).sendToTarget(); } - /** {@inheritDoc} */ @Override public void updateCall(InCallCall call) { mHandler.obtainMessage(MSG_UPDATE_CALL, call).sendToTarget(); @@ -137,19 +135,16 @@ public abstract class InCallService { mHandler.obtainMessage(MSG_SET_POST_DIAL_WAIT, args).sendToTarget(); } - /** {@inheritDoc} */ @Override public void onAudioStateChanged(CallAudioState audioState) { mHandler.obtainMessage(MSG_ON_AUDIO_STATE_CHANGED, audioState).sendToTarget(); } - /** {@inheritDoc} */ @Override public void bringToForeground(boolean showDialpad) { mHandler.obtainMessage(MSG_BRING_TO_FOREGROUND, showDialpad ? 1 : 0, 0).sendToTarget(); } - /** {@inheritDoc} */ @Override public void startActivity(String callId, PendingIntent intent) { SomeArgs args = SomeArgs.obtain(); @@ -161,9 +156,11 @@ public abstract class InCallService { private Phone mPhone; - protected InCallService() {} + public InCallService() { + } - public final IBinder getBinder() { + @Override + public IBinder onBind(Intent intent) { return new InCallServiceBinder(); } @@ -171,7 +168,8 @@ public abstract class InCallService { * Obtain the {@code Phone} associated with this {@code InCallService}. * * @return The {@code Phone} object associated with this {@code InCallService}, or {@code null} - * if the {@code InCallService} is not in a state where it has an associated {@code Phone}. + * if the {@code InCallService} is not in a state where it has an associated + * {@code Phone}. */ public Phone getPhone() { return mPhone; @@ -180,12 +178,13 @@ public abstract class InCallService { /** * Invoked when the {@code Phone} has been created. This is a signal to the in-call experience * to start displaying in-call information to the user. Each instance of {@code InCallService} - * will have only one {@code Phone}, and this method will be called exactly once in the - * lifetime of the {@code InCallService}. + * will have only one {@code Phone}, and this method will be called exactly once in the lifetime + * of the {@code InCallService}. * * @param phone The {@code Phone} object associated with this {@code InCallService}. */ - public void onPhoneCreated(Phone phone) { } + public void onPhoneCreated(Phone phone) { + } /** * Invoked when a {@code Phone} has been destroyed. This is a signal to the in-call experience @@ -195,5 +194,6 @@ public abstract class InCallService { * * @param phone The {@code Phone} object associated with this {@code InCallService}. */ - public void onPhoneDestroyed(Phone phone) { } + public void onPhoneDestroyed(Phone phone) { + } } diff --git a/telecomm/java/android/telecomm/PhoneAccount.java b/telecomm/java/android/telecomm/PhoneAccount.java index edfd846..4d7638b 100644 --- a/telecomm/java/android/telecomm/PhoneAccount.java +++ b/telecomm/java/android/telecomm/PhoneAccount.java @@ -73,8 +73,6 @@ public class PhoneAccount implements Parcelable { return new StringBuilder().append(mComponentName) .append(", ") .append(mId) - .append(", ") - .append(", ") .toString(); } diff --git a/telecomm/java/android/telecomm/PhoneAccountMetadata.java b/telecomm/java/android/telecomm/PhoneAccountMetadata.java index 8993170..c52a6fc 100644 --- a/telecomm/java/android/telecomm/PhoneAccountMetadata.java +++ b/telecomm/java/android/telecomm/PhoneAccountMetadata.java @@ -66,6 +66,7 @@ public class PhoneAccountMetadata implements Parcelable { private final PhoneAccount mAccount; private final Uri mHandle; + private final String mSubscriptionNumber; private final int mCapabilities; private final int mIconResId; private final String mLabel; @@ -75,6 +76,7 @@ public class PhoneAccountMetadata implements Parcelable { public PhoneAccountMetadata( PhoneAccount account, Uri handle, + String subscriptionNumber, int capabilities, int iconResId, String label, @@ -82,6 +84,7 @@ public class PhoneAccountMetadata implements Parcelable { boolean supportsVideoCalling) { mAccount = account; mHandle = handle; + mSubscriptionNumber = subscriptionNumber; mCapabilities = capabilities; mIconResId = iconResId; mLabel = label; @@ -111,6 +114,17 @@ public class PhoneAccountMetadata implements Parcelable { } /** + * The subscription number associated with the underlying transport. This may differ from the + * {@link #getHandle()} number; for example, if the number used to talk to the network is not + * the same number that will be on the remote party's caller ID display. + * + * @return The subscription number, suitable for display to the user. + */ + public String getSubscriptionNumber() { + return mSubscriptionNumber; + } + + /** * The capabilities of this {@code PhoneAccount}. * * @return A bit field of flags describing this {@code PhoneAccount}'s capabilities. @@ -195,6 +209,7 @@ public class PhoneAccountMetadata implements Parcelable { public void writeToParcel(Parcel out, int flags) { out.writeParcelable(mAccount, 0); out.writeParcelable(mHandle, 0); + out.writeString(mSubscriptionNumber); out.writeInt(mCapabilities); out.writeInt(mIconResId); out.writeString(mLabel); @@ -218,6 +233,7 @@ public class PhoneAccountMetadata implements Parcelable { private PhoneAccountMetadata(Parcel in) { mAccount = in.readParcelable(getClass().getClassLoader()); mHandle = in.readParcelable(getClass().getClassLoader()); + mSubscriptionNumber = in.readString(); mCapabilities = in.readInt(); mIconResId = in.readInt(); mLabel = in.readString(); diff --git a/telecomm/java/android/telecomm/TelecommConstants.java b/telecomm/java/android/telecomm/TelecommConstants.java deleted file mode 100644 index 0ede387..0000000 --- a/telecomm/java/android/telecomm/TelecommConstants.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.telecomm; - -import android.content.ComponentName; -import android.content.Intent; -import android.os.Bundle; -import android.telephony.TelephonyManager; - -/** - * Defines constants for use with the Telecomm system. - */ -public final class TelecommConstants { - /** - * <p>Activity action: Starts the UI for handing an incoming call. This intent starts the - * in-call UI by notifying the Telecomm system that an incoming call exists for a specific call - * service (see {@link android.telecomm.ConnectionService}). Telecomm reads the Intent extras - * to find and bind to the appropriate {@link android.telecomm.ConnectionService} which - * Telecomm will ultimately use to control and get information about the call.</p> - * - * <p>Input: get*Extra field {@link #EXTRA_PHONE_ACCOUNT} contains the component name of the - * {@link android.telecomm.ConnectionService} that Telecomm should bind to. Telecomm will then - * ask the connection service for more information about the call prior to showing any UI. - * - * TODO(santoscordon): Needs permissions. - * TODO(santoscordon): Consider moving this into a simple method call on a system service. - */ - public static final String ACTION_INCOMING_CALL = "android.intent.action.INCOMING_CALL"; - - /** - * The service action used to bind to {@link ConnectionService} implementations. - */ - public static final String ACTION_CONNECTION_SERVICE = ConnectionService.class.getName(); - - /** - * The {@link Intent} action used to configure a {@link ConnectionService}. - */ - public static final String ACTION_CONNECTION_SERVICE_CONFIGURE = - "android.intent.action.CONNECTION_SERVICE_CONFIGURE"; - - /** - * Optional extra for {@link Intent#ACTION_CALL} containing a boolean that determines whether - * the speakerphone should be automatically turned on for an outgoing call. - */ - public static final String EXTRA_START_CALL_WITH_SPEAKERPHONE = - "android.intent.extra.START_CALL_WITH_SPEAKERPHONE"; - - /** - * Optional extra for {@link Intent#ACTION_CALL} containing an integer that determines the - * desired video state for an outgoing call. - * Valid options: {@link VideoCallProfile#VIDEO_STATE_AUDIO_ONLY}, - * {@link VideoCallProfile#VIDEO_STATE_BIDIRECTIONAL}, - * {@link VideoCallProfile#VIDEO_STATE_RX_ENABLED}, - * {@link VideoCallProfile#VIDEO_STATE_TX_ENABLED}. - */ - public static final String EXTRA_START_CALL_WITH_VIDEO_STATE = - "android.intent.extra.START_CALL_WITH_VIDEO_STATE"; - - /** - * The extra used with an {@link android.content.Intent#ACTION_CALL}, - * {@link #ACTION_INCOMING_CALL}, {@link android.content.Intent#ACTION_DIAL} {@code Intent} to - * specify a {@link PhoneAccount} to use when making the call. - * - * <p class="note"> - * Retrieve with - * {@link android.content.Intent#getParcelableExtra(String)}. - */ - public static final String EXTRA_PHONE_ACCOUNT = "android.intent.extra.PHONE_ACCOUNT"; - - /** - * Optional extra for {@link #ACTION_INCOMING_CALL} containing a {@link Bundle} which contains - * metadata about the call. This {@link Bundle} will be returned to the - * {@link ConnectionService}. - */ - public static final String EXTRA_INCOMING_CALL_EXTRAS = - "android.intent.extra.INCOMING_CALL_EXTRAS"; - - /** - * Optional extra for {@link TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the - * disconnect code. - */ - public static final String EXTRA_CALL_DISCONNECT_CAUSE = - "android.telecomm.extra.CALL_DISCONNECT_CAUSE"; - - /** - * Optional extra for {@link TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the - * disconnect message. - */ - public static final String EXTRA_CALL_DISCONNECT_MESSAGE = - "android.telecomm.extra.CALL_DISCONNECT_MESSAGE"; - - /** - * Optional extra for {@link TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the - * component name of the associated connection service. - */ - public static final String EXTRA_CONNECTION_SERVICE = - "android.telecomm.extra.CONNECTION_SERVICE"; - - /** - * The number which emergency services will use to return calls, if necessary. The in-call UI - * will take care of displaying this to the user. - * <p> - * Note that this should only be populated for emergency numbers, and if the number emergency - * services will see is different than the user's known phone number. - */ - public static final String EXTRA_EMERGENCY_CALL_BACK_NUMBER = - "android.telecomm.extra.EMERGENCY_CALL_BACK_NUMBER"; - - /** - * The dual tone multi-frequency signaling character sent to indicate the dialing system should - * pause for a predefined period. - */ - public static final char DTMF_CHARACTER_PAUSE = ','; - - /** - * The dual-tone multi-frequency signaling character sent to indicate the dialing system should - * wait for user confirmation before proceeding. - */ - public static final char DTMF_CHARACTER_WAIT = ';'; - - /** - * TTY (teletypewriter) mode is off. - * - * @hide - */ - public static final int TTY_MODE_OFF = 0; - - /** - * TTY (teletypewriter) mode is on. The speaker is off and the microphone is muted. The user - * will communicate with the remote party by sending and receiving text messages. - * - * @hide - */ - public static final int TTY_MODE_FULL = 1; - - /** - * TTY (teletypewriter) mode is in hearing carryover mode (HCO). The microphone is muted but the - * speaker is on. The user will communicate with the remote party by sending text messages and - * hearing an audible reply. - * - * @hide - */ - public static final int TTY_MODE_HCO = 2; - - /** - * TTY (teletypewriter) mode is in voice carryover mode (VCO). The speaker is off but the - * microphone is still on. User will communicate with the remote party by speaking and receiving - * text message replies. - * - * @hide - */ - public static final int TTY_MODE_VCO = 3; - - /** - * Broadcast intent action indicating that the current TTY mode has changed. An intent extra - * provides this state as an int. - * @see #EXTRA_CURRENT_TTY_MODE - * - * @hide - */ - public static final String ACTION_CURRENT_TTY_MODE_CHANGED = - "android.telecomm.intent.action.CURRENT_TTY_MODE_CHANGED"; - - /** - * The lookup key for an int that indicates the current TTY mode. - * Valid modes are: - * - {@link #TTY_MODE_OFF} - * - {@link #TTY_MODE_FULL} - * - {@link #TTY_MODE_HCO} - * - {@link #TTY_MODE_VCO} - * - * @hide - */ - public static final String EXTRA_CURRENT_TTY_MODE = - "android.telecomm.intent.extra.CURRENT_TTY_MODE"; - - /** - * Broadcast intent action indicating that the TTY preferred operating mode - * has changed. An intent extra provides the new mode as an int. - * @see #EXTRA_TTY_PREFERRED_MODE - * - * @hide - */ - public static final String ACTION_TTY_PREFERRED_MODE_CHANGED = - "android.telecomm.intent.action.TTY_PREFERRED_MODE_CHANGED"; - - /** - * The lookup key for an int that indicates preferred TTY mode. - * Valid modes are: - * - {@link #TTY_MODE_OFF} - * - {@link #TTY_MODE_FULL} - * - {@link #TTY_MODE_HCO} - * - {@link #TTY_MODE_VCO} - * - * @hide - */ - public static final String EXTRA_TTY_PREFERRED_MODE = - "android.telecomm.intent.extra.TTY_PREFERRED"; -} diff --git a/telecomm/java/android/telecomm/TelecommManager.java b/telecomm/java/android/telecomm/TelecommManager.java index 89fcdb5..d1526ca 100644 --- a/telecomm/java/android/telecomm/TelecommManager.java +++ b/telecomm/java/android/telecomm/TelecommManager.java @@ -31,7 +31,195 @@ import java.util.List; */ public class TelecommManager { + /** + * <p>Activity action: Starts the UI for handing an incoming call. This intent starts the + * in-call UI by notifying the Telecomm system that an incoming call exists for a specific call + * service (see {@link ConnectionService}). Telecomm reads the Intent extras + * to find and bind to the appropriate {@link ConnectionService} which + * Telecomm will ultimately use to control and get information about the call.</p> + * + * <p>Input: get*Extra field {@link #EXTRA_PHONE_ACCOUNT} contains the component name of the + * {@link ConnectionService} that Telecomm should bind to. Telecomm will then + * ask the connection service for more information about the call prior to showing any UI. + * + * TODO(santoscordon): Needs permissions. + * TODO(santoscordon): Consider moving this into a simple method call on a system service. + */ + public static final String ACTION_INCOMING_CALL = "android.intent.action.INCOMING_CALL"; + + /** + * The service action used to bind to {@link android.telecomm.ConnectionService} implementations. + */ + public static final String ACTION_CONNECTION_SERVICE = ConnectionService.class.getName(); + + /** + * The {@link android.content.Intent} action used to configure a {@link android.telecomm.ConnectionService}. + */ + public static final String ACTION_CONNECTION_SERVICE_CONFIGURE = + "android.intent.action.CONNECTION_SERVICE_CONFIGURE"; + + /** + * Optional extra for {@link android.content.Intent#ACTION_CALL} containing a boolean that determines whether + * the speakerphone should be automatically turned on for an outgoing call. + */ + public static final String EXTRA_START_CALL_WITH_SPEAKERPHONE = + "android.intent.extra.START_CALL_WITH_SPEAKERPHONE"; + + /** + * Optional extra for {@link android.content.Intent#ACTION_CALL} containing an integer that determines the + * desired video state for an outgoing call. + * Valid options: {@link android.telecomm.VideoCallProfile#VIDEO_STATE_AUDIO_ONLY}, + * {@link android.telecomm.VideoCallProfile#VIDEO_STATE_BIDIRECTIONAL}, + * {@link android.telecomm.VideoCallProfile#VIDEO_STATE_RX_ENABLED}, + * {@link android.telecomm.VideoCallProfile#VIDEO_STATE_TX_ENABLED}. + */ + public static final String EXTRA_START_CALL_WITH_VIDEO_STATE = + "android.intent.extra.START_CALL_WITH_VIDEO_STATE"; + + /** + * The extra used with an {@link android.content.Intent#ACTION_CALL}, + * {@link #ACTION_INCOMING_CALL}, {@link android.content.Intent#ACTION_DIAL} {@code Intent} to + * specify a {@link android.telecomm.PhoneAccount} to use when making the call. + * + * <p class="note"> + * Retrieve with + * {@link android.content.Intent#getParcelableExtra(String)}. + */ + public static final String EXTRA_PHONE_ACCOUNT = "android.intent.extra.PHONE_ACCOUNT"; + + /** + * Optional extra for {@link #ACTION_INCOMING_CALL} containing a {@link android.os.Bundle} which contains + * metadata about the call. This {@link android.os.Bundle} will be returned to the + * {@link android.telecomm.ConnectionService}. + */ + public static final String EXTRA_INCOMING_CALL_EXTRAS = + "android.intent.extra.INCOMING_CALL_EXTRAS"; + + /** + * Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the + * disconnect code. + */ + public static final String EXTRA_CALL_DISCONNECT_CAUSE = + "android.telecomm.extra.CALL_DISCONNECT_CAUSE"; + + /** + * Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the + * disconnect message. + */ + public static final String EXTRA_CALL_DISCONNECT_MESSAGE = + "android.telecomm.extra.CALL_DISCONNECT_MESSAGE"; + + /** + * Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the + * component name of the associated connection service. + */ + public static final String EXTRA_CONNECTION_SERVICE = + "android.telecomm.extra.CONNECTION_SERVICE"; + + /** + * The number which the party on the other side of the line will see (and use to return the + * call). + * <p> + * {@link ConnectionService}s which interact with + * {@link RemoteConnection}s should only populate this if the + * {@link android.telephony.TelephonyManager#getLine1Number()} value, as that is the user's + * expected caller ID. + */ + public static final String EXTRA_CALL_BACK_NUMBER = "android.telecomm.extra.CALL_BACK_NUMBER"; + + /** + * The dual tone multi-frequency signaling character sent to indicate the dialing system should + * pause for a predefined period. + */ + public static final char DTMF_CHARACTER_PAUSE = ','; + + /** + * The dual-tone multi-frequency signaling character sent to indicate the dialing system should + * wait for user confirmation before proceeding. + */ + public static final char DTMF_CHARACTER_WAIT = ';'; + + /** + * TTY (teletypewriter) mode is off. + * + * @hide + */ + public static final int TTY_MODE_OFF = 0; + + /** + * TTY (teletypewriter) mode is on. The speaker is off and the microphone is muted. The user + * will communicate with the remote party by sending and receiving text messages. + * + * @hide + */ + public static final int TTY_MODE_FULL = 1; + + /** + * TTY (teletypewriter) mode is in hearing carryover mode (HCO). The microphone is muted but the + * speaker is on. The user will communicate with the remote party by sending text messages and + * hearing an audible reply. + * + * @hide + */ + public static final int TTY_MODE_HCO = 2; + + /** + * TTY (teletypewriter) mode is in voice carryover mode (VCO). The speaker is off but the + * microphone is still on. User will communicate with the remote party by speaking and receiving + * text message replies. + * + * @hide + */ + public static final int TTY_MODE_VCO = 3; + + /** + * Broadcast intent action indicating that the current TTY mode has changed. An intent extra + * provides this state as an int. + * @see #EXTRA_CURRENT_TTY_MODE + * + * @hide + */ + public static final String ACTION_CURRENT_TTY_MODE_CHANGED = + "android.telecomm.intent.action.CURRENT_TTY_MODE_CHANGED"; + + /** + * The lookup key for an int that indicates the current TTY mode. + * Valid modes are: + * - {@link #TTY_MODE_OFF} + * - {@link #TTY_MODE_FULL} + * - {@link #TTY_MODE_HCO} + * - {@link #TTY_MODE_VCO} + * + * @hide + */ + public static final String EXTRA_CURRENT_TTY_MODE = + "android.telecomm.intent.extra.CURRENT_TTY_MODE"; + + /** + * Broadcast intent action indicating that the TTY preferred operating mode + * has changed. An intent extra provides the new mode as an int. + * @see #EXTRA_TTY_PREFERRED_MODE + * + * @hide + */ + public static final String ACTION_TTY_PREFERRED_MODE_CHANGED = + "android.telecomm.intent.action.TTY_PREFERRED_MODE_CHANGED"; + + /** + * The lookup key for an int that indicates preferred TTY mode. + * Valid modes are: + * - {@link #TTY_MODE_OFF} + * - {@link #TTY_MODE_FULL} + * - {@link #TTY_MODE_HCO} + * - {@link #TTY_MODE_VCO} + * + * @hide + */ + public static final String EXTRA_TTY_PREFERRED_MODE = + "android.telecomm.intent.extra.TTY_PREFERRED"; + private static final String TAG = "TelecommManager"; + private static final String TELECOMM_SERVICE_NAME = "telecomm"; private final Context mContext; @@ -64,11 +252,11 @@ public class TelecommManager { * currently exists no user-chosen default {@code PhoneAccount}. In this case, apps wishing to * initiate a phone call must either create their {@link android.content.Intent#ACTION_CALL} or * {@link android.content.Intent#ACTION_DIAL} {@code Intent} with no - * {@link TelecommConstants#EXTRA_PHONE_ACCOUNT}, or present the user with an affordance + * {@link TelecommManager#EXTRA_PHONE_ACCOUNT}, or present the user with an affordance * to select one of the elements of {@link #getEnabledPhoneAccounts()}. * <p> * An {@link android.content.Intent#ACTION_CALL} or {@link android.content.Intent#ACTION_DIAL} - * {@code Intent} with no {@link TelecommConstants#EXTRA_PHONE_ACCOUNT} is valid, and subsequent + * {@code Intent} with no {@link TelecommManager#EXTRA_PHONE_ACCOUNT} is valid, and subsequent * steps in the phone call flow are responsible for presenting the user with an affordance, if * necessary, to choose a {@code PhoneAccount}. */ @@ -287,10 +475,10 @@ public class TelecommManager { /** * Returns the current TTY mode of the device. For TTY to be on the user must enable it in * settings and have a wired headset plugged in. Valid modes are: - * - {@link android.telecomm.TelecommConstants#TTY_MODE_OFF} - * - {@link android.telecomm.TelecommConstants#TTY_MODE_FULL} - * - {@link android.telecomm.TelecommConstants#TTY_MODE_HCO} - * - {@link android.telecomm.TelecommConstants#TTY_MODE_VCO} + * - {@link TelecommManager#TTY_MODE_OFF} + * - {@link TelecommManager#TTY_MODE_FULL} + * - {@link TelecommManager#TTY_MODE_HCO} + * - {@link TelecommManager#TTY_MODE_VCO} * * @hide */ @@ -302,7 +490,7 @@ public class TelecommManager { } catch (RemoteException e) { Log.e(TAG, "RemoteException attempting to get the current TTY mode.", e); } - return TelecommConstants.TTY_MODE_OFF; + return TTY_MODE_OFF; } private ITelecommService getTelecommService() { |