diff --git a/api/current.txt b/api/current.txt index 71c90429b8f38..310047ddec9d2 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28680,25 +28680,6 @@ package android.telecom { method public abstract void onVideoQualityChanged(int); } - public final class Phone { - method public final void addListener(android.telecom.Phone.Listener); - method public final boolean canAddCall(); - method public final android.telecom.AudioState getAudioState(); - method public final java.util.List getCalls(); - method public final void removeListener(android.telecom.Phone.Listener); - method public final void setAudioRoute(int); - method public final void setMuted(boolean); - } - - public static abstract class Phone.Listener { - ctor public Phone.Listener(); - method public void onAudioStateChanged(android.telecom.Phone, android.telecom.AudioState); - method public void onBringToForeground(android.telecom.Phone, boolean); - method public void onCallAdded(android.telecom.Phone, android.telecom.Call); - method public void onCallRemoved(android.telecom.Phone, android.telecom.Call); - method public void onCanAddCallChanged(android.telecom.Phone, boolean); - } - public class PhoneAccount implements android.os.Parcelable { method public static android.telecom.PhoneAccount.Builder builder(android.telecom.PhoneAccountHandle, java.lang.CharSequence); method public android.graphics.drawable.Drawable createIconDrawable(android.content.Context); diff --git a/api/system-current.txt b/api/system-current.txt index 36a5f3430a583..db85a7e3de8a0 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -30464,15 +30464,15 @@ package android.telecom { method public final boolean canAddCall(); method public final android.telecom.AudioState getAudioState(); method public final java.util.List getCalls(); - method public final android.telecom.Phone getPhone(); + method public deprecated android.telecom.Phone getPhone(); method public void onAudioStateChanged(android.telecom.AudioState); method public android.os.IBinder onBind(android.content.Intent); method public void onBringToForeground(boolean); method public void onCallAdded(android.telecom.Call); method public void onCallRemoved(android.telecom.Call); method public void onCanAddCallChanged(boolean); - method public void onPhoneCreated(android.telecom.Phone); - method public void onPhoneDestroyed(android.telecom.Phone); + method public deprecated void onPhoneCreated(android.telecom.Phone); + method public deprecated void onPhoneDestroyed(android.telecom.Phone); method public final void setAudioRoute(int); method public final void setMuted(boolean); field public static final java.lang.String SERVICE_INTERFACE = "android.telecom.InCallService"; @@ -30505,7 +30505,7 @@ package android.telecom { method public abstract void onVideoQualityChanged(int); } - public final class Phone { + public final deprecated class Phone { method public final void addListener(android.telecom.Phone.Listener); method public final boolean canAddCall(); method public final android.telecom.AudioState getAudioState(); diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java index 846768f1cfcc4..020a33f2b0db5 100644 --- a/telecomm/java/android/telecom/InCallService.java +++ b/telecomm/java/android/telecom/InCallService.java @@ -216,9 +216,11 @@ public abstract class InCallService extends Service { * if the {@code InCallService} is not in a state where it has an associated * {@code Phone}. * @hide + * @deprecated Use direct methods on InCallService instead of {@link Phone}. */ @SystemApi - public final Phone getPhone() { + @Deprecated + public Phone getPhone() { return mPhone; } @@ -282,8 +284,10 @@ public abstract class InCallService extends Service { * * @param phone The {@code Phone} object associated with this {@code InCallService}. * @hide + * @deprecated Use direct methods on InCallService instead of {@link Phone}. */ @SystemApi + @Deprecated public void onPhoneCreated(Phone phone) { } @@ -295,8 +299,10 @@ public abstract class InCallService extends Service { * * @param phone The {@code Phone} object associated with this {@code InCallService}. * @hide + * @deprecated Use direct methods on InCallService instead of {@link Phone}. */ @SystemApi + @Deprecated public void onPhoneDestroyed(Phone phone) { } diff --git a/telecomm/java/android/telecom/Phone.java b/telecomm/java/android/telecom/Phone.java index 42256dae63d53..3d9acda688c85 100644 --- a/telecomm/java/android/telecom/Phone.java +++ b/telecomm/java/android/telecom/Phone.java @@ -16,6 +16,7 @@ package android.telecom; +import android.annotation.SystemApi; import android.util.ArrayMap; import java.util.Collections; @@ -26,7 +27,12 @@ import java.util.concurrent.CopyOnWriteArrayList; /** * A unified virtual device providing a means of voice (and other) communication on a device. + * + * @hide + * @deprecated Use {@link InCallService} directly instead of using this class. */ +@SystemApi +@Deprecated public final class Phone { public abstract static class Listener { @@ -100,12 +106,10 @@ public final class Phone { private boolean mCanAddCall = true; - /** {@hide} */ Phone(InCallAdapter adapter) { mInCallAdapter = adapter; } - /** {@hide} */ final void internalAddCall(ParcelableCall parcelableCall) { Call call = new Call(this, parcelableCall.getId(), mInCallAdapter); mCallByTelecomCallId.put(parcelableCall.getId(), call); @@ -115,7 +119,6 @@ public final class Phone { fireCallAdded(call); } - /** {@hide} */ final void internalRemoveCall(Call call) { mCallByTelecomCallId.remove(call.internalGetCallId()); mCalls.remove(call); @@ -127,7 +130,6 @@ public final class Phone { fireCallRemoved(call); } - /** {@hide} */ final void internalUpdateCall(ParcelableCall parcelableCall) { Call call = mCallByTelecomCallId.get(parcelableCall.getId()); if (call != null) { @@ -136,7 +138,6 @@ public final class Phone { } } - /** {@hide} */ final void internalSetPostDialWait(String telecomId, String remaining) { Call call = mCallByTelecomCallId.get(telecomId); if (call != null) { @@ -144,7 +145,6 @@ public final class Phone { } } - /** {@hide} */ final void internalAudioStateChanged(AudioState audioState) { if (!Objects.equals(mAudioState, audioState)) { mAudioState = audioState; @@ -152,17 +152,14 @@ public final class Phone { } } - /** {@hide} */ final Call internalGetCallByTelecomId(String telecomId) { return mCallByTelecomCallId.get(telecomId); } - /** {@hide} */ final void internalBringToForeground(boolean showDialpad) { fireBringToForeground(showDialpad); } - /** {@hide} */ final void internalSetCanAddCall(boolean canAddCall) { if (mCanAddCall != canAddCall) { mCanAddCall = canAddCall; @@ -172,7 +169,6 @@ public final class Phone { /** * Called to destroy the phone and cleanup any lingering calls. - * @hide */ final void destroy() { for (Call call : mCalls) {