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

Commit 28fae681 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Remove references to CallRecordingTonePlayer.

This code is not used any more.  It was added to provide an audible tone
that the user could hear in a call to know a call was recorded when an
app tried to record using the mic during a call.  The audio policies on
the device no longer allow this.  Call recording via the dialer app as
is present now does not actually trigger this code.

Further, this was a per-carrier option and is not enabled for any carriers.
Removing this for modularization cleanup because CallRecordingTonePlayer
has unresolvable hidden API references.  Given this code is not used and
is not useful any more, removing.

Note; this flag is not yet in nextfood; it will get there for 25Q2.

Flag: com.android.server.telecom.flags.telecom_resolve_hidden_dependencies
Test: Ran Telecom unit tests and verified no regression.
Fixes: 308017600
Change-Id: I7a4b7f7f7362e4e47d2ea90ee962c2fa6d07c601
parent 28786e78
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";