From df2cbc8989e624cd6a1d732549ea4a4f00852508 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Mon, 20 Apr 2015 09:13:01 -0700 Subject: [PATCH] API Cleanup - rename IConferenceable to Conferenceable. Bug: 20165255 Change-Id: If4cb323749b6ef9e8657506434d760d07c34167f --- api/current.txt | 14 +++++----- api/system-current.txt | 14 +++++----- telecomm/java/android/telecom/Conference.java | 2 +- .../java/android/telecom/Conferenceable.java | 26 +++++++++++++++++++ telecomm/java/android/telecom/Connection.java | 16 ++++++------ .../android/telecom/ConnectionService.java | 10 +++---- .../java/android/telecom/IConferenceable.java | 8 +++--- 7 files changed, 59 insertions(+), 31 deletions(-) create mode 100644 telecomm/java/android/telecom/Conferenceable.java diff --git a/api/current.txt b/api/current.txt index c18eafbcc75da..4280b6c103b05 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29993,7 +29993,7 @@ package android.telecom { field public static final android.os.Parcelable.Creator CREATOR; } - public abstract class Conference implements android.telecom.IConferenceable { + public abstract class Conference implements android.telecom.Conferenceable { ctor public Conference(android.telecom.PhoneAccountHandle); method public final boolean addConnection(android.telecom.Connection); method public final void destroy(); @@ -30027,7 +30027,10 @@ package android.telecom { field public static final long CONNECT_TIME_NOT_SPECIFIED = 0L; // 0x0L } - public abstract class Connection implements android.telecom.IConferenceable { + public abstract interface Conferenceable { + } + + public abstract class Connection implements android.telecom.Conferenceable { ctor public Connection(); method public static java.lang.String capabilitiesToString(int); method public static android.telecom.Connection createCanceledConnection(); @@ -30040,7 +30043,7 @@ package android.telecom { method public final java.lang.String getCallerDisplayName(); method public final int getCallerDisplayNamePresentation(); method public final android.telecom.Conference getConference(); - method public final java.util.List getConferenceables(); + method public final java.util.List getConferenceables(); method public final int getConnectionCapabilities(); method public final android.telecom.DisconnectCause getDisconnectCause(); method public final int getState(); @@ -30064,7 +30067,7 @@ package android.telecom { method public final void setAudioModeIsVoip(boolean); method public final void setCallerDisplayName(java.lang.String, int); method public final void setConferenceableConnections(java.util.List); - method public final void setConferenceables(java.util.List); + method public final void setConferenceables(java.util.List); method public final void setConnectionCapabilities(int); method public final void setConnectionService(android.telecom.ConnectionService); method public final void setDialing(); @@ -30192,9 +30195,6 @@ package android.telecom { field public static final android.os.Parcelable.Creator CREATOR; } - public abstract interface IConferenceable { - } - public abstract class InCallService extends android.app.Service { ctor public InCallService(); method public final android.telecom.Phone getPhone(); diff --git a/api/system-current.txt b/api/system-current.txt index 256a12f82b4d7..a4733f514a7a8 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -32093,7 +32093,7 @@ package android.telecom { field public static final android.os.Parcelable.Creator CREATOR; } - public abstract class Conference implements android.telecom.IConferenceable { + public abstract class Conference implements android.telecom.Conferenceable { ctor public Conference(android.telecom.PhoneAccountHandle); method public final boolean addConnection(android.telecom.Connection); method public final void destroy(); @@ -32127,7 +32127,10 @@ package android.telecom { field public static final long CONNECT_TIME_NOT_SPECIFIED = 0L; // 0x0L } - public abstract class Connection implements android.telecom.IConferenceable { + public abstract interface Conferenceable { + } + + public abstract class Connection implements android.telecom.Conferenceable { ctor public Connection(); method public static java.lang.String capabilitiesToString(int); method public static android.telecom.Connection createCanceledConnection(); @@ -32140,7 +32143,7 @@ package android.telecom { method public final java.lang.String getCallerDisplayName(); method public final int getCallerDisplayNamePresentation(); method public final android.telecom.Conference getConference(); - method public final java.util.List getConferenceables(); + method public final java.util.List getConferenceables(); method public final int getConnectionCapabilities(); method public final android.telecom.DisconnectCause getDisconnectCause(); method public final int getState(); @@ -32164,7 +32167,7 @@ package android.telecom { method public final void setAudioModeIsVoip(boolean); method public final void setCallerDisplayName(java.lang.String, int); method public final void setConferenceableConnections(java.util.List); - method public final void setConferenceables(java.util.List); + method public final void setConferenceables(java.util.List); method public final void setConnectionCapabilities(int); method public final void setConnectionService(android.telecom.ConnectionService); method public final void setDialing(); @@ -32292,9 +32295,6 @@ package android.telecom { field public static final android.os.Parcelable.Creator CREATOR; } - public abstract interface IConferenceable { - } - public abstract class InCallService extends android.app.Service { ctor public InCallService(); method public final android.telecom.Phone getPhone(); diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index 15a1da114cdf4..bab60fe585439 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -29,7 +29,7 @@ import java.util.concurrent.CopyOnWriteArraySet; /** * Represents a conference call which can contain any number of {@link Connection} objects. */ -public abstract class Conference implements IConferenceable { +public abstract class Conference implements Conferenceable { /** * Used to indicate that the conference connection time is not specified. If not specified, diff --git a/telecomm/java/android/telecom/Conferenceable.java b/telecomm/java/android/telecom/Conferenceable.java new file mode 100644 index 0000000000000..5c4cbc50a7344 --- /dev/null +++ b/telecomm/java/android/telecom/Conferenceable.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2015 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package android.telecom; + +/** + * Interface used to identify entities with which another entity can participate in a conference + * call with. The {@link ConnectionService} implementation will only recognize + * {@link Conferenceable}s which are {@link Connection}s or {@link Conference}s. + */ +public interface Conferenceable { + +} diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 4762031963441..f7c69cf41e0c9 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -44,7 +44,7 @@ import java.util.concurrent.ConcurrentHashMap; * must call {@link #destroy()} to signal to the framework that the {@code Connection} is no * longer used and associated resources may be recovered. */ -public abstract class Connection implements IConferenceable { +public abstract class Connection implements Conferenceable { public static final int STATE_INITIALIZING = 0; @@ -374,7 +374,7 @@ public abstract class Connection implements IConferenceable { public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {} public void onStatusHintsChanged(Connection c, StatusHints statusHints) {} public void onConferenceablesChanged( - Connection c, List conferenceables) {} + Connection c, List conferenceables) {} public void onConferenceChanged(Connection c, Conference conference) {} /** @hide */ public void onConferenceParticipantsChanged(Connection c, @@ -788,8 +788,8 @@ public abstract class Connection implements IConferenceable { */ private final Set mListeners = Collections.newSetFromMap( new ConcurrentHashMap(8, 0.9f, 1)); - private final List mConferenceables = new ArrayList<>(); - private final List mUnmodifiableConferenceables = + private final List mConferenceables = new ArrayList<>(); + private final List mUnmodifiableConferenceables = Collections.unmodifiableList(mConferenceables); private int mState = STATE_NEW; @@ -1277,9 +1277,9 @@ public abstract class Connection implements IConferenceable { * * @param conferenceables The conferenceables. */ - public final void setConferenceables(List conferenceables) { + public final void setConferenceables(List conferenceables) { clearConferenceableList(); - for (IConferenceable c : conferenceables) { + for (Conferenceable c : conferenceables) { // If statement checks for duplicates in input. It makes it N^2 but we're dealing with a // small amount of items here. if (!mConferenceables.contains(c)) { @@ -1299,7 +1299,7 @@ public abstract class Connection implements IConferenceable { /** * Returns the connections or conferences with which this connection can be conferenced. */ - public final List getConferenceables() { + public final List getConferenceables() { return mUnmodifiableConferenceables; } @@ -1564,7 +1564,7 @@ public abstract class Connection implements IConferenceable { } private final void clearConferenceableList() { - for (IConferenceable c : mConferenceables) { + for (Conferenceable c : mConferenceables) { if (c instanceof Connection) { Connection connection = (Connection) c; connection.removeConnectionListener(mConnectionDeathListener); diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index e36d32b52743b..89c5667f34f06 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -539,7 +539,7 @@ public abstract class ConnectionService extends Service { @Override public void onConferenceablesChanged( - Connection connection, List conferenceables) { + Connection connection, List conferenceables) { mAdapter.setConferenceableConnections( mIdByConnection.get(connection), createIdList(conferenceables)); @@ -1176,14 +1176,14 @@ public abstract class ConnectionService extends Service { /** * Builds a list of {@link Connection} and {@link Conference} IDs based on the list of - * {@link IConferenceable}s passed in. + * {@link Conferenceable}s passed in. * - * @param conferenceables The {@link IConferenceable} connections and conferences. + * @param conferenceables The {@link Conferenceable} connections and conferences. * @return List of string conference and call Ids. */ - private List createIdList(List conferenceables) { + private List createIdList(List conferenceables) { List ids = new ArrayList<>(); - for (IConferenceable c : conferenceables) { + for (Conferenceable c : conferenceables) { // Only allow Connection and Conference conferenceables. if (c instanceof Connection) { Connection connection = (Connection) c; diff --git a/telecomm/java/android/telecom/IConferenceable.java b/telecomm/java/android/telecom/IConferenceable.java index a9be20b6ea8fd..a664baa5f3dc9 100644 --- a/telecomm/java/android/telecom/IConferenceable.java +++ b/telecomm/java/android/telecom/IConferenceable.java @@ -19,8 +19,10 @@ package android.telecom; /** * 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. + * {@link Conferenceable}s which are {@link Connection}s or {@link Conference}s. + *

+ * @deprecated use {@link Conferenceable} instead. + * @hide */ -public interface IConferenceable { - +public interface IConferenceable extends Conferenceable { }