Merge "DO NOT MERGE ANYWHERE" into cw-e-dev
This commit is contained in:
@@ -253,6 +253,7 @@ public final class Call {
|
|||||||
private final PhoneAccountHandle mAccountHandle;
|
private final PhoneAccountHandle mAccountHandle;
|
||||||
private final int mCallCapabilities;
|
private final int mCallCapabilities;
|
||||||
private final int mCallProperties;
|
private final int mCallProperties;
|
||||||
|
private final int mSupportedAudioRoutes;
|
||||||
private final DisconnectCause mDisconnectCause;
|
private final DisconnectCause mDisconnectCause;
|
||||||
private final long mConnectTimeMillis;
|
private final long mConnectTimeMillis;
|
||||||
private final GatewayInfo mGatewayInfo;
|
private final GatewayInfo mGatewayInfo;
|
||||||
@@ -447,6 +448,15 @@ public final class Call {
|
|||||||
return mCallProperties;
|
return mCallProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a bitmask of the audio routes available for the call.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public int getSupportedAudioRoutes() {
|
||||||
|
return mSupportedAudioRoutes;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return For a {@link #STATE_DISCONNECTED} {@code Call}, the disconnect cause expressed
|
* @return For a {@link #STATE_DISCONNECTED} {@code Call}, the disconnect cause expressed
|
||||||
* by {@link android.telecom.DisconnectCause}.
|
* by {@link android.telecom.DisconnectCause}.
|
||||||
@@ -513,6 +523,7 @@ public final class Call {
|
|||||||
Objects.equals(mAccountHandle, d.mAccountHandle) &&
|
Objects.equals(mAccountHandle, d.mAccountHandle) &&
|
||||||
Objects.equals(mCallCapabilities, d.mCallCapabilities) &&
|
Objects.equals(mCallCapabilities, d.mCallCapabilities) &&
|
||||||
Objects.equals(mCallProperties, d.mCallProperties) &&
|
Objects.equals(mCallProperties, d.mCallProperties) &&
|
||||||
|
Objects.equals(mSupportedAudioRoutes, d.mSupportedAudioRoutes) &&
|
||||||
Objects.equals(mDisconnectCause, d.mDisconnectCause) &&
|
Objects.equals(mDisconnectCause, d.mDisconnectCause) &&
|
||||||
Objects.equals(mConnectTimeMillis, d.mConnectTimeMillis) &&
|
Objects.equals(mConnectTimeMillis, d.mConnectTimeMillis) &&
|
||||||
Objects.equals(mGatewayInfo, d.mGatewayInfo) &&
|
Objects.equals(mGatewayInfo, d.mGatewayInfo) &&
|
||||||
@@ -534,6 +545,7 @@ public final class Call {
|
|||||||
Objects.hashCode(mAccountHandle) +
|
Objects.hashCode(mAccountHandle) +
|
||||||
Objects.hashCode(mCallCapabilities) +
|
Objects.hashCode(mCallCapabilities) +
|
||||||
Objects.hashCode(mCallProperties) +
|
Objects.hashCode(mCallProperties) +
|
||||||
|
Objects.hashCode(mSupportedAudioRoutes) +
|
||||||
Objects.hashCode(mDisconnectCause) +
|
Objects.hashCode(mDisconnectCause) +
|
||||||
Objects.hashCode(mConnectTimeMillis) +
|
Objects.hashCode(mConnectTimeMillis) +
|
||||||
Objects.hashCode(mGatewayInfo) +
|
Objects.hashCode(mGatewayInfo) +
|
||||||
@@ -552,6 +564,7 @@ public final class Call {
|
|||||||
PhoneAccountHandle accountHandle,
|
PhoneAccountHandle accountHandle,
|
||||||
int capabilities,
|
int capabilities,
|
||||||
int properties,
|
int properties,
|
||||||
|
int audioRoutes,
|
||||||
DisconnectCause disconnectCause,
|
DisconnectCause disconnectCause,
|
||||||
long connectTimeMillis,
|
long connectTimeMillis,
|
||||||
GatewayInfo gatewayInfo,
|
GatewayInfo gatewayInfo,
|
||||||
@@ -566,6 +579,7 @@ public final class Call {
|
|||||||
mAccountHandle = accountHandle;
|
mAccountHandle = accountHandle;
|
||||||
mCallCapabilities = capabilities;
|
mCallCapabilities = capabilities;
|
||||||
mCallProperties = properties;
|
mCallProperties = properties;
|
||||||
|
mSupportedAudioRoutes = audioRoutes;
|
||||||
mDisconnectCause = disconnectCause;
|
mDisconnectCause = disconnectCause;
|
||||||
mConnectTimeMillis = connectTimeMillis;
|
mConnectTimeMillis = connectTimeMillis;
|
||||||
mGatewayInfo = gatewayInfo;
|
mGatewayInfo = gatewayInfo;
|
||||||
@@ -1008,6 +1022,7 @@ public final class Call {
|
|||||||
parcelableCall.getAccountHandle(),
|
parcelableCall.getAccountHandle(),
|
||||||
parcelableCall.getCapabilities(),
|
parcelableCall.getCapabilities(),
|
||||||
parcelableCall.getProperties(),
|
parcelableCall.getProperties(),
|
||||||
|
parcelableCall.getSupportedAudioRoutes(),
|
||||||
parcelableCall.getDisconnectCause(),
|
parcelableCall.getDisconnectCause(),
|
||||||
parcelableCall.getConnectTimeMillis(),
|
parcelableCall.getConnectTimeMillis(),
|
||||||
parcelableCall.getGatewayInfo(),
|
parcelableCall.getGatewayInfo(),
|
||||||
|
|||||||
@@ -44,8 +44,12 @@ public final class CallAudioState implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
public static final int ROUTE_WIRED_OR_EARPIECE = ROUTE_EARPIECE | ROUTE_WIRED_HEADSET;
|
public static final int ROUTE_WIRED_OR_EARPIECE = ROUTE_EARPIECE | ROUTE_WIRED_HEADSET;
|
||||||
|
|
||||||
/** Bit mask of all possible audio routes. */
|
/**
|
||||||
private static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET |
|
* Bit mask of all possible audio routes.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
**/
|
||||||
|
public static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET |
|
||||||
ROUTE_SPEAKER;
|
ROUTE_SPEAKER;
|
||||||
|
|
||||||
private final boolean isMuted;
|
private final boolean isMuted;
|
||||||
|
|||||||
@@ -416,6 +416,7 @@ public abstract class Connection extends Conferenceable {
|
|||||||
public void onRingbackRequested(Connection c, boolean ringback) {}
|
public void onRingbackRequested(Connection c, boolean ringback) {}
|
||||||
public void onDestroyed(Connection c) {}
|
public void onDestroyed(Connection c) {}
|
||||||
public void onConnectionCapabilitiesChanged(Connection c, int capabilities) {}
|
public void onConnectionCapabilitiesChanged(Connection c, int capabilities) {}
|
||||||
|
public void onSupportedAudioRoutesChanged(Connection c, int supportedAudioRoutes) {}
|
||||||
public void onVideoProviderChanged(
|
public void onVideoProviderChanged(
|
||||||
Connection c, VideoProvider videoProvider) {}
|
Connection c, VideoProvider videoProvider) {}
|
||||||
public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {}
|
public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {}
|
||||||
@@ -1082,6 +1083,7 @@ public abstract class Connection extends Conferenceable {
|
|||||||
private int mCallerDisplayNamePresentation;
|
private int mCallerDisplayNamePresentation;
|
||||||
private boolean mRingbackRequested = false;
|
private boolean mRingbackRequested = false;
|
||||||
private int mConnectionCapabilities;
|
private int mConnectionCapabilities;
|
||||||
|
private int mSupportedAudioRoutes = CallAudioState.ROUTE_ALL;
|
||||||
private VideoProvider mVideoProvider;
|
private VideoProvider mVideoProvider;
|
||||||
private boolean mAudioModeIsVoip;
|
private boolean mAudioModeIsVoip;
|
||||||
private long mConnectTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED;
|
private long mConnectTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED;
|
||||||
@@ -1305,6 +1307,15 @@ public abstract class Connection extends Conferenceable {
|
|||||||
return mConnectionCapabilities;
|
return mConnectionCapabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the connection's supported audio routes.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public final int getSupportedAudioRoutes() {
|
||||||
|
return mSupportedAudioRoutes;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the {@link #getAddress()} property.
|
* Sets the value of the {@link #getAddress()} property.
|
||||||
*
|
*
|
||||||
@@ -1501,6 +1512,22 @@ public abstract class Connection extends Conferenceable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the supported audio routes.
|
||||||
|
*
|
||||||
|
* @param supportedAudioRoutes the supported audio routes as a bitmask.
|
||||||
|
* See {@link CallAudioState}
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public final void setSupportedAudioRoutes(int supportedAudioRoutes) {
|
||||||
|
if (mSupportedAudioRoutes != supportedAudioRoutes) {
|
||||||
|
mSupportedAudioRoutes = supportedAudioRoutes;
|
||||||
|
for (Listener l : mListeners) {
|
||||||
|
l.onSupportedAudioRoutesChanged(this, mSupportedAudioRoutes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tears down the Connection object.
|
* Tears down the Connection object.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -669,6 +669,7 @@ public abstract class ConnectionService extends Service {
|
|||||||
request.getAccountHandle(),
|
request.getAccountHandle(),
|
||||||
connection.getState(),
|
connection.getState(),
|
||||||
connection.getConnectionCapabilities(),
|
connection.getConnectionCapabilities(),
|
||||||
|
connection.getSupportedAudioRoutes(),
|
||||||
connection.getAddress(),
|
connection.getAddress(),
|
||||||
connection.getAddressPresentation(),
|
connection.getAddressPresentation(),
|
||||||
connection.getCallerDisplayName(),
|
connection.getCallerDisplayName(),
|
||||||
@@ -1011,6 +1012,7 @@ public abstract class ConnectionService extends Service {
|
|||||||
phoneAccountHandle,
|
phoneAccountHandle,
|
||||||
connection.getState(),
|
connection.getState(),
|
||||||
connection.getConnectionCapabilities(),
|
connection.getConnectionCapabilities(),
|
||||||
|
connection.getSupportedAudioRoutes(),
|
||||||
connection.getAddress(),
|
connection.getAddress(),
|
||||||
connection.getAddressPresentation(),
|
connection.getAddressPresentation(),
|
||||||
connection.getCallerDisplayName(),
|
connection.getCallerDisplayName(),
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
private final List<String> mCannedSmsResponses;
|
private final List<String> mCannedSmsResponses;
|
||||||
private final int mCapabilities;
|
private final int mCapabilities;
|
||||||
private final int mProperties;
|
private final int mProperties;
|
||||||
|
private final int mSupportedAudioRoutes;
|
||||||
private final long mConnectTimeMillis;
|
private final long mConnectTimeMillis;
|
||||||
private final Uri mHandle;
|
private final Uri mHandle;
|
||||||
private final int mHandlePresentation;
|
private final int mHandlePresentation;
|
||||||
@@ -64,6 +65,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
List<String> cannedSmsResponses,
|
List<String> cannedSmsResponses,
|
||||||
int capabilities,
|
int capabilities,
|
||||||
int properties,
|
int properties,
|
||||||
|
int supportedAudioRoutes,
|
||||||
long connectTimeMillis,
|
long connectTimeMillis,
|
||||||
Uri handle,
|
Uri handle,
|
||||||
int handlePresentation,
|
int handlePresentation,
|
||||||
@@ -86,6 +88,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
mCannedSmsResponses = cannedSmsResponses;
|
mCannedSmsResponses = cannedSmsResponses;
|
||||||
mCapabilities = capabilities;
|
mCapabilities = capabilities;
|
||||||
mProperties = properties;
|
mProperties = properties;
|
||||||
|
mSupportedAudioRoutes = supportedAudioRoutes;
|
||||||
mConnectTimeMillis = connectTimeMillis;
|
mConnectTimeMillis = connectTimeMillis;
|
||||||
mHandle = handle;
|
mHandle = handle;
|
||||||
mHandlePresentation = handlePresentation;
|
mHandlePresentation = handlePresentation;
|
||||||
@@ -137,6 +140,11 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
/** Bitmask of properties of the call. */
|
/** Bitmask of properties of the call. */
|
||||||
public int getProperties() { return mProperties; }
|
public int getProperties() { return mProperties; }
|
||||||
|
|
||||||
|
/** Bitmask of supported routes of the call */
|
||||||
|
public int getSupportedAudioRoutes() {
|
||||||
|
return mSupportedAudioRoutes;
|
||||||
|
}
|
||||||
|
|
||||||
/** The time that the call switched to the active state. */
|
/** The time that the call switched to the active state. */
|
||||||
public long getConnectTimeMillis() {
|
public long getConnectTimeMillis() {
|
||||||
return mConnectTimeMillis;
|
return mConnectTimeMillis;
|
||||||
@@ -291,6 +299,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
source.readList(conferenceableCallIds, classLoader);
|
source.readList(conferenceableCallIds, classLoader);
|
||||||
Bundle intentExtras = source.readBundle(classLoader);
|
Bundle intentExtras = source.readBundle(classLoader);
|
||||||
Bundle extras = source.readBundle(classLoader);
|
Bundle extras = source.readBundle(classLoader);
|
||||||
|
int supportedAudioRoutes = source.readInt();
|
||||||
return new ParcelableCall(
|
return new ParcelableCall(
|
||||||
id,
|
id,
|
||||||
state,
|
state,
|
||||||
@@ -298,6 +307,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
cannedSmsResponses,
|
cannedSmsResponses,
|
||||||
capabilities,
|
capabilities,
|
||||||
properties,
|
properties,
|
||||||
|
supportedAudioRoutes,
|
||||||
connectTimeMillis,
|
connectTimeMillis,
|
||||||
handle,
|
handle,
|
||||||
handlePresentation,
|
handlePresentation,
|
||||||
@@ -354,6 +364,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
destination.writeList(mConferenceableCallIds);
|
destination.writeList(mConferenceableCallIds);
|
||||||
destination.writeBundle(mIntentExtras);
|
destination.writeBundle(mIntentExtras);
|
||||||
destination.writeBundle(mExtras);
|
destination.writeBundle(mExtras);
|
||||||
|
destination.writeInt(mSupportedAudioRoutes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ public final class ParcelableConnection implements Parcelable {
|
|||||||
private final PhoneAccountHandle mPhoneAccount;
|
private final PhoneAccountHandle mPhoneAccount;
|
||||||
private final int mState;
|
private final int mState;
|
||||||
private final int mConnectionCapabilities;
|
private final int mConnectionCapabilities;
|
||||||
|
private final int mSupportedAudioRoutes;
|
||||||
private final Uri mAddress;
|
private final Uri mAddress;
|
||||||
private final int mAddressPresentation;
|
private final int mAddressPresentation;
|
||||||
private final String mCallerDisplayName;
|
private final String mCallerDisplayName;
|
||||||
@@ -55,6 +56,7 @@ public final class ParcelableConnection implements Parcelable {
|
|||||||
PhoneAccountHandle phoneAccount,
|
PhoneAccountHandle phoneAccount,
|
||||||
int state,
|
int state,
|
||||||
int capabilities,
|
int capabilities,
|
||||||
|
int supportedAudioRoutes,
|
||||||
Uri address,
|
Uri address,
|
||||||
int addressPresentation,
|
int addressPresentation,
|
||||||
String callerDisplayName,
|
String callerDisplayName,
|
||||||
@@ -71,6 +73,7 @@ public final class ParcelableConnection implements Parcelable {
|
|||||||
mPhoneAccount = phoneAccount;
|
mPhoneAccount = phoneAccount;
|
||||||
mState = state;
|
mState = state;
|
||||||
mConnectionCapabilities = capabilities;
|
mConnectionCapabilities = capabilities;
|
||||||
|
mSupportedAudioRoutes = supportedAudioRoutes;
|
||||||
mAddress = address;
|
mAddress = address;
|
||||||
mAddressPresentation = addressPresentation;
|
mAddressPresentation = addressPresentation;
|
||||||
mCallerDisplayName = callerDisplayName;
|
mCallerDisplayName = callerDisplayName;
|
||||||
@@ -99,6 +102,10 @@ public final class ParcelableConnection implements Parcelable {
|
|||||||
return mConnectionCapabilities;
|
return mConnectionCapabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getSupportedAudioRoutes() {
|
||||||
|
return mSupportedAudioRoutes;
|
||||||
|
}
|
||||||
|
|
||||||
public Uri getHandle() {
|
public Uri getHandle() {
|
||||||
return mAddress;
|
return mAddress;
|
||||||
}
|
}
|
||||||
@@ -189,11 +196,13 @@ public final class ParcelableConnection implements Parcelable {
|
|||||||
List<String> conferenceableConnectionIds = new ArrayList<>();
|
List<String> conferenceableConnectionIds = new ArrayList<>();
|
||||||
source.readStringList(conferenceableConnectionIds);
|
source.readStringList(conferenceableConnectionIds);
|
||||||
Bundle extras = source.readBundle(classLoader);
|
Bundle extras = source.readBundle(classLoader);
|
||||||
|
int supportedAudioRoutes = source.readInt();
|
||||||
|
|
||||||
return new ParcelableConnection(
|
return new ParcelableConnection(
|
||||||
phoneAccount,
|
phoneAccount,
|
||||||
state,
|
state,
|
||||||
capabilities,
|
capabilities,
|
||||||
|
supportedAudioRoutes,
|
||||||
address,
|
address,
|
||||||
addressPresentation,
|
addressPresentation,
|
||||||
callerDisplayName,
|
callerDisplayName,
|
||||||
@@ -241,5 +250,6 @@ public final class ParcelableConnection implements Parcelable {
|
|||||||
destination.writeParcelable(mDisconnectCause, 0);
|
destination.writeParcelable(mDisconnectCause, 0);
|
||||||
destination.writeStringList(mConferenceableConnectionIds);
|
destination.writeStringList(mConferenceableConnectionIds);
|
||||||
destination.writeBundle(mExtras);
|
destination.writeBundle(mExtras);
|
||||||
|
destination.writeInt(mSupportedAudioRoutes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,15 +17,6 @@
|
|||||||
package android.telecom;
|
package android.telecom;
|
||||||
|
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.content.ComponentName;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.content.res.Resources.NotFoundException;
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.graphics.drawable.Icon;
|
import android.graphics.drawable.Icon;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
@@ -36,7 +27,6 @@ import java.lang.String;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.MissingResourceException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a distinct method to place or receive a phone call. Apps which can place calls and
|
* Represents a distinct method to place or receive a phone call. Apps which can place calls and
|
||||||
@@ -167,6 +157,7 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
private final CharSequence mLabel;
|
private final CharSequence mLabel;
|
||||||
private final CharSequence mShortDescription;
|
private final CharSequence mShortDescription;
|
||||||
private final List<String> mSupportedUriSchemes;
|
private final List<String> mSupportedUriSchemes;
|
||||||
|
private final int mSupportedAudioRoutes;
|
||||||
private final Icon mIcon;
|
private final Icon mIcon;
|
||||||
private boolean mIsEnabled;
|
private boolean mIsEnabled;
|
||||||
|
|
||||||
@@ -174,10 +165,12 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
* Helper class for creating a {@link PhoneAccount}.
|
* Helper class for creating a {@link PhoneAccount}.
|
||||||
*/
|
*/
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private PhoneAccountHandle mAccountHandle;
|
private PhoneAccountHandle mAccountHandle;
|
||||||
private Uri mAddress;
|
private Uri mAddress;
|
||||||
private Uri mSubscriptionAddress;
|
private Uri mSubscriptionAddress;
|
||||||
private int mCapabilities;
|
private int mCapabilities;
|
||||||
|
private int mSupportedAudioRoutes = CallAudioState.ROUTE_ALL;
|
||||||
private int mHighlightColor = NO_HIGHLIGHT_COLOR;
|
private int mHighlightColor = NO_HIGHLIGHT_COLOR;
|
||||||
private CharSequence mLabel;
|
private CharSequence mLabel;
|
||||||
private CharSequence mShortDescription;
|
private CharSequence mShortDescription;
|
||||||
@@ -210,6 +203,7 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes());
|
mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes());
|
||||||
mIcon = phoneAccount.getIcon();
|
mIcon = phoneAccount.getIcon();
|
||||||
mIsEnabled = phoneAccount.isEnabled();
|
mIsEnabled = phoneAccount.isEnabled();
|
||||||
|
mSupportedAudioRoutes = phoneAccount.getSupportedAudioRoutes();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -319,6 +313,18 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the audio routes supported by this {@link PhoneAccount}.
|
||||||
|
*
|
||||||
|
* @param routes bit mask of available routes.
|
||||||
|
* @return The builder.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public Builder setSupportedAudioRoutes(int routes) {
|
||||||
|
mSupportedAudioRoutes = routes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of a {@link PhoneAccount} based on the current builder settings.
|
* Creates an instance of a {@link PhoneAccount} based on the current builder settings.
|
||||||
*
|
*
|
||||||
@@ -340,6 +346,7 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
mLabel,
|
mLabel,
|
||||||
mShortDescription,
|
mShortDescription,
|
||||||
mSupportedUriSchemes,
|
mSupportedUriSchemes,
|
||||||
|
mSupportedAudioRoutes,
|
||||||
mIsEnabled);
|
mIsEnabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -354,6 +361,7 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
CharSequence label,
|
CharSequence label,
|
||||||
CharSequence shortDescription,
|
CharSequence shortDescription,
|
||||||
List<String> supportedUriSchemes,
|
List<String> supportedUriSchemes,
|
||||||
|
int supportedAudioRoutes,
|
||||||
boolean isEnabled) {
|
boolean isEnabled) {
|
||||||
mAccountHandle = account;
|
mAccountHandle = account;
|
||||||
mAddress = address;
|
mAddress = address;
|
||||||
@@ -364,6 +372,7 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
mLabel = label;
|
mLabel = label;
|
||||||
mShortDescription = shortDescription;
|
mShortDescription = shortDescription;
|
||||||
mSupportedUriSchemes = Collections.unmodifiableList(supportedUriSchemes);
|
mSupportedUriSchemes = Collections.unmodifiableList(supportedUriSchemes);
|
||||||
|
mSupportedAudioRoutes = supportedAudioRoutes;
|
||||||
mIsEnabled = isEnabled;
|
mIsEnabled = isEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -462,6 +471,15 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
return mSupportedUriSchemes;
|
return mSupportedUriSchemes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The audio routes supported by this {@code PhoneAccount}.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public int getSupportedAudioRoutes() {
|
||||||
|
return mSupportedAudioRoutes;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The icon to represent this {@code PhoneAccount}.
|
* The icon to represent this {@code PhoneAccount}.
|
||||||
*
|
*
|
||||||
@@ -561,6 +579,7 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
mIcon.writeToParcel(out, flags);
|
mIcon.writeToParcel(out, flags);
|
||||||
}
|
}
|
||||||
out.writeByte((byte) (mIsEnabled ? 1 : 0));
|
out.writeByte((byte) (mIsEnabled ? 1 : 0));
|
||||||
|
out.writeInt(mSupportedAudioRoutes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Creator<PhoneAccount> CREATOR
|
public static final Creator<PhoneAccount> CREATOR
|
||||||
@@ -603,6 +622,7 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
mIcon = null;
|
mIcon = null;
|
||||||
}
|
}
|
||||||
mIsEnabled = in.readByte() == 1;
|
mIsEnabled = in.readByte() == 1;
|
||||||
|
mSupportedAudioRoutes = in.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -613,6 +633,8 @@ public final class PhoneAccount implements Parcelable {
|
|||||||
.append(mAccountHandle)
|
.append(mAccountHandle)
|
||||||
.append(" Capabilities: ")
|
.append(" Capabilities: ")
|
||||||
.append(mCapabilities)
|
.append(mCapabilities)
|
||||||
|
.append(" Audio Routes: ")
|
||||||
|
.append(mSupportedAudioRoutes)
|
||||||
.append(" Schemes: ");
|
.append(" Schemes: ");
|
||||||
for (String scheme : mSupportedUriSchemes) {
|
for (String scheme : mSupportedUriSchemes) {
|
||||||
sb.append(scheme)
|
sb.append(scheme)
|
||||||
|
|||||||
Reference in New Issue
Block a user