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

Commit 73a8b87a authored by Thomas Stuart's avatar Thomas Stuart
Browse files

remove CallControl#close()

Clients cannot make CallControl a final object inside their
representation of a Call object and therefore auto-closeable cannot be
called.

bug: 265074967
Test: none
Change-Id: Ic36f667ec3d39de648e7cf0741481d43e506258f
parent 476b5433
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -41305,8 +41305,7 @@ package android.telecom {
    field public static final int ROUTE_WIRED_OR_EARPIECE = 5; // 0x5
    field public static final int ROUTE_WIRED_OR_EARPIECE = 5; // 0x5
  }
  }
  public final class CallControl implements java.lang.AutoCloseable {
  public final class CallControl {
    method public void close();
    method public void disconnect(@NonNull android.telecom.DisconnectCause, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.telecom.CallException>);
    method public void disconnect(@NonNull android.telecom.DisconnectCause, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.telecom.CallException>);
    method @NonNull public android.os.ParcelUuid getCallId();
    method @NonNull public android.os.ParcelUuid getCallId();
    method public void rejectCall(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.telecom.CallException>);
    method public void rejectCall(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.telecom.CallException>);
+3 −12
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.telecom.CallException.TRANSACTION_EXCEPTION_KEY;
import android.annotation.CallbackExecutor;
import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.os.Binder;
import android.os.Binder;
import android.os.Bundle;
import android.os.Bundle;
import android.os.OutcomeReceiver;
import android.os.OutcomeReceiver;
@@ -45,7 +46,8 @@ import java.util.concurrent.Executor;
 * {@link OutcomeReceiver#onError} is called and provides a {@link CallException} that details why
 * {@link OutcomeReceiver#onError} is called and provides a {@link CallException} that details why
 * the operation failed.
 * the operation failed.
 */
 */
public final class CallControl implements AutoCloseable {
@SuppressLint("NotCloseable")
public final class CallControl {
    private static final String TAG = CallControl.class.getSimpleName();
    private static final String TAG = CallControl.class.getSimpleName();
    private static final String INTERFACE_ERROR_MSG = "Call Control is not available";
    private static final String INTERFACE_ERROR_MSG = "Call Control is not available";
    private final String mCallId;
    private final String mCallId;
@@ -260,17 +262,6 @@ public final class CallControl implements AutoCloseable {
        }
        }
    }
    }


    /**
     * This method should be called after
     * {@link CallControl#disconnect(DisconnectCause, Executor, OutcomeReceiver)} or
     * {@link CallControl#rejectCall(Executor, OutcomeReceiver)}
     * to destroy all references of this object and avoid memory leaks.
     */
    @Override
    public void close() {
        mRepository.removeCallFromServiceWrapper(mPhoneAccountHandle, mCallId);
    }

    /**
    /**
     * Since {@link OutcomeReceiver}s cannot be passed via AIDL, a ResultReceiver (which can) must
     * Since {@link OutcomeReceiver}s cannot be passed via AIDL, a ResultReceiver (which can) must
     * wrap the Clients {@link OutcomeReceiver} passed in and await for the Telecom Server side
     * wrap the Clients {@link OutcomeReceiver} passed in and await for the Telecom Server side