summaryrefslogtreecommitdiffstats
path: root/telecomm/java
diff options
context:
space:
mode:
Diffstat (limited to 'telecomm/java')
-rw-r--r--telecomm/java/android/telecom/AudioState.java3
-rw-r--r--telecomm/java/android/telecom/Call.java6
-rw-r--r--telecomm/java/android/telecom/Conference.java4
-rw-r--r--telecomm/java/android/telecom/Connection.java23
-rw-r--r--telecomm/java/android/telecom/ConnectionRequest.java3
-rw-r--r--telecomm/java/android/telecom/ConnectionService.java3
-rw-r--r--telecomm/java/android/telecom/DisconnectCause.java3
-rw-r--r--telecomm/java/android/telecom/GatewayInfo.java2
-rw-r--r--telecomm/java/android/telecom/InCallAdapter.java12
-rw-r--r--telecomm/java/android/telecom/PhoneAccount.java55
-rw-r--r--telecomm/java/android/telecom/PhoneAccountHandle.java7
-rw-r--r--telecomm/java/android/telecom/PhoneCapabilities.java50
-rw-r--r--telecomm/java/android/telecom/RemoteConference.java3
-rw-r--r--telecomm/java/android/telecom/RemoteConnection.java3
-rw-r--r--telecomm/java/android/telecom/StatusHints.java3
-rw-r--r--telecomm/java/android/telecom/TelecomManager.java40
-rw-r--r--telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl3
-rw-r--r--telecomm/java/com/android/internal/telecom/ITelecomService.aidl5
18 files changed, 138 insertions, 90 deletions
diff --git a/telecomm/java/android/telecom/AudioState.java b/telecomm/java/android/telecom/AudioState.java
index fc2fff4..d0e2860 100644
--- a/telecomm/java/android/telecom/AudioState.java
+++ b/telecomm/java/android/telecom/AudioState.java
@@ -16,7 +16,6 @@
package android.telecom;
-import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
@@ -24,9 +23,7 @@ import java.util.Locale;
/**
* Encapsulates all audio states during a call.
- * @hide
*/
-@SystemApi
public final class AudioState implements Parcelable {
/** Direct the audio stream through the device's earpiece. */
public static final int ROUTE_EARPIECE = 0x00000001;
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index f934963..354fa2e 100644
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -484,10 +484,10 @@ public final class Call {
/**
* Notifies this {@code Call} that an account has been selected and to proceed with placing
- * an outgoing call.
+ * an outgoing call. Optionally sets this account as the default account.
*/
- public void phoneAccountSelected(PhoneAccountHandle accountHandle) {
- mInCallAdapter.phoneAccountSelected(mTelecomCallId, accountHandle);
+ public void phoneAccountSelected(PhoneAccountHandle accountHandle, boolean setDefault) {
+ mInCallAdapter.phoneAccountSelected(mTelecomCallId, accountHandle, setDefault);
}
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index b7b98bf..15cb786 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -16,8 +16,6 @@
package android.telecom;
-import android.annotation.SystemApi;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -27,9 +25,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
/**
* Represents a conference call which can contain any number of {@link Connection} objects.
- * @hide
*/
-@SystemApi
public abstract class Conference {
/** @hide */
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index b5f6692..2932721 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -19,7 +19,6 @@ package android.telecom;
import com.android.internal.telecom.IVideoCallback;
import com.android.internal.telecom.IVideoProvider;
-import android.annotation.SystemApi;
import android.net.Uri;
import android.os.Handler;
import android.os.IBinder;
@@ -44,9 +43,7 @@ import java.util.concurrent.ConcurrentHashMap;
* Implementations are then responsible for updating the state of the {@code Connection}, and
* must call {@link #destroy()} to signal to the framework that the {@code Connection} is no
* longer used and associated resources may be recovered.
- * @hide
*/
-@SystemApi
public abstract class Connection {
public static final int STATE_INITIALIZING = 0;
@@ -876,7 +873,7 @@ public abstract class Connection {
return mUnmodifiableConferenceableConnections;
}
- /**
+ /*
* @hide
*/
public final void setConnectionService(ConnectionService connectionService) {
@@ -901,6 +898,13 @@ public abstract class Connection {
}
/**
+ * @hide
+ */
+ public final ConnectionService getConnectionService() {
+ return mConnectionService;
+ }
+
+ /**
* Sets the conference that this connection is a part of. This will fail if the connection is
* already part of a conference call. {@link #resetConference} to un-set the conference first.
*
@@ -914,6 +918,7 @@ public abstract class Connection {
mConference = conference;
if (mConnectionService != null && mConnectionService.containsConference(conference)) {
fireConferenceChanged();
+ onConferenceChanged();
}
return true;
}
@@ -929,6 +934,7 @@ public abstract class Connection {
Log.d(this, "Conference reset");
mConference = null;
fireConferenceChanged();
+ onConferenceChanged();
}
}
@@ -1013,14 +1019,9 @@ public abstract class Connection {
public void onPostDialContinue(boolean proceed) {}
/**
- * Merge this connection and the specified connection into a conference call. Once the
- * connections are merged, the calls should be added to the an existing or new
- * {@code Conference} instance. For new {@code Conference} instances, use
- * {@code ConnectionService#addConference}.
- *
- * @param otherConnection The connection with which this connection should be conferenced.
+ * Notifies this Connection that the conference which is set on it has changed.
*/
- public void onConferenceWith(Connection otherConnection) {}
+ public void onConferenceChanged() {}
static String toLogSafePhoneNumber(String number) {
// For unknown number, log empty string.
diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java
index f691c17..71b481b 100644
--- a/telecomm/java/android/telecom/ConnectionRequest.java
+++ b/telecomm/java/android/telecom/ConnectionRequest.java
@@ -16,7 +16,6 @@
package android.telecom;
-import android.annotation.SystemApi;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcel;
@@ -25,9 +24,7 @@ import android.os.Parcelable;
/**
* Simple data container encapsulating a request to some entity to
* create a new {@link Connection}.
- * @hide
*/
-@SystemApi
public final class ConnectionRequest implements Parcelable {
// TODO: Token to limit recursive invocations
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 6eee99d..649533e 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -16,7 +16,6 @@
package android.telecom;
-import android.annotation.SystemApi;
import android.annotation.SdkConstant;
import android.app.Service;
import android.content.ComponentName;
@@ -43,9 +42,7 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* A {@link android.app.Service} that provides telephone connections to processes running on an
* Android device.
- * @hide
*/
-@SystemApi
public abstract class ConnectionService extends Service {
/**
* The {@link Intent} that must be declared as handled by the service.
diff --git a/telecomm/java/android/telecom/DisconnectCause.java b/telecomm/java/android/telecom/DisconnectCause.java
index 52c1284..9be0138 100644
--- a/telecomm/java/android/telecom/DisconnectCause.java
+++ b/telecomm/java/android/telecom/DisconnectCause.java
@@ -16,7 +16,6 @@
package android.telecom;
-import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.media.ToneGenerator;
@@ -29,9 +28,7 @@ import java.util.Objects;
* cause of the disconnect. Optionally, it may include a localized label and/or localized description
* to display to the user which is provided by the {@link ConnectionService}. It also may contain a
* reason for the the disconnect, which is intended for logging and not for display to the user.
- * @hide
*/
-@SystemApi
public final class DisconnectCause implements Parcelable {
/** Disconnected because of an unknown or unspecified reason. */
diff --git a/telecomm/java/android/telecom/GatewayInfo.java b/telecomm/java/android/telecom/GatewayInfo.java
index 3efab0f..583c3e2 100644
--- a/telecomm/java/android/telecom/GatewayInfo.java
+++ b/telecomm/java/android/telecom/GatewayInfo.java
@@ -30,9 +30,7 @@ import android.text.TextUtils;
* <li> Call the appropriate routing number
* <li> Display information about how the call is being routed to the user
* </ol>
- * @hide
*/
-@SystemApi
public class GatewayInfo implements Parcelable {
private final String mGatewayProviderPackageName;
diff --git a/telecomm/java/android/telecom/InCallAdapter.java b/telecomm/java/android/telecom/InCallAdapter.java
index fd3cf2e..62b8dea 100644
--- a/telecomm/java/android/telecom/InCallAdapter.java
+++ b/telecomm/java/android/telecom/InCallAdapter.java
@@ -189,14 +189,16 @@ public final class InCallAdapter {
}
/**
- * Instructs Telecom to add a PhoneAccountHandle to the specified call
+ * Instructs Telecom to add a PhoneAccountHandle to the specified call.
*
- * @param callId The identifier of the call
- * @param accountHandle The PhoneAccountHandle through which to place the call
+ * @param callId The identifier of the call.
+ * @param accountHandle The PhoneAccountHandle through which to place the call.
+ * @param setDefault {@code True} if this account should be set as the default for calls.
*/
- public void phoneAccountSelected(String callId, PhoneAccountHandle accountHandle) {
+ public void phoneAccountSelected(String callId, PhoneAccountHandle accountHandle,
+ boolean setDefault) {
try {
- mAdapter.phoneAccountSelected(callId, accountHandle);
+ mAdapter.phoneAccountSelected(callId, accountHandle, setDefault);
} catch (RemoteException e) {
}
}
diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java
index 1d6d8bc..402df30 100644
--- a/telecomm/java/android/telecom/PhoneAccount.java
+++ b/telecomm/java/android/telecom/PhoneAccount.java
@@ -16,7 +16,6 @@
package android.telecom;
-import android.annotation.SystemApi;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources.NotFoundException;
@@ -35,9 +34,7 @@ import java.util.MissingResourceException;
/**
* Describes a distinct account, line of service or call placement method that the system
* can use to place phone calls.
- * @hide
*/
-@SystemApi
public class PhoneAccount implements Parcelable {
/**
@@ -108,11 +105,17 @@ public class PhoneAccount implements Parcelable {
*/
public static final String SCHEME_SIP = "sip";
+ /**
+ * Indicating no color is set.
+ */
+ public static final int NO_COLOR = -1;
+
private final PhoneAccountHandle mAccountHandle;
private final Uri mAddress;
private final Uri mSubscriptionAddress;
private final int mCapabilities;
private final int mIconResId;
+ private final int mColor;
private final CharSequence mLabel;
private final CharSequence mShortDescription;
private final List<String> mSupportedUriSchemes;
@@ -123,6 +126,7 @@ public class PhoneAccount implements Parcelable {
private Uri mSubscriptionAddress;
private int mCapabilities;
private int mIconResId;
+ private int mColor = NO_COLOR;
private CharSequence mLabel;
private CharSequence mShortDescription;
private List<String> mSupportedUriSchemes = new ArrayList<String>();
@@ -144,6 +148,7 @@ public class PhoneAccount implements Parcelable {
mSubscriptionAddress = phoneAccount.getSubscriptionAddress();
mCapabilities = phoneAccount.getCapabilities();
mIconResId = phoneAccount.getIconResId();
+ mColor = phoneAccount.getColor();
mLabel = phoneAccount.getLabel();
mShortDescription = phoneAccount.getShortDescription();
mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes());
@@ -169,6 +174,11 @@ public class PhoneAccount implements Parcelable {
return this;
}
+ public Builder setColor(int value) {
+ this.mColor = value;
+ return this;
+ }
+
public Builder setShortDescription(CharSequence value) {
this.mShortDescription = value;
return this;
@@ -222,6 +232,7 @@ public class PhoneAccount implements Parcelable {
mSubscriptionAddress,
mCapabilities,
mIconResId,
+ mColor,
mLabel,
mShortDescription,
mSupportedUriSchemes);
@@ -234,6 +245,7 @@ public class PhoneAccount implements Parcelable {
Uri subscriptionAddress,
int capabilities,
int iconResId,
+ int color,
CharSequence label,
CharSequence shortDescription,
List<String> supportedUriSchemes) {
@@ -242,6 +254,7 @@ public class PhoneAccount implements Parcelable {
mSubscriptionAddress = subscriptionAddress;
mCapabilities = capabilities;
mIconResId = iconResId;
+ mColor = color;
mLabel = label;
mShortDescription = shortDescription;
mSupportedUriSchemes = Collections.unmodifiableList(supportedUriSchemes);
@@ -286,6 +299,9 @@ public class PhoneAccount implements Parcelable {
* The raw callback number used for this {@code PhoneAccount}, as distinct from
* {@link #getAddress()}. For the majority of {@code PhoneAccount}s this should be registered
* as {@code null}. It is used by the system for SIM-based {@code PhoneAccount} registration
+ * where {@link android.telephony.TelephonyManager#setLine1NumberForDisplay(String, String)}
+ * has been used to alter the callback number.
+ * <p>
*
* @return The subscription number, suitable for display to the user.
*/
@@ -371,6 +387,15 @@ public class PhoneAccount implements Parcelable {
}
/**
+ * A highlight color to use in displaying information about this {@code PhoneAccount}.
+ *
+ * @return A hexadecimal color value.
+ */
+ public int getColor() {
+ return mColor;
+ }
+
+ /**
* An icon to represent this {@code PhoneAccount} in a user interface.
*
* @return An icon for this {@code PhoneAccount}.
@@ -380,12 +405,17 @@ public class PhoneAccount implements Parcelable {
}
private Drawable getIcon(Context context, int resId) {
+ if (resId == 0) {
+ return null;
+ }
+
Context packageContext;
try {
packageContext = context.createPackageContext(
mAccountHandle.getComponentName().getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
- Log.w(this, "Cannot find package %s", mAccountHandle.getComponentName().getPackageName());
+ Log.w(this, "Cannot find package %s",
+ mAccountHandle.getComponentName().getPackageName());
return null;
}
try {
@@ -413,6 +443,7 @@ public class PhoneAccount implements Parcelable {
out.writeParcelable(mSubscriptionAddress, 0);
out.writeInt(mCapabilities);
out.writeInt(mIconResId);
+ out.writeInt(mColor);
out.writeCharSequence(mLabel);
out.writeCharSequence(mShortDescription);
out.writeList(mSupportedUriSchemes);
@@ -439,6 +470,7 @@ public class PhoneAccount implements Parcelable {
mSubscriptionAddress = in.readParcelable(getClass().getClassLoader());
mCapabilities = in.readInt();
mIconResId = in.readInt();
+ mColor = in.readInt();
mLabel = in.readCharSequence();
mShortDescription = in.readCharSequence();
@@ -446,4 +478,19 @@ public class PhoneAccount implements Parcelable {
in.readList(supportedUriSchemes, classLoader);
mSupportedUriSchemes = Collections.unmodifiableList(supportedUriSchemes);
}
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder().append("[PhoneAccount: ")
+ .append(mAccountHandle)
+ .append(" Capabilities: ")
+ .append(mCapabilities)
+ .append(" Schemes: ");
+ for (String scheme : mSupportedUriSchemes) {
+ sb.append(scheme)
+ .append(" ");
+ }
+ sb.append("]");
+ return sb.toString();
+ }
}
diff --git a/telecomm/java/android/telecom/PhoneAccountHandle.java b/telecomm/java/android/telecom/PhoneAccountHandle.java
index 652befe5..768188b 100644
--- a/telecomm/java/android/telecom/PhoneAccountHandle.java
+++ b/telecomm/java/android/telecom/PhoneAccountHandle.java
@@ -16,7 +16,6 @@
package android.telecom;
-import android.annotation.SystemApi;
import android.content.ComponentName;
import android.os.Parcel;
import android.os.Parcelable;
@@ -25,9 +24,7 @@ import java.util.Objects;
/**
* The unique identifier for a {@link PhoneAccount}.
- * @hide
*/
-@SystemApi
public class PhoneAccountHandle implements Parcelable {
private ComponentName mComponentName;
private String mId;
@@ -74,9 +71,11 @@ public class PhoneAccountHandle implements Parcelable {
@Override
public String toString() {
+ // Note: Log.pii called for mId as it can contain personally identifying phone account
+ // information such as SIP account IDs.
return new StringBuilder().append(mComponentName)
.append(", ")
- .append(mId)
+ .append(Log.pii(mId))
.toString();
}
diff --git a/telecomm/java/android/telecom/PhoneCapabilities.java b/telecomm/java/android/telecom/PhoneCapabilities.java
index de2abcb..9c67503 100644
--- a/telecomm/java/android/telecom/PhoneCapabilities.java
+++ b/telecomm/java/android/telecom/PhoneCapabilities.java
@@ -16,14 +16,10 @@
package android.telecom;
-import android.annotation.SystemApi;
-
/**
* Defines capabilities a phone call can support, such as conference calling and video telephony.
* Also defines properties of a phone call, such as whether it is using VoLTE technology.
- * @hide
*/
-@SystemApi
public final class PhoneCapabilities {
/** Call can currently be put on hold or unheld. */
public static final int HOLD = 0x00000001;
@@ -96,43 +92,65 @@ public final class PhoneCapabilities {
| ADD_CALL | RESPOND_VIA_TEXT | MUTE | MANAGE_CONFERENCE | SEPARATE_FROM_CONFERENCE
| DISCONNECT_FROM_CONFERENCE;
+ /**
+ * Whether this set of capabilities supports the specified capability.
+ * @param capabilities The set of capabilities.
+ * @param capability The capability to check capabilities for.
+ * @return Whether the specified capability is supported.
+ * @hide
+ */
+ public static boolean can(int capabilities, int capability) {
+ return (capabilities & capability) != 0;
+ }
+
+ /**
+ * Removes the specified capability from the set of capabilities and returns the new set.
+ * @param capabilities The set of capabilities.
+ * @param capability The capability to remove from the set.
+ * @return The set of capabilities, with the capability removed.
+ * @hide
+ */
+ public static int remove(int capabilities, int capability) {
+ return capabilities & ~capability;
+ }
+
public static String toString(int capabilities) {
StringBuilder builder = new StringBuilder();
builder.append("[Capabilities:");
- if ((capabilities & HOLD) != 0) {
+ if (can(capabilities, HOLD)) {
builder.append(" HOLD");
}
- if ((capabilities & SUPPORT_HOLD) != 0) {
+ if (can(capabilities, SUPPORT_HOLD)) {
builder.append(" SUPPORT_HOLD");
}
- if ((capabilities & MERGE_CONFERENCE) != 0) {
+ if (can(capabilities, MERGE_CONFERENCE)) {
builder.append(" MERGE_CONFERENCE");
}
- if ((capabilities & SWAP_CONFERENCE) != 0) {
+ if (can(capabilities, SWAP_CONFERENCE)) {
builder.append(" SWAP_CONFERENCE");
}
- if ((capabilities & ADD_CALL) != 0) {
+ if (can(capabilities, ADD_CALL)) {
builder.append(" ADD_CALL");
}
- if ((capabilities & RESPOND_VIA_TEXT) != 0) {
+ if (can(capabilities, RESPOND_VIA_TEXT)) {
builder.append(" RESPOND_VIA_TEXT");
}
- if ((capabilities & MUTE) != 0) {
+ if (can(capabilities, MUTE)) {
builder.append(" MUTE");
}
- if ((capabilities & MANAGE_CONFERENCE) != 0) {
+ if (can(capabilities, MANAGE_CONFERENCE)) {
builder.append(" MANAGE_CONFERENCE");
}
- if ((capabilities & SUPPORTS_VT_LOCAL) != 0) {
+ if (can(capabilities, SUPPORTS_VT_LOCAL)) {
builder.append(" SUPPORTS_VT_LOCAL");
}
- if ((capabilities & SUPPORTS_VT_REMOTE) != 0) {
+ if (can(capabilities, SUPPORTS_VT_REMOTE)) {
builder.append(" SUPPORTS_VT_REMOTE");
}
- if ((capabilities & VoLTE) != 0) {
+ if (can(capabilities, VoLTE)) {
builder.append(" VoLTE");
}
- if ((capabilities & VoWIFI) != 0) {
+ if (can(capabilities, VoWIFI)) {
builder.append(" VoWIFI");
}
builder.append("]");
diff --git a/telecomm/java/android/telecom/RemoteConference.java b/telecomm/java/android/telecom/RemoteConference.java
index b548274..eba7580 100644
--- a/telecomm/java/android/telecom/RemoteConference.java
+++ b/telecomm/java/android/telecom/RemoteConference.java
@@ -18,7 +18,6 @@ package android.telecom;
import com.android.internal.telecom.IConnectionService;
-import android.annotation.SystemApi;
import android.os.RemoteException;
import java.util.ArrayList;
@@ -30,9 +29,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
/**
* Represents a conference call which can contain any number of {@link Connection} objects.
- * @hide
*/
-@SystemApi
public final class RemoteConference {
public abstract static class Callback {
diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java
index 4a89692..9a094df 100644
--- a/telecomm/java/android/telecom/RemoteConnection.java
+++ b/telecomm/java/android/telecom/RemoteConnection.java
@@ -20,7 +20,6 @@ import com.android.internal.telecom.IConnectionService;
import com.android.internal.telecom.IVideoCallback;
import com.android.internal.telecom.IVideoProvider;
-import android.annotation.SystemApi;
import android.net.Uri;
import android.os.IBinder;
import android.os.RemoteException;
@@ -38,9 +37,7 @@ import java.util.concurrent.ConcurrentHashMap;
*
* @see ConnectionService#createRemoteOutgoingConnection(PhoneAccountHandle, ConnectionRequest)
* @see ConnectionService#createRemoteIncomingConnection(PhoneAccountHandle, ConnectionRequest)
- * @hide
*/
-@SystemApi
public final class RemoteConnection {
public static abstract class Callback {
diff --git a/telecomm/java/android/telecom/StatusHints.java b/telecomm/java/android/telecom/StatusHints.java
index dd3a639..a32eae7 100644
--- a/telecomm/java/android/telecom/StatusHints.java
+++ b/telecomm/java/android/telecom/StatusHints.java
@@ -16,7 +16,6 @@
package android.telecom;
-import android.annotation.SystemApi;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -30,9 +29,7 @@ import java.util.Objects;
/**
* Contains status label and icon displayed in the in-call UI.
- * @hide
*/
-@SystemApi
public final class StatusHints implements Parcelable {
private final ComponentName mPackageName;
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index f3358f8..2652b45 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -31,7 +31,6 @@ import java.util.List;
/**
* Provides access to Telecom-related functionality.
- * TODO: Move this all into PhoneManager.
*/
public class TelecomManager {
@@ -60,7 +59,6 @@ public class TelecomManager {
/**
* The {@link android.content.Intent} action used to configure a
* {@link android.telecom.ConnectionService}.
- * @hide
*/
public static final String ACTION_CONNECTION_SERVICE_CONFIGURE =
"android.telecom.action.CONNECTION_SERVICE_CONFIGURE";
@@ -74,7 +72,6 @@ public class TelecomManager {
/**
* The {@link android.content.Intent} action used to show the settings page used to configure
* {@link PhoneAccount} preferences.
- * @hide
*/
public static final String ACTION_CHANGE_PHONE_ACCOUNTS =
"android.telecom.action.CHANGE_PHONE_ACCOUNTS";
@@ -105,7 +102,6 @@ public class TelecomManager {
* {@link PhoneAccountHandle} to use when making the call.
* <p class="note">
* Retrieve with {@link android.content.Intent#getParcelableExtra(String)}.
- * @hide
*/
public static final String EXTRA_PHONE_ACCOUNT_HANDLE =
"android.telecom.extra.PHONE_ACCOUNT_HANDLE";
@@ -154,7 +150,6 @@ public class TelecomManager {
/**
* Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED}
* containing the component name of the associated connection service.
- * @hide
*/
public static final String EXTRA_CONNECTION_SERVICE =
"android.telecom.extra.CONNECTION_SERVICE";
@@ -190,7 +185,6 @@ public class TelecomManager {
* {@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.
- * @hide
*/
public static final String EXTRA_CALL_BACK_NUMBER = "android.telecom.extra.CALL_BACK_NUMBER";
@@ -437,7 +431,6 @@ public class TelecomManager {
* {@code PhoneAccount}.
*
* @return The phone account handle of the current connection manager.
- * @hide
*/
public PhoneAccountHandle getConnectionManager() {
return getSimCallManager();
@@ -495,7 +488,6 @@ public class TelecomManager {
*
* @return {@code true} if the device has more than one account registered and {@code false}
* otherwise.
- * @hide
*/
public boolean hasMultipleCallCapableAccounts() {
return getCallCapablePhoneAccounts().size() > 1;
@@ -505,7 +497,6 @@ public class TelecomManager {
* Returns a list of all {@link PhoneAccount}s registered for the calling package.
*
* @return A list of {@code PhoneAccountHandle} objects.
- * @hide
*/
public List<PhoneAccountHandle> getPhoneAccountsForPackage() {
try {
@@ -524,7 +515,6 @@ public class TelecomManager {
*
* @param account The {@link PhoneAccountHandle}.
* @return The {@link PhoneAccount} object.
- * @hide
*/
public PhoneAccount getPhoneAccount(PhoneAccountHandle account) {
try {
@@ -595,9 +585,7 @@ public class TelecomManager {
* Register a {@link PhoneAccount} for use by the system.
*
* @param account The complete {@link PhoneAccount}.
- * @hide
*/
- @SystemApi
public void registerPhoneAccount(PhoneAccount account) {
try {
if (isServiceConnected()) {
@@ -612,9 +600,7 @@ public class TelecomManager {
* Remove a {@link PhoneAccount} registration from the system.
*
* @param accountHandle A {@link PhoneAccountHandle} for the {@link PhoneAccount} to unregister.
- * @hide
*/
- @SystemApi
public void unregisterPhoneAccount(PhoneAccountHandle accountHandle) {
try {
if (isServiceConnected()) {
@@ -627,9 +613,7 @@ public class TelecomManager {
/**
* Remove all Accounts that belong to the calling package from the system.
- * @hide
*/
- @SystemApi
public void clearAccounts() {
try {
if (isServiceConnected()) {
@@ -656,13 +640,33 @@ public class TelecomManager {
}
/**
+ * Return whether a given phone number is the configured voicemail number for a
+ * particular phone account.
+ *
+ * @param accountHandle The handle for the account to check the voicemail number against
+ * @param number The number to look up.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean isVoiceMailNumber(PhoneAccountHandle accountHandle, String number) {
+ try {
+ if (isServiceConnected()) {
+ return getTelecomService().isVoiceMailNumber(accountHandle, number);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "RemoteException calling isInCall().", e);
+ }
+ return false;
+ }
+
+ /**
* Returns whether there is an ongoing phone call (can be in dialing, ringing, active or holding
* states).
* <p>
* Requires permission: {@link android.Manifest.permission#READ_PHONE_STATE}
* </p>
*/
- @SystemApi
public boolean isInCall() {
try {
if (isServiceConnected()) {
@@ -813,9 +817,7 @@ public class TelecomManager {
* {@link #registerPhoneAccount}.
* @param extras A bundle that will be passed through to
* {@link ConnectionService#onCreateIncomingConnection}.
- * @hide
*/
- @SystemApi
public void addNewIncomingCall(PhoneAccountHandle phoneAccount, Bundle extras) {
try {
if (isServiceConnected()) {
diff --git a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl
index 138a877..863fff2 100644
--- a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl
@@ -46,7 +46,8 @@ oneway interface IInCallAdapter {
void postDialContinue(String callId, boolean proceed);
- void phoneAccountSelected(String callId, in PhoneAccountHandle accountHandle);
+ void phoneAccountSelected(String callId, in PhoneAccountHandle accountHandle,
+ boolean setDefault);
void conference(String callId, String otherCallId);
diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
index f1cf885..91f44b9 100644
--- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
+++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
@@ -115,6 +115,11 @@ interface ITelecomService {
void clearAccounts(String packageName);
/**
+ * @see TelecomServiceImpl#isVoiceMailNumber
+ */
+ boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number);
+
+ /**
* @see TelecomServiceImpl#getDefaultPhoneApp
*/
ComponentName getDefaultPhoneApp();