Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29886d85 authored by Santos Cordon's avatar Santos Cordon
Browse files

Unfinal getPhone.

The change to make it final was breaking existing apps.

...and other changes.

Bug: 20283873
Change-Id: I8db4243850ad15f688dbca59ff5427b4799cbd1b
parent a2492810
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -30229,25 +30229,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<android.telecom.Call> 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);
+4 −4
Original line number Diff line number Diff line
@@ -32292,15 +32292,15 @@ package android.telecom {
    method public final boolean canAddCall();
    method public final android.telecom.AudioState getAudioState();
    method public final java.util.List<android.telecom.Call> 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";
@@ -32332,7 +32332,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();
+7 −1
Original line number Diff line number Diff line
@@ -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) {
    }

+6 −10
Original line number Diff line number Diff line
@@ -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,14 +119,12 @@ public final class Phone {
        fireCallAdded(call);
     }

    /** {@hide} */
    final void internalRemoveCall(Call call) {
        mCallByTelecomCallId.remove(call.internalGetCallId());
        mCalls.remove(call);
        fireCallRemoved(call);
    }

    /** {@hide} */
    final void internalUpdateCall(ParcelableCall parcelableCall) {
         Call call = mCallByTelecomCallId.get(parcelableCall.getId());
         if (call != null) {
@@ -131,7 +133,6 @@ public final class Phone {
         }
     }

    /** {@hide} */
    final void internalSetPostDialWait(String telecomId, String remaining) {
        Call call = mCallByTelecomCallId.get(telecomId);
        if (call != null) {
@@ -139,7 +140,6 @@ public final class Phone {
        }
    }

    /** {@hide} */
    final void internalAudioStateChanged(AudioState audioState) {
        if (!Objects.equals(mAudioState, audioState)) {
            mAudioState = audioState;
@@ -147,17 +147,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;
@@ -167,7 +164,6 @@ public final class Phone {

    /**
     * Called to destroy the phone and cleanup any lingering calls.
     * @hide
     */
    final void destroy() {
        for (Call call : mCalls) {