diff options
Diffstat (limited to 'telecomm')
25 files changed, 208 insertions, 275 deletions
diff --git a/telecomm/java/android/telecom/AudioState.java b/telecomm/java/android/telecom/AudioState.java index 9c03319..465c5f4 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; @@ -25,9 +24,7 @@ import java.util.Locale; /** * Encapsulates the telecom audio state, including the current audio routing, supported audio * routing and mute. - * @hide */ -@SystemApi public final class AudioState implements Parcelable { /** Direct the audio stream through the device's earpiece. */ public static final int ROUTE_EARPIECE = 0x00000001; @@ -47,21 +44,13 @@ public final class AudioState implements Parcelable { */ public static final int ROUTE_WIRED_OR_EARPIECE = ROUTE_EARPIECE | ROUTE_WIRED_HEADSET; - /** Bit mask of all possible audio routes. - * - * @hide - */ - public static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET | + /** Bit mask of all possible audio routes. */ + private static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET | ROUTE_SPEAKER; - /** Note: Deprecated, please do not use if possible. */ - @SystemApi public final boolean isMuted; - - /** Note: Deprecated, please do not use if possible. */ - @SystemApi public final int route; - - /** Note: Deprecated, please do not use if possible. */ - @SystemApi public final int supportedRouteMask; + private final boolean isMuted; + private final int route; + private final int supportedRouteMask; public AudioState(boolean muted, int route, int supportedRouteMask) { this.isMuted = muted; @@ -97,7 +86,6 @@ public final class AudioState implements Parcelable { audioRouteToString(supportedRouteMask)); } - /** @hide */ public static String audioRouteToString(int route) { if (route == 0 || (route & ~ROUTE_ALL) != 0x0) { return "UNKNOWN"; diff --git a/telecomm/java/android/telecom/AuthenticatorService.java b/telecomm/java/android/telecom/AuthenticatorService.java index 39717c3..1e43c71 100644 --- a/telecomm/java/android/telecom/AuthenticatorService.java +++ b/telecomm/java/android/telecom/AuthenticatorService.java @@ -28,6 +28,8 @@ import android.os.IBinder; /** * A generic stub account authenticator service often used for sync adapters that do not directly * involve accounts. + * + * @hide */ public class AuthenticatorService extends Service { private static Authenticator mAuthenticator; diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index 5c891dc..2a9e539 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.net.Uri; import android.os.Bundle; @@ -30,10 +29,7 @@ import java.util.concurrent.CopyOnWriteArrayList; /** * Represents an ongoing phone call that the in-call app should present to the user. - * - * {@hide} */ -@SystemApi public final class Call { /** * The state of a {@code Call} when newly created. @@ -91,8 +87,6 @@ public final class Call { * The key to retrieve the optional {@code PhoneAccount}s Telecom can bundle with its Call * extras. Used to pass the phone accounts to display on the front end to the user in order to * select phone accounts to (for example) place a call. - * - * @hide */ public static final String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts"; @@ -142,40 +136,34 @@ public final class Call { /** * Local device supports receiving video. - * @hide */ public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 0x00000100; /** * Local device supports transmitting video. - * @hide */ public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 0x00000200; /** * Local device supports bidirectional video calling. - * @hide */ - public static final int CAPABILITY_SUPPORTS_VT_LOCAL = + public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = CAPABILITY_SUPPORTS_VT_LOCAL_RX | CAPABILITY_SUPPORTS_VT_LOCAL_TX; /** * Remote device supports receiving video. - * @hide */ public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 0x00000400; /** * Remote device supports transmitting video. - * @hide */ public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 0x00000800; /** * Remote device supports bidirectional video calling. - * @hide */ - public static final int CAPABILITY_SUPPORTS_VT_REMOTE = + public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = CAPABILITY_SUPPORTS_VT_REMOTE_RX | CAPABILITY_SUPPORTS_VT_REMOTE_TX; /** @@ -187,31 +175,25 @@ public final class Call { * Call is able to be individually disconnected when in a {@code Conference}. */ public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 0x00002000; - + /** * Whether the call is a generic conference, where we do not know the precise state of * participants in the conference (eg. on CDMA). - * - * @hide */ public static final int CAPABILITY_GENERIC_CONFERENCE = 0x00004000; /** * Call is using high definition audio. - * @hide */ public static final int CAPABILITY_HIGH_DEF_AUDIO = 0x00008000; /** * Call is using WIFI. - * @hide */ public static final int CAPABILITY_WIFI = 0x00010000; /** * Indicates that the current device callback number should be shown. - * - * @hide */ public static final int CAPABILITY_SHOW_CALLBACK_NUMBER = 0x00020000; @@ -259,7 +241,6 @@ public final class Call { * @param capabilities A bit field 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; @@ -270,7 +251,6 @@ public final class Call { * * @param capability The capability to check capabilities for. * @return Whether the specified capability is supported. - * @hide */ public boolean can(int capability) { return can(mCallCapabilities, capability); @@ -312,8 +292,8 @@ public final class Call { if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_TX)) { builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_TX"); } - if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL)) { - builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL"); + if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)) { + builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL"); } if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_RX)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_RX"); @@ -321,8 +301,8 @@ public final class Call { if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_TX)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_TX"); } - if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE)) { - builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE"); + if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL)) { + builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL"); } if (can(capabilities, CAPABILITY_HIGH_DEF_AUDIO)) { builder.append(" CAPABILITY_HIGH_DEF_AUDIO"); @@ -417,7 +397,7 @@ public final class Call { * periodically, but user interfaces should not rely on this to display any "call time * clock". */ - public long getConnectTimeMillis() { + public final long getConnectTimeMillis() { return mConnectTimeMillis; } @@ -593,7 +573,6 @@ public final class Call { * * @param call The {@code Call} invoking this method. * @param videoCall The {@code Call.VideoCall} associated with the {@code Call}. - * @hide */ public void onVideoCallChanged(Call call, InCallService.VideoCall videoCall) {} @@ -846,7 +825,6 @@ public final class Call { * Obtains an object that can be used to display video from this {@code Call}. * * @return An {@code Call.VideoCall}. - * @hide */ public InCallService.VideoCall getVideoCall() { return mVideoCall; @@ -925,7 +903,8 @@ public final class Call { Collections.unmodifiableList(parcelableCall.getCannedSmsResponses()); } - boolean videoCallChanged = !Objects.equals(mVideoCall, parcelableCall.getVideoCall()); + boolean videoCallChanged = parcelableCall.isVideoCallProviderChanged() && + !Objects.equals(mVideoCall, parcelableCall.getVideoCall()); if (videoCallChanged) { mVideoCall = parcelableCall.getVideoCall(); } diff --git a/telecomm/java/android/telecom/CallProperties.java b/telecomm/java/android/telecom/CallProperties.java index b1b82e2..1721a392e 100644 --- a/telecomm/java/android/telecom/CallProperties.java +++ b/telecomm/java/android/telecom/CallProperties.java @@ -18,7 +18,6 @@ package android.telecom; /** * Defines properties of a phone call which may be affected by changes to the call. - * @hide */ public class CallProperties { /** Call is currently in a conference call. */ diff --git a/telecomm/java/android/telecom/CallState.java b/telecomm/java/android/telecom/CallState.java index bd9223a..5584226 100644 --- a/telecomm/java/android/telecom/CallState.java +++ b/telecomm/java/android/telecom/CallState.java @@ -16,17 +16,12 @@ package android.telecom; -import android.annotation.SystemApi; - /** * Defines call-state constants of the different states in which a call can exist. Although states * have the notion of normal transitions, due to the volatile nature of telephony systems, code * that uses these states should be resilient to unexpected state changes outside of what is * considered traditional. - * - * {@hide} */ -@SystemApi public final class CallState { private CallState() {} diff --git a/telecomm/java/android/telecom/CameraCapabilities.java b/telecomm/java/android/telecom/CameraCapabilities.java index f968c13..6242956 100644 --- a/telecomm/java/android/telecom/CameraCapabilities.java +++ b/telecomm/java/android/telecom/CameraCapabilities.java @@ -21,43 +21,54 @@ import android.os.Parcelable; /** * Represents the camera capabilities important to a Video Telephony provider. - * @hide */ public final class CameraCapabilities implements Parcelable { /** - * Whether the camera supports zoom. + * The width of the camera video in pixels. */ - private final boolean mZoomSupported; + private final int mWidth; /** - * The maximum zoom supported by the camera. + * The height of the camera video in pixels. */ - private final float mMaxZoom; + private final int mHeight; /** - * The width of the camera video in pixels. + * Whether the camera supports zoom. */ - private final int mWidth; + private final boolean mZoomSupported; /** - * The height of the camera video in pixels. + * The maximum zoom supported by the camera. */ - private final int mHeight; + private final float mMaxZoom; /** * Create a call camera capabilities instance. * - * @param zoomSupported True when camera supports zoom. - * @param maxZoom Maximum zoom supported by camera. * @param width The width of the camera video (in pixels). * @param height The height of the camera video (in pixels). */ - public CameraCapabilities(boolean zoomSupported, float maxZoom, int width, int height) { - mZoomSupported = zoomSupported; - mMaxZoom = maxZoom; + public CameraCapabilities(int width, int height) { + this(width, height, false, 1.0f); + } + + /** + * Create a call camera capabilities instance that optionally + * supports zoom. + * + * @param width The width of the camera video (in pixels). + * @param height The height of the camera video (in pixels). + * @param zoomSupported True when camera supports zoom. + * @param maxZoom Maximum zoom supported by camera. + * @hide + */ + public CameraCapabilities(int width, int height, boolean zoomSupported, float maxZoom) { mWidth = width; mHeight = height; + mZoomSupported = zoomSupported; + mMaxZoom = maxZoom; } /** @@ -73,12 +84,12 @@ public final class CameraCapabilities implements Parcelable { */ @Override public CameraCapabilities createFromParcel(Parcel source) { - boolean supportsZoom = source.readByte() != 0; - float maxZoom = source.readFloat(); int width = source.readInt(); int height = source.readInt(); + boolean supportsZoom = source.readByte() != 0; + float maxZoom = source.readFloat(); - return new CameraCapabilities(supportsZoom, maxZoom, width, height); + return new CameraCapabilities(width, height, supportsZoom, maxZoom); } @Override @@ -108,37 +119,39 @@ public final class CameraCapabilities implements Parcelable { */ @Override public void writeToParcel(Parcel dest, int flags) { - dest.writeByte((byte) (isZoomSupported() ? 1 : 0)); - dest.writeFloat(getMaxZoom()); dest.writeInt(getWidth()); dest.writeInt(getHeight()); + dest.writeByte((byte) (isZoomSupported() ? 1 : 0)); + dest.writeFloat(getMaxZoom()); } /** - * Whether the camera supports zoom. + * The width of the camera video in pixels. */ - public boolean isZoomSupported() { - return mZoomSupported; + public int getWidth() { + return mWidth; } /** - * The maximum zoom supported by the camera. + * The height of the camera video in pixels. */ - public float getMaxZoom() { - return mMaxZoom; + public int getHeight() { + return mHeight; } /** - * The width of the camera video in pixels. + * Whether the camera supports zoom. + * @hide */ - public int getWidth() { - return mWidth; + public boolean isZoomSupported() { + return mZoomSupported; } /** - * The height of the camera video in pixels. + * The maximum zoom supported by the camera. + * @hide */ - public int getHeight() { - return mHeight; + public float getMaxZoom() { + return mMaxZoom; } } diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index ddaedcd..15a1da1 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.telecom.Connection.VideoProvider; import java.util.ArrayList; @@ -29,16 +28,14 @@ import java.util.concurrent.CopyOnWriteArraySet; /** * Represents a conference call which can contain any number of {@link Connection} objects. - * @hide */ -@SystemApi public abstract class Conference implements IConferenceable { /** * Used to indicate that the conference connection time is not specified. If not specified, * Telecom will set the connect time. */ - public static long CONNECT_TIME_NOT_SPECIFIED = 0; + public static final long CONNECT_TIME_NOT_SPECIFIED = 0; /** @hide */ public abstract static class Listener { @@ -63,7 +60,7 @@ public abstract class Conference implements IConferenceable { private final List<Connection> mUnmodifiableConferenceableConnections = Collections.unmodifiableList(mConferenceableConnections); - protected PhoneAccountHandle mPhoneAccount; + private PhoneAccountHandle mPhoneAccount; private AudioState mAudioState; private int mState = Connection.STATE_NEW; private DisconnectCause mDisconnectCause; @@ -116,11 +113,6 @@ public abstract class Conference implements IConferenceable { return mState; } - /** @hide */ - @Deprecated public final int getCapabilities() { - return getConnectionCapabilities(); - } - /** * Returns the capabilities of a conference. See {@code CAPABILITY_*} constants in class * {@link Connection} for valid values. @@ -301,11 +293,6 @@ public abstract class Conference implements IConferenceable { return mDisconnectCause; } - /** @hide */ - @Deprecated public final void setCapabilities(int connectionCapabilities) { - setConnectionCapabilities(connectionCapabilities); - } - /** * Sets the capabilities of a conference. See {@code CAPABILITY_*} constants of class * {@link Connection} for valid values. @@ -497,7 +484,7 @@ public abstract class Conference implements IConferenceable { * * @return The time the {@code Conference} has been connected. */ - public long getConnectTimeMillis() { + public final long getConnectTimeMillis() { return mConnectTimeMillis; } diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 26f5043..99fc6b9 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; @@ -29,6 +28,7 @@ import android.view.Surface; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -44,9 +44,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 implements IConferenceable { public static final int STATE_INITIALIZING = 0; @@ -121,7 +119,7 @@ public abstract class Connection implements IConferenceable { * Local device supports bidirectional video calling. * @hide */ - public static final int CAPABILITY_SUPPORTS_VT_LOCAL = + public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = CAPABILITY_SUPPORTS_VT_LOCAL_RX | CAPABILITY_SUPPORTS_VT_LOCAL_TX; /** @@ -140,7 +138,7 @@ public abstract class Connection implements IConferenceable { * Remote device supports bidirectional video calling. * @hide */ - public static final int CAPABILITY_SUPPORTS_VT_REMOTE = + public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = CAPABILITY_SUPPORTS_VT_REMOTE_RX | CAPABILITY_SUPPORTS_VT_REMOTE_TX; /** @@ -322,8 +320,8 @@ public abstract class Connection implements IConferenceable { if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_TX)) { builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_TX"); } - if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL)) { - builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL"); + if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)) { + builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL"); } if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_RX)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_RX"); @@ -331,8 +329,8 @@ public abstract class Connection implements IConferenceable { if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_TX)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_TX"); } - if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE)) { - builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE"); + if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL)) { + builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL"); } if (can(capabilities, CAPABILITY_HIGH_DEF_AUDIO)) { builder.append(" CAPABILITY_HIGH_DEF_AUDIO"); @@ -386,7 +384,6 @@ public abstract class Connection implements IConferenceable { public void onCallSubstateChanged(Connection c, int substate) {} } - /** @hide */ public static abstract class VideoProvider { /** @@ -449,7 +446,7 @@ public abstract class Connection implements IConferenceable { */ public static final int SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE = 5; - private static final int MSG_SET_VIDEO_CALLBACK = 1; + private static final int MSG_ADD_VIDEO_CALLBACK = 1; private static final int MSG_SET_CAMERA = 2; private static final int MSG_SET_PREVIEW_SURFACE = 3; private static final int MSG_SET_DISPLAY_SURFACE = 4; @@ -460,11 +457,16 @@ public abstract class Connection implements IConferenceable { private static final int MSG_REQUEST_CAMERA_CAPABILITIES = 9; private static final int MSG_REQUEST_CONNECTION_DATA_USAGE = 10; private static final int MSG_SET_PAUSE_IMAGE = 11; + private static final int MSG_REMOVE_VIDEO_CALLBACK = 12; private final VideoProvider.VideoProviderHandler mMessageHandler = new VideoProvider.VideoProviderHandler(); private final VideoProvider.VideoProviderBinder mBinder; - private IVideoCallback mVideoCallback; + + /** + * Stores a list of the video callbacks, keyed by IBinder. + */ + private HashMap<IBinder, IVideoCallback> mVideoCallbacks = new HashMap<>(); /** * Default handler used to consolidate binder method calls onto a single thread. @@ -473,9 +475,29 @@ public abstract class Connection implements IConferenceable { @Override public void handleMessage(Message msg) { switch (msg.what) { - case MSG_SET_VIDEO_CALLBACK: - mVideoCallback = IVideoCallback.Stub.asInterface((IBinder) msg.obj); + case MSG_ADD_VIDEO_CALLBACK: { + IBinder binder = (IBinder) msg.obj; + IVideoCallback callback = IVideoCallback.Stub + .asInterface((IBinder) msg.obj); + if (mVideoCallbacks.containsKey(binder)) { + Log.i(this, "addVideoProvider - skipped; already present."); + break; + } + mVideoCallbacks.put(binder, callback); + Log.i(this, "addVideoProvider "+ mVideoCallbacks.size()); break; + } + case MSG_REMOVE_VIDEO_CALLBACK: { + IBinder binder = (IBinder) msg.obj; + IVideoCallback callback = IVideoCallback.Stub + .asInterface((IBinder) msg.obj); + if (!mVideoCallbacks.containsKey(binder)) { + Log.i(this, "removeVideoProvider - skipped; not present."); + break; + } + mVideoCallbacks.remove(binder); + break; + } case MSG_SET_CAMERA: onSetCamera((String) msg.obj); break; @@ -516,9 +538,14 @@ public abstract class Connection implements IConferenceable { * IVideoProvider stub implementation. */ private final class VideoProviderBinder extends IVideoProvider.Stub { - public void setVideoCallback(IBinder videoCallbackBinder) { + public void addVideoCallback(IBinder videoCallbackBinder) { + mMessageHandler.obtainMessage( + MSG_ADD_VIDEO_CALLBACK, videoCallbackBinder).sendToTarget(); + } + + public void removeVideoCallback(IBinder videoCallbackBinder) { mMessageHandler.obtainMessage( - MSG_SET_VIDEO_CALLBACK, videoCallbackBinder).sendToTarget(); + MSG_REMOVE_VIDEO_CALLBACK, videoCallbackBinder).sendToTarget(); } public void setCamera(String cameraId) { @@ -656,21 +683,23 @@ public abstract class Connection implements IConferenceable { public abstract void onSetPauseImage(String uri); /** - * Invokes callback method defined in In-Call UI. + * Invokes callback method defined in listening {@link InCallService} implementations. * * @param videoProfile The requested video connection profile. */ public void receiveSessionModifyRequest(VideoProfile videoProfile) { - if (mVideoCallback != null) { + if (mVideoCallbacks != null) { try { - mVideoCallback.receiveSessionModifyRequest(videoProfile); + for (IVideoCallback callback : mVideoCallbacks.values()) { + callback.receiveSessionModifyRequest(videoProfile); + } } catch (RemoteException ignored) { } } } /** - * Invokes callback method defined in In-Call UI. + * Invokes callback method defined in listening {@link InCallService} implementations. * * @param status Status of the session modify request. Valid values are * {@link VideoProvider#SESSION_MODIFY_REQUEST_SUCCESS}, @@ -681,17 +710,19 @@ public abstract class Connection implements IConferenceable { */ public void receiveSessionModifyResponse(int status, VideoProfile requestedProfile, VideoProfile responseProfile) { - if (mVideoCallback != null) { + if (mVideoCallbacks != null) { try { - mVideoCallback.receiveSessionModifyResponse( - status, requestedProfile, responseProfile); + for (IVideoCallback callback : mVideoCallbacks.values()) { + callback.receiveSessionModifyResponse(status, requestedProfile, + responseProfile); + } } catch (RemoteException ignored) { } } } /** - * Invokes callback method defined in In-Call UI. + * Invokes callback method defined in listening {@link InCallService} implementations. * * Valid values are: {@link VideoProvider#SESSION_EVENT_RX_PAUSE}, * {@link VideoProvider#SESSION_EVENT_RX_RESUME}, @@ -701,66 +732,76 @@ public abstract class Connection implements IConferenceable { * @param event The event. */ public void handleCallSessionEvent(int event) { - if (mVideoCallback != null) { + if (mVideoCallbacks != null) { try { - mVideoCallback.handleCallSessionEvent(event); + for (IVideoCallback callback : mVideoCallbacks.values()) { + callback.handleCallSessionEvent(event); + } } catch (RemoteException ignored) { } } } /** - * Invokes callback method defined in In-Call UI. + * Invokes callback method defined in listening {@link InCallService} implementations. * * @param width The updated peer video width. * @param height The updated peer video height. */ public void changePeerDimensions(int width, int height) { - if (mVideoCallback != null) { + if (mVideoCallbacks != null) { try { - mVideoCallback.changePeerDimensions(width, height); + for (IVideoCallback callback : mVideoCallbacks.values()) { + callback.changePeerDimensions(width, height); + } } catch (RemoteException ignored) { } } } /** - * Invokes callback method defined in In-Call UI. + * Invokes callback method defined in listening {@link InCallService} implementations. * * @param dataUsage The updated data usage. */ public void changeCallDataUsage(long dataUsage) { - if (mVideoCallback != null) { + if (mVideoCallbacks != null) { try { - mVideoCallback.changeCallDataUsage(dataUsage); + for (IVideoCallback callback : mVideoCallbacks.values()) { + callback.changeCallDataUsage(dataUsage); + } } catch (RemoteException ignored) { } } } /** - * Invokes callback method defined in In-Call UI. + * Invokes callback method defined in listening {@link InCallService} implementations. * * @param cameraCapabilities The changed camera capabilities. */ public void changeCameraCapabilities(CameraCapabilities cameraCapabilities) { - if (mVideoCallback != null) { + if (mVideoCallbacks != null) { try { - mVideoCallback.changeCameraCapabilities(cameraCapabilities); + for (IVideoCallback callback : mVideoCallbacks.values()) { + callback.changeCameraCapabilities(cameraCapabilities); + } } catch (RemoteException ignored) { } } } /** - * Invokes callback method defined in In-Call UI. + * Invokes callback method defined in listening {@link InCallService} implementations. * * @param videoQuality The updated video quality. */ public void changeVideoQuality(int videoQuality) { - if (mVideoCallback != null) { + if (mVideoCallbacks != null) { try { - mVideoCallback.changeVideoQuality(videoQuality); + for (IVideoCallback callback : mVideoCallbacks.values()) { + callback.changeVideoQuality(videoQuality); + } } catch (RemoteException ignored) { } } @@ -1004,11 +1045,6 @@ public abstract class Connection implements IConferenceable { return mConnectionCapabilities; } - /** @hide */ - @SystemApi @Deprecated public final int getCallCapabilities() { - return getConnectionCapabilities(); - } - /** * Sets the value of the {@link #getAddress()} property. * @@ -1144,7 +1180,6 @@ public abstract class Connection implements IConferenceable { } } - /** @hide */ public final VideoProvider getVideoProvider() { return mVideoProvider; } @@ -1215,11 +1250,6 @@ public abstract class Connection implements IConferenceable { } } - /** @hide */ - @SystemApi @Deprecated public final void setCallCapabilities(int connectionCapabilities) { - setConnectionCapabilities(connectionCapabilities); - } - /** * Sets the connection's capabilities as a bit mask of the {@code CAPABILITY_*} constants. * @@ -1609,6 +1639,7 @@ public abstract class Connection implements IConferenceable { /** * Notifies listeners that a conference call has been started. + * @hide */ protected void notifyConferenceStarted() { for (Listener l : mListeners) { 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 0c719cd..e36d32b 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -17,7 +17,6 @@ package android.telecom; import android.annotation.SdkConstant; -import android.annotation.SystemApi; import android.app.Service; import android.content.ComponentName; import android.content.Intent; @@ -72,9 +71,7 @@ import java.util.concurrent.ConcurrentHashMap; * receives call-commands such as answer, reject, hold and disconnect. * <p> * When there are no more live calls, telecom will unbind from the {@code ConnectionService}. - * @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 130d676..73bcd0c 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; @@ -30,9 +29,7 @@ import java.util.Objects; * user. It is the responsibility of the {@link ConnectionService} to provide localized versions of * the label and description. It also may contain a reason for 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 5b8e4ab..928570e 100644 --- a/telecomm/java/android/telecom/GatewayInfo.java +++ b/telecomm/java/android/telecom/GatewayInfo.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; @@ -34,17 +33,13 @@ import android.text.TextUtils; * <li> Call the appropriate gateway address. * <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; private final Uri mGatewayAddress; private final Uri mOriginalAddress; - /** @hide */ - @SystemApi public GatewayInfo(String packageName, Uri gatewayUri, Uri originalAddress) { mGatewayProviderPackageName = packageName; mGatewayAddress = gatewayUri; diff --git a/telecomm/java/android/telecom/IConferenceable.java b/telecomm/java/android/telecom/IConferenceable.java index 095d7cb..a9be20b 100644 --- a/telecomm/java/android/telecom/IConferenceable.java +++ b/telecomm/java/android/telecom/IConferenceable.java @@ -16,16 +16,11 @@ package android.telecom; -import android.annotation.SystemApi; - /** * Interface used to identify entities with which another entity can participate in a conference * call with. The {@link ConnectionService} implementation will only recognize * {@link IConferenceable}s which are {@link Connection}s or {@link Conference}s. - * - * @hide */ -@SystemApi public interface IConferenceable { } diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java index c0c59fa..6691d11 100644 --- a/telecomm/java/android/telecom/InCallService.java +++ b/telecomm/java/android/telecom/InCallService.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.annotation.SdkConstant; import android.app.Service; import android.content.Intent; @@ -36,10 +35,7 @@ import java.lang.String; * This service is implemented by any app that wishes to provide the user-interface for managing * phone calls. Telecom 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. - * - * {@hide} */ -@SystemApi public abstract class InCallService extends Service { /** @@ -177,7 +173,7 @@ public abstract class InCallService extends Service { * if the {@code InCallService} is not in a state where it has an associated * {@code Phone}. */ - public Phone getPhone() { + public final Phone getPhone() { return mPhone; } @@ -205,7 +201,6 @@ public abstract class InCallService extends Service { /** * Class to invoke functionality related to video calls. - * @hide */ public static abstract class VideoCall { @@ -218,6 +213,11 @@ public abstract class InCallService extends Service { public abstract void setVideoCallListener(VideoCall.Listener videoCallListener); /** + * Clears the video call listener set via {@link #setVideoCallListener(Listener)}. + */ + public abstract void removeVideoCallListener(); + + /** * Sets the camera to be used for video recording in a video call. * * @param cameraId The id of the camera. @@ -302,7 +302,6 @@ public abstract class InCallService extends Service { /** * Listener class which invokes callbacks after video call actions occur. - * @hide */ public static abstract class Listener { /** diff --git a/telecomm/java/android/telecom/ParcelableCall.java b/telecomm/java/android/telecom/ParcelableCall.java index adc648f..bf6c318 100644 --- a/telecomm/java/android/telecom/ParcelableCall.java +++ b/telecomm/java/android/telecom/ParcelableCall.java @@ -46,6 +46,7 @@ public final class ParcelableCall implements Parcelable { private final int mCallerDisplayNamePresentation; private final GatewayInfo mGatewayInfo; private final PhoneAccountHandle mAccountHandle; + private final boolean mIsVideoCallProviderChanged; private final IVideoProvider mVideoCallProvider; private InCallService.VideoCall mVideoCall; private final String mParentCallId; @@ -70,6 +71,7 @@ public final class ParcelableCall implements Parcelable { int callerDisplayNamePresentation, GatewayInfo gatewayInfo, PhoneAccountHandle accountHandle, + boolean isVideoCallProviderChanged, IVideoProvider videoCallProvider, String parentCallId, List<String> childCallIds, @@ -91,6 +93,7 @@ public final class ParcelableCall implements Parcelable { mCallerDisplayNamePresentation = callerDisplayNamePresentation; mGatewayInfo = gatewayInfo; mAccountHandle = accountHandle; + mIsVideoCallProviderChanged = isVideoCallProviderChanged; mVideoCallProvider = videoCallProvider; mParentCallId = parentCallId; mChildCallIds = childCallIds; @@ -243,6 +246,18 @@ public final class ParcelableCall implements Parcelable { return mCallSubstate; } + /** + * Indicates to the receiver of the {@link ParcelableCall} whether a change has occurred in the + * {@link android.telecom.InCallService.VideoCall} associated with this call. Since + * {@link #getVideoCall()} creates a new {@link VideoCallImpl}, it is useful to know whether + * the provider has changed (which can influence whether it is accessed). + * + * @return {@code true} if the video call changed, {@code false} otherwise. + */ + public boolean isVideoCallProviderChanged() { + return mIsVideoCallProviderChanged; + } + /** Responsible for creating ParcelableCall objects for deserialized Parcels. */ public static final Parcelable.Creator<ParcelableCall> CREATOR = new Parcelable.Creator<ParcelableCall> () { @@ -263,6 +278,7 @@ public final class ParcelableCall implements Parcelable { int callerDisplayNamePresentation = source.readInt(); GatewayInfo gatewayInfo = source.readParcelable(classLoader); PhoneAccountHandle accountHandle = source.readParcelable(classLoader); + boolean isVideoCallProviderChanged = source.readByte() == 1; IVideoProvider videoCallProvider = IVideoProvider.Stub.asInterface(source.readStrongBinder()); String parentCallId = source.readString(); @@ -288,6 +304,7 @@ public final class ParcelableCall implements Parcelable { callerDisplayNamePresentation, gatewayInfo, accountHandle, + isVideoCallProviderChanged, videoCallProvider, parentCallId, childCallIds, @@ -326,6 +343,7 @@ public final class ParcelableCall implements Parcelable { destination.writeInt(mCallerDisplayNamePresentation); destination.writeParcelable(mGatewayInfo, 0); destination.writeParcelable(mAccountHandle, 0); + destination.writeByte((byte) (mIsVideoCallProviderChanged ? 1 : 0)); destination.writeStrongBinder( mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null); destination.writeString(mParentCallId); diff --git a/telecomm/java/android/telecom/Phone.java b/telecomm/java/android/telecom/Phone.java index 6344181..d456dfa 100644 --- a/telecomm/java/android/telecom/Phone.java +++ b/telecomm/java/android/telecom/Phone.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.util.ArrayMap; import java.util.Collections; @@ -27,10 +26,7 @@ import java.util.concurrent.CopyOnWriteArrayList; /** * A unified virtual device providing a means of voice (and other) communication on a device. - * - * {@hide} */ -@SystemApi public final class Phone { public abstract static class Listener { @@ -123,6 +119,11 @@ public final class Phone { final void internalRemoveCall(Call call) { mCallByTelecomCallId.remove(call.internalGetCallId()); mCalls.remove(call); + + InCallService.VideoCall videoCall = call.getVideoCall(); + if (videoCall != null) { + videoCall.removeVideoCallListener(); + } fireCallRemoved(call); } @@ -175,6 +176,10 @@ public final class Phone { */ final void destroy() { for (Call call : mCalls) { + InCallService.VideoCall videoCall = call.getVideoCall(); + if (videoCall != null) { + videoCall.removeVideoCallListener(); + } if (call.getState() != Call.STATE_DISCONNECTED) { call.internalSetDisconnected(); } @@ -244,6 +249,8 @@ public final class Phone { * become active, and the touch screen and display will be turned off when the user's face * is detected to be in close proximity to the screen. This operation is a no-op on devices * that do not have a proximity sensor. + * + * @hide */ public final void setProximitySensorOn() { mInCallAdapter.turnProximitySensorOn(); @@ -257,6 +264,8 @@ public final class Phone { * @param screenOnImmediately If true, the screen will be turned on immediately if it was * previously off. Otherwise, the screen will only be turned on after the proximity sensor * is no longer triggered. + * + * @hide */ public final void setProximitySensorOff(boolean screenOnImmediately) { mInCallAdapter.turnProximitySensorOff(screenOnImmediately); diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index a94c2f6..00d170f 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -60,9 +60,7 @@ public class PhoneAccount implements Parcelable { * if the user has explicitly selected it to be used as the default connection manager. * <p> * See {@link #getCapabilities} - * @hide */ - @SystemApi public static final int CAPABILITY_CONNECTION_MANAGER = 0x1; /** @@ -74,9 +72,7 @@ public class PhoneAccount implements Parcelable { * <p> * See {@link #getCapabilities} * <p> - * {@hide} */ - @SystemApi public static final int CAPABILITY_CALL_PROVIDER = 0x2; /** @@ -205,13 +201,6 @@ public class PhoneAccount implements Parcelable { mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes()); } - /** @hide */ - @SystemApi - public Builder setAccountHandle(PhoneAccountHandle accountHandle) { - mAccountHandle = accountHandle; - return this; - } - /** * Sets the address. See {@link PhoneAccount#getAddress}. * @@ -335,9 +324,7 @@ public class PhoneAccount implements Parcelable { * * @param uriScheme The URI scheme. * @return The builder. - * @hide */ - @SystemApi public Builder addSupportedUriScheme(String uriScheme) { if (!TextUtils.isEmpty(uriScheme) && !mSupportedUriSchemes.contains(uriScheme)) { this.mSupportedUriSchemes.add(uriScheme); @@ -426,9 +413,7 @@ public class PhoneAccount implements Parcelable { * Returns a builder initialized with the current {@link PhoneAccount} instance. * * @return The builder. - * @hide */ - @SystemApi public Builder toBuilder() { return new Builder(this); } /** diff --git a/telecomm/java/android/telecom/PhoneAccountHandle.java b/telecomm/java/android/telecom/PhoneAccountHandle.java index 4600b72..60917b2 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; @@ -47,8 +46,6 @@ public class PhoneAccountHandle implements Parcelable { this(componentName, id, Process.myUserHandle()); } - /** @hide */ - @SystemApi public PhoneAccountHandle( ComponentName componentName, String id, @@ -91,9 +88,7 @@ public class PhoneAccountHandle implements Parcelable { /** * @return the {@link UserHandle} to use when connecting to this PhoneAccount. - * @hide */ - @SystemApi public UserHandle getUserHandle() { return mUserHandle; } diff --git a/telecomm/java/android/telecom/RemoteConference.java b/telecomm/java/android/telecom/RemoteConference.java index a8879ae..fba3ee3 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 { @@ -164,11 +161,6 @@ public final class RemoteConference { return mState; } - /** @hide */ - @Deprecated public final int getCallCapabilities() { - return getConnectionCapabilities(); - } - public final int getConnectionCapabilities() { return mConnectionCapabilities; } diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java index be7a0a0..eec8076 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 { @@ -73,11 +70,6 @@ public final class RemoteConnection { */ public void onRingbackRequested(RemoteConnection connection, boolean ringback) {} - /** @hide */ - @Deprecated public void onCallCapabilitiesChanged( - RemoteConnection connection, - int callCapabilities) {} - /** * Indicates that the call capabilities of this {@code RemoteConnection} have changed. * See {@link #getConnectionCapabilities()}. @@ -319,7 +311,7 @@ public final class RemoteConnection { public VideoProvider(IVideoProvider videoProviderBinder) { mVideoProviderBinder = videoProviderBinder; try { - mVideoProviderBinder.setVideoCallback(mVideoCallbackServant.getStub().asBinder()); + mVideoProviderBinder.addVideoCallback(mVideoCallbackServant.getStub().asBinder()); } catch (RemoteException e) { } } @@ -870,7 +862,6 @@ public final class RemoteConnection { mConnectionCapabilities = connectionCapabilities; for (Callback c : mCallbacks) { c.onConnectionCapabilitiesChanged(this, connectionCapabilities); - c.onCallCapabilitiesChanged(this, connectionCapabilities); } } 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 8be3e66..c73f6c2 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -55,8 +55,6 @@ public class TelecomManager { * Input: get*Extra field {@link #EXTRA_PHONE_ACCOUNT_HANDLE} contains the component name of the * {@link android.telecom.ConnectionService} that Telecom should bind to. Telecom will then * ask the connection service for more information about the call prior to showing any UI. - * - * @hide */ public static final String ACTION_INCOMING_CALL = "android.telecom.action.INCOMING_CALL"; @@ -85,9 +83,7 @@ public class TelecomManager { /** * The {@link android.content.Intent} action used to show the settings page used to configure * {@link PhoneAccount} preferences. - * @hide */ - @SystemApi public static final String ACTION_CHANGE_PHONE_ACCOUNTS = "android.telecom.action.CHANGE_PHONE_ACCOUNTS"; @@ -133,10 +129,7 @@ public class TelecomManager { * 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}. - * - * @hide */ - @SystemApi public static final String EXTRA_INCOMING_CALL_EXTRAS = "android.telecom.extra.INCOMING_CALL_EXTRAS"; @@ -209,9 +202,7 @@ 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 */ - @SystemApi public static final String EXTRA_CALL_BACK_NUMBER = "android.telecom.extra.CALL_BACK_NUMBER"; /** @@ -352,9 +343,7 @@ public class TelecomManager { * @param uriScheme The URI scheme. * @return The {@link PhoneAccountHandle} corresponding to the user-chosen default for outgoing * phone calls for a specified URI scheme. - * @hide */ - @SystemApi public PhoneAccountHandle getDefaultOutgoingPhoneAccount(String uriScheme) { try { if (isServiceConnected()) { @@ -407,7 +396,6 @@ public class TelecomManager { * {@code null}, indicating that there currently exists no user-chosen default * {@code PhoneAccount}. * @return The phone account handle of the current sim call manager. - * @hide */ public PhoneAccountHandle getSimCallManager() { try { @@ -506,8 +494,6 @@ public class TelecomManager { * * @see #EXTRA_PHONE_ACCOUNT_HANDLE * @return A list of {@code PhoneAccountHandle} objects. - * - * @hide */ public List<PhoneAccountHandle> getCallCapablePhoneAccounts() { try { @@ -521,19 +507,6 @@ public class TelecomManager { } /** - * Determine whether the device has more than one account registered that can make and receive - * phone calls. - * - * @return {@code true} if the device has more than one account registered and {@code false} - * otherwise. - * @hide - */ - @SystemApi - public boolean hasMultipleCallCapableAccounts() { - return getCallCapablePhoneAccounts().size() > 1; - } - - /** * Returns a list of all {@link PhoneAccount}s registered for the calling package. * * @return A list of {@code PhoneAccountHandle} objects. @@ -636,10 +609,7 @@ public class TelecomManager { * {@link PhoneAccountHandle#getComponentName()} does not match the package name of the app. * * @param account The complete {@link PhoneAccount}. - * - * @hide */ - @SystemApi public void registerPhoneAccount(PhoneAccount account) { try { if (isServiceConnected()) { @@ -654,9 +624,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()) { @@ -672,6 +640,15 @@ public class TelecomManager { * @hide */ @SystemApi + public void clearPhoneAccounts() { + clearAccounts(); + } + /** + * Remove all Accounts that belong to the calling package from the system. + * @deprecated Use {@link #clearPhoneAccounts()} instead. + * @hide + */ + @SystemApi public void clearAccounts() { try { if (isServiceConnected()) { @@ -717,10 +694,7 @@ public class TelecomManager { * * @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()) { @@ -737,10 +711,7 @@ public class TelecomManager { * * @param accountHandle The handle for the account to check for a voicemail number. * @return {@code true} If the given phone account has a voicemail number. - * - * @hide */ - @SystemApi public boolean hasVoiceMailNumber(PhoneAccountHandle accountHandle) { try { if (isServiceConnected()) { @@ -757,10 +728,7 @@ public class TelecomManager { * * @param accountHandle The handle for the account retrieve a number for. * @return A string representation of the line 1 phone number. - * - * @hide */ - @SystemApi public String getLine1Number(PhoneAccountHandle accountHandle) { try { if (isServiceConnected()) { @@ -870,10 +838,7 @@ public class TelecomManager { /** * Silences the ringer if a ringing call exists. - * - * @hide */ - @SystemApi public void silenceRinger() { try { if (isServiceConnected()) { @@ -934,9 +899,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()) { @@ -1006,10 +969,8 @@ public class TelecomManager { * @param accountHandle The handle for the account the MMI code should apply to. * @param dialString The digits to dial. * @return True if the digits were processed as an MMI code, false otherwise. - * @hide */ - @SystemApi - public boolean handleMmi(PhoneAccountHandle accountHandle, String dialString) { + public boolean handleMmi(String dialString, PhoneAccountHandle accountHandle) { ITelecomService service = getTelecomService(); if (service != null) { try { @@ -1026,9 +987,7 @@ public class TelecomManager { * {@code null} to return a URI which will use the default account. * @return The URI (with the content:// scheme) specific to the specified {@link PhoneAccount} * for the the content retrieve. - * @hide */ - @SystemApi public Uri getAdnUriForPhoneAccount(PhoneAccountHandle accountHandle) { ITelecomService service = getTelecomService(); if (service != null && accountHandle != null) { diff --git a/telecomm/java/android/telecom/VideoCallImpl.java b/telecomm/java/android/telecom/VideoCallImpl.java index 0445448..fa2dbb1 100644 --- a/telecomm/java/android/telecom/VideoCallImpl.java +++ b/telecomm/java/android/telecom/VideoCallImpl.java @@ -166,7 +166,7 @@ public class VideoCallImpl extends VideoCall { mVideoProvider.asBinder().linkToDeath(mDeathRecipient, 0); mBinder = new VideoCallListenerBinder(); - mVideoProvider.setVideoCallback(mBinder); + mVideoProvider.addVideoCallback(mBinder); } /** {@inheritDoc} */ @@ -175,6 +175,15 @@ public class VideoCallImpl extends VideoCall { } /** {@inheritDoc} */ + public void removeVideoCallListener() { + mVideoCallListener = null; + try { + mVideoProvider.removeVideoCallback(mBinder); + } catch (RemoteException e) { + } + } + + /** {@inheritDoc} */ public void setCamera(String cameraId) { try { mVideoProvider.setCamera(cameraId); diff --git a/telecomm/java/android/telecom/Voicemail.java b/telecomm/java/android/telecom/Voicemail.java index 864c6b1..dbec2ad 100644 --- a/telecomm/java/android/telecom/Voicemail.java +++ b/telecomm/java/android/telecom/Voicemail.java @@ -22,6 +22,8 @@ import android.os.Parcelable; /** * Represents a single voicemail stored in the voicemail content provider. + * + * @hide */ public class Voicemail implements Parcelable { private final Long mTimestamp; @@ -263,4 +265,4 @@ public class Voicemail implements Parcelable { mIsRead = in.readInt() > 0 ? true : false; mHasContent = in.readInt() > 0 ? true : false; } -}
\ No newline at end of file +} diff --git a/telecomm/java/com/android/internal/telecom/IVideoProvider.aidl b/telecomm/java/com/android/internal/telecom/IVideoProvider.aidl index e96d9d3..bff3865 100644 --- a/telecomm/java/com/android/internal/telecom/IVideoProvider.aidl +++ b/telecomm/java/com/android/internal/telecom/IVideoProvider.aidl @@ -25,7 +25,9 @@ import android.telecom.VideoProfile; * @hide */ oneway interface IVideoProvider { - void setVideoCallback(IBinder videoCallbackBinder); + void addVideoCallback(IBinder videoCallbackBinder); + + void removeVideoCallback(IBinder videoCallbackBinder); void setCamera(String cameraId); |