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

Commit 0f4a9805 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12283639 from 01be7c57 to 24Q4-release

Change-Id: I7b236248376007761e72ade1cf74740227048d95
parents ea141a73 01be7c57
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import android.os.OutcomeReceiver;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.Trace;
import android.os.UserHandle;
import android.provider.CallLog;
import android.provider.ContactsContract.Contacts;
@@ -2151,10 +2150,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;
@@ -3858,7 +3862,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
     * @param callerInfo The new caller information to set.
     */
    private void setCallerInfo(Uri handle, CallerInfo callerInfo) {
        Trace.beginSection("setCallerInfo");
        if (callerInfo == null) {
            Log.i(this, "CallerInfo lookup returned null, skipping update");
            return;
@@ -3882,8 +3885,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
                l.onCallerInfoChanged(this);
            }
        }

        Trace.endSection();
    }

    public CallerInfo getCallerInfo() {
+26 −32
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.media.AudioFocusRequest;
import android.media.AudioManager;
import android.os.Looper;
import android.os.Message;
import android.os.Trace;
import android.telecom.Log;
import android.telecom.Logging.Runnable;
import android.telecom.Logging.Session;
@@ -461,8 +460,6 @@ public class CallAudioModeStateMachine extends StateMachine {
        private boolean mHasFocus = false;

        private void tryStartRinging() {
            Trace.traceBegin(Trace.TRACE_TAG_AUDIO, "CallAudioMode.tryStartRinging");
            try {
            if (mHasFocus && mCallAudioManager.isRingtonePlaying()) {
                Log.i(LOG_TAG,
                    "RingingFocusState#tryStartRinging -- audio focus previously"
@@ -493,9 +490,6 @@ public class CallAudioModeStateMachine extends StateMachine {
                Log.i(
                    LOG_TAG, "RINGING state, try start ringing but not acquiring audio focus");
            }
            } finally {
                Trace.traceEnd(Trace.TRACE_TAG_AUDIO);
            }
        }

        @Override
+2 −15
Original line number Diff line number Diff line
@@ -533,14 +533,6 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
                mIsScoAudioConnected);
        mIsActive = active;
        mPendingAudioRoute.evaluatePendingState();
        postTimeoutMessage();
    }

    private void postTimeoutMessage() {
        // reset timeout handler
        mHandler.removeMessages(PENDING_ROUTE_TIMEOUT);
        mHandler.postDelayed(() -> mHandler.sendMessage(
                Message.obtain(mHandler, PENDING_ROUTE_TIMEOUT)), TIMEOUT_LIMIT);
    }

    private void handleWiredHeadsetConnected() {
@@ -657,9 +649,6 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
                mPendingAudioRoute.onMessageReceived(new Pair<>(BT_AUDIO_CONNECTED,
                        bluetoothDevice.getAddress()), null);
            }
        } else {
            // ignore, not triggered by telecom
            Log.i(this, "handleBtAudioActive: ignoring handling bt audio active.");
        }
    }

@@ -679,9 +668,6 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
                mPendingAudioRoute.onMessageReceived(new Pair<>(BT_AUDIO_DISCONNECTED,
                        bluetoothDevice.getAddress()), null);
            }
        } else {
            // ignore, not triggered by telecom
            Log.i(this, "handleBtAudioInactive: ignoring handling bt audio inactive.");
        }
    }

@@ -1227,7 +1213,8 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {

    public AudioRoute getBaseRoute(boolean includeBluetooth, String btAddressToExclude) {
        AudioRoute destRoute = getPreferredAudioRouteFromStrategy();
        if (destRoute == null || (destRoute.getBluetoothAddress() != null && !includeBluetooth)) {
        if (destRoute == null || (destRoute.getBluetoothAddress() != null && (!includeBluetooth
                || destRoute.getBluetoothAddress().equals(btAddressToExclude)))) {
            destRoute = getPreferredAudioRouteFromDefault(includeBluetooth, btAddressToExclude);
        }
        if (destRoute != null && !getCallSupportedRoutes().contains(destRoute)) {
+0 −3
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Looper;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.telecom.DefaultDialerManager;
@@ -95,14 +94,12 @@ public class CallIntentProcessor {
        final boolean isUnknownCall = intent.getBooleanExtra(KEY_IS_UNKNOWN_CALL, false);
        Log.i(this, "onReceive - isUnknownCall: %s", isUnknownCall);

        Trace.beginSection("processNewCallCallIntent");
        if (isUnknownCall) {
            processUnknownCallIntent(mCallsManager, intent);
        } else {
            processOutgoingCallIntent(mContext, mCallsManager, intent, callingPackage,
                    mDefaultDialerCache, mFeatureFlags);
        }
        Trace.endSection();
    }


+11 −38
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ import android.os.ResultReceiver;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.SystemVibrator;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.BlockedNumberContract;
@@ -444,6 +443,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 +696,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 +747,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);
@@ -4621,7 +4628,6 @@ public class CallsManager extends Call.ListenerBase
            Log.i(this, "addCall(%s) is already added");
            return;
        }
        Trace.beginSection("addCall");
        Log.i(this, "addCall(%s)", call);
        call.addListener(this);
        mCalls.add(call);
@@ -4638,20 +4644,12 @@ public class CallsManager extends Call.ListenerBase
        updateExternalCallCanPullSupport();
        // onCallAdded for calls which immediately take the foreground (like the first call).
        for (CallsManagerListener listener : mListeners) {
            if (LogUtils.SYSTRACE_DEBUG) {
                Trace.beginSection(listener.getClass().toString() + " addCall");
            }
            listener.onCallAdded(call);
            if (LogUtils.SYSTRACE_DEBUG) {
                Trace.endSection();
            }
        }
        Trace.endSection();
    }

    @VisibleForTesting
    public void removeCall(Call call) {
        Trace.beginSection("removeCall");
        Log.v(this, "removeCall(%s)", call);

        if (call.isTransactionalCall() && call.getTransactionServiceWrapper() != null) {
@@ -4678,16 +4676,9 @@ public class CallsManager extends Call.ListenerBase
            updateCanAddCall();
            updateHasActiveRttCall();
            for (CallsManagerListener listener : mListeners) {
                if (LogUtils.SYSTRACE_DEBUG) {
                    Trace.beginSection(listener.getClass().toString() + " onCallRemoved");
                }
                listener.onCallRemoved(call);
                if (LogUtils.SYSTRACE_DEBUG) {
                    Trace.endSection();
                }
            }
        }
        Trace.endSection();
    }

    private void updateHasActiveRttCall() {
@@ -4750,13 +4741,8 @@ public class CallsManager extends Call.ListenerBase
                call.getAnalytics().setMissedReason(call.getMissedReason());

                maybeShowErrorDialogOnDisconnect(call);

                Trace.beginSection("onCallStateChanged");

                maybeHandleHandover(call, newState);
                notifyCallStateChanged(call, oldState, newState);

                Trace.endSection();
            } else {
                Log.i(this, "failed in setting the state to new state");
            }
@@ -4769,14 +4755,7 @@ public class CallsManager extends Call.ListenerBase
            updateCanAddCall();
            updateHasActiveRttCall();
            for (CallsManagerListener listener : mListeners) {
                if (LogUtils.SYSTRACE_DEBUG) {
                    Trace.beginSection(listener.getClass().toString() +
                            " onCallStateChanged");
                }
                listener.onCallStateChanged(call, oldState, newState);
                if (LogUtils.SYSTRACE_DEBUG) {
                    Trace.endSection();
                }
            }
        }
    }
@@ -4901,13 +4880,7 @@ public class CallsManager extends Call.ListenerBase
        if (newCanAddCall != mCanAddCall) {
            mCanAddCall = newCanAddCall;
            for (CallsManagerListener listener : mListeners) {
                if (LogUtils.SYSTRACE_DEBUG) {
                    Trace.beginSection(listener.getClass().toString() + " updateCanAddCall");
                }
                listener.onCanAddCallChanged(mCanAddCall);
                if (LogUtils.SYSTRACE_DEBUG) {
                    Trace.endSection();
                }
            }
        }
    }
Loading