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

Commit ff2fc427 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Remove references to CallRecordingTonePlayer." into main

parents b1c5ed4d 28fae681
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -2151,10 +2151,15 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
                isWorkCall = UserUtil.isManagedProfile(mContext, userHandle, mFlags);
            }

            if (!mFlags.telecomResolveHiddenDependencies()) {
                isCallRecordingToneSupported = (phoneAccount.hasCapabilities(
                    PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION) && phoneAccount.getExtras() != null
                        PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)
                        && phoneAccount.getExtras() != null
                        && phoneAccount.getExtras().getBoolean(
                        PhoneAccount.EXTRA_PLAY_CALL_RECORDING_TONE, false));
            } else {
                isCallRecordingToneSupported = false;
            }
            isSimCall = phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION);
        }
        mIsWorkCall = isWorkCall;
+11 −3
Original line number Diff line number Diff line
@@ -444,6 +444,7 @@ public class CallsManager extends Call.ListenerBase
    private final InCallController mInCallController;
    private final CallDiagnosticServiceController mCallDiagnosticServiceController;
    private final CallAudioManager mCallAudioManager;
    /** @deprecated not used any more */
    private final CallRecordingTonePlayer mCallRecordingTonePlayer;
    private RespondViaSmsManager mRespondViaSmsManager;
    private final Ringer mRinger;
@@ -696,8 +697,13 @@ public class CallsManager extends Call.ListenerBase
                new Ringer.VibrationEffectProxy(), mInCallController,
                mContext.getSystemService(NotificationManager.class),
                accessibilityManagerAdapter, featureFlags);
        if (featureFlags.telecomResolveHiddenDependencies()) {
            // This is now deprecated
            mCallRecordingTonePlayer = null;
        } else {
            mCallRecordingTonePlayer = new CallRecordingTonePlayer(mContext, audioManager,
                    mTimeoutsAdapter, mLock);
        }
        mCallAudioManager = new CallAudioManager(callAudioRouteAdapter,
                this, callAudioModeStateMachineFactory.create(systemStateHelper,
                (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE),
@@ -742,7 +748,9 @@ public class CallsManager extends Call.ListenerBase
        mListeners.add(mCallEndpointController);
        mListeners.add(mCallDiagnosticServiceController);
        mListeners.add(mCallAudioManager);
        if (!featureFlags.telecomResolveHiddenDependencies()) {
            mListeners.add(mCallRecordingTonePlayer);
        }
        mListeners.add(missedCallNotifier);
        mListeners.add(mDisconnectedCallNotifier);
        mListeners.add(mHeadsetMediaButton);
+3 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.media.MediaPlayer;
import android.media.MediaRecorder;
import android.os.Handler;
import android.os.Looper;
import android.platform.test.annotations.RequiresFlagsDisabled;
import android.telecom.PhoneAccountHandle;

import androidx.test.filters.MediumTest;
@@ -52,6 +53,7 @@ import com.android.server.telecom.CallRecordingTonePlayer;
import com.android.server.telecom.CallState;
import com.android.server.telecom.TelecomSystem;
import com.android.server.telecom.Timeouts;
import com.android.server.telecom.flags.Flags;

import org.junit.After;
import org.junit.Before;
@@ -71,6 +73,7 @@ import java.util.List;
 * Unit tests for the {@link com.android.server.telecom.CallRecordingTonePlayer} class.
 */
@RunWith(JUnit4.class)
@RequiresFlagsDisabled(Flags.FLAG_TELECOM_RESOLVE_HIDDEN_DEPENDENCIES)
public class CallRecordingTonePlayerTest extends TelecomTestCase {

    private static final String PHONE_ACCOUNT_PACKAGE = "com.android.telecom.test";