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

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

Revert "telecom-bluetooth DND bug"

Revert "telecom-bluetooth DND bug"

Revert submission 19521928-telecomBluetoothDndBug

Reason for revert: Causes crash on call reported in b/258128736
Reverted Changes:
If275c2370:telecom-bluetooth DND bug
I873823def:telecom-bluetooth DND bug

Change-Id: Ia27e3468c90322c222f448ad0143c1d6c9c0d2c9
parent e02cc84c
Loading
Loading
Loading
Loading
+99 −105
Original line number Diff line number Diff line
@@ -99,9 +99,7 @@ public class Analytics {
                entry(LogUtils.Events.BLOCK_CHECK_INITIATED, AnalyticsEvent.BLOCK_CHECK_INITIATED),
                entry(LogUtils.Events.FILTERING_INITIATED, AnalyticsEvent.FILTERING_INITIATED),
                entry(LogUtils.Events.FILTERING_COMPLETED, AnalyticsEvent.FILTERING_COMPLETED),
            entry(LogUtils.Events.FILTERING_TIMED_OUT, AnalyticsEvent.FILTERING_TIMED_OUT),
            entry(LogUtils.Events.DND_PRE_CHECK_INITIATED, AnalyticsEvent.DND_CHECK_INITIATED),
            entry(LogUtils.Events.DND_PRE_CHECK_COMPLETED, AnalyticsEvent.DND_CHECK_COMPLETED));
                entry(LogUtils.Events.FILTERING_TIMED_OUT, AnalyticsEvent.FILTERING_TIMED_OUT));

    public static final Map<String, Integer> sLogSessionToSessionId = Map.ofEntries(
                entry(LogUtils.Sessions.ICA_ANSWER_CALL, SessionTiming.ICA_ANSWER_CALL),
@@ -151,12 +149,9 @@ public class Analytics {
                        ParcelableCallAnalytics.EventTiming.FILTERING_TIMED_OUT_TIMING),
                entry(LogUtils.Events.Timings.START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING,
                        ParcelableCallAnalytics.EventTiming.
                            START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING),
            entry(LogUtils.Events.Timings.DND_PRE_CHECK_COMPLETED_TIMING,
                    ParcelableCallAnalytics.EventTiming.DND_PRE_CALL_PRE_CHECK_TIMING));
                                START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING));

    public static final Map<Integer, String> sSessionIdToLogSession = new HashMap<>();

    static {
        for (Map.Entry<String, Integer> e : sLogSessionToSessionId.entrySet()) {
            sSessionIdToLogSession.put(e.getValue(), e.getKey());
@@ -580,7 +575,6 @@ public class Analytics {
            }
        }
    }

    public static final String TAG = "TelecomAnalytics";

    // Constants for call direction
+0 −21
Original line number Diff line number Diff line
@@ -1279,27 +1279,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        return mSilentRingingRequested;
    }

    public void setCallIsSuppressedByDoNotDisturb(boolean isCallSuppressed) {
        Bundle bundle = new Bundle();
        bundle.putBoolean(android.telecom.Call.EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB,
                isCallSuppressed);
        putExtras(SOURCE_CONNECTION_SERVICE, bundle);
    }

    public boolean isCallSuppressedByDoNotDisturb() {
        if (getExtras() == null) {
            return false;
        }
        return getExtras().getBoolean(android.telecom.Call.EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB);
    }

    public boolean wasDndCheckComputedForCall() {
        if (getExtras() == null) {
            return false;
        }
        return getExtras().containsKey(android.telecom.Call.EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB);
    }

    @VisibleForTesting
    public boolean isConference() {
        return mIsConference;
+2 −6
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ import android.annotation.NonNull;
import android.app.ActivityManager;
import android.app.AlertDialog;
import android.app.KeyguardManager;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
@@ -114,7 +113,6 @@ import com.android.server.telecom.callfiltering.CallFilteringResult;
import com.android.server.telecom.callfiltering.CallFilteringResult.Builder;
import com.android.server.telecom.callfiltering.CallScreeningServiceFilter;
import com.android.server.telecom.callfiltering.DirectToVoicemailFilter;
import com.android.server.telecom.callfiltering.DndCallFilter;
import com.android.server.telecom.callfiltering.IncomingCallFilterGraph;
import com.android.server.telecom.callredirection.CallRedirectionProcessor;
import com.android.server.telecom.components.ErrorDialogActivity;
@@ -534,6 +532,7 @@ public class CallsManager extends Call.ListenerBase
                        bluetoothManager,
                        wiredHeadsetManager,
                        mDockManager);

        AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
        InCallTonePlayer.MediaPlayerFactory mediaPlayerFactory =
                (resourceId, attributes) ->
@@ -554,8 +553,7 @@ public class CallsManager extends Call.ListenerBase
        mCallDiagnosticServiceController.setInCallTonePlayerFactory(playerFactory);
        mRinger = new Ringer(playerFactory, context, systemSettingsUtil, asyncRingtonePlayer,
                ringtoneFactory, systemVibrator,
                new Ringer.VibrationEffectProxy(), mInCallController,
                mContext.getSystemService(NotificationManager.class));
                new Ringer.VibrationEffectProxy(), mInCallController);
        mCallRecordingTonePlayer = new CallRecordingTonePlayer(mContext, audioManager,
                mTimeoutsAdapter, mLock);
        mCallAudioManager = new CallAudioManager(callAudioRouteStateMachine,
@@ -719,7 +717,6 @@ public class CallsManager extends Call.ListenerBase
                mCallerInfoLookupHelper);
        BlockCheckerFilter blockCheckerFilter = new BlockCheckerFilter(mContext, incomingCall,
                mCallerInfoLookupHelper, new BlockCheckerAdapter());
        DndCallFilter dndCallFilter = new DndCallFilter(incomingCall, getRinger());
        CallScreeningServiceFilter carrierCallScreeningServiceFilter =
                new CallScreeningServiceFilter(incomingCall, carrierPackageName,
                        CallScreeningServiceFilter.PACKAGE_TYPE_CARRIER, mContext, this,
@@ -737,7 +734,6 @@ public class CallsManager extends Call.ListenerBase
                    mContext, this, appLabelProxy, converter);
        }
        graph.addFilter(voicemailFilter);
        graph.addFilter(dndCallFilter);
        graph.addFilter(blockCheckerFilter);
        graph.addFilter(carrierCallScreeningServiceFilter);
        graph.addFilter(callScreeningServiceFilter);
+1 −14
Original line number Diff line number Diff line
@@ -2155,24 +2155,11 @@ public class InCallController extends CallsManagerListenerBase implements
            InCallServiceInfo info, ParcelableCall parcelableCall) {
        ParcelableCall.ParcelableCallBuilder builder =
                ParcelableCall.ParcelableCallBuilder.fromParcelableCall(parcelableCall);
        // Check for contacts permission. If it's not there, remove the contactsDisplayName.
        PackageManager pm = mContext.getPackageManager();

        // Check for contacts permission.
        if (pm.checkPermission(Manifest.permission.READ_CONTACTS,
                info.getComponentName().getPackageName()) != PackageManager.PERMISSION_GRANTED) {
            // contacts permission is not present...

            // removing the contactsDisplayName
            builder.setContactDisplayName(null);

            // removing the Call.EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB extra
            Bundle callBundle = parcelableCall.getExtras();
            if (callBundle.containsKey(
                    android.telecom.Call.EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB)) {
                Bundle newBundle = callBundle.deepCopy();
                newBundle.remove(android.telecom.Call.EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB);
                builder.setExtras(newBundle);
            }
        }

        // TODO: move all the other service-specific sanitizations in here
+0 −5
Original line number Diff line number Diff line
@@ -168,8 +168,6 @@ public class LogUtils {
        public static final String DIRECT_TO_VM_INITIATED = "DIRECT_TO_VM_INITIATED";
        public static final String DIRECT_TO_VM_FINISHED = "DIRECT_TO_VM_FINISHED";
        public static final String FILTERING_INITIATED = "FILTERING_INITIATED";
        public static final String DND_PRE_CHECK_INITIATED = "DND_PRE_CHECK_INITIATED";
        public static final String DND_PRE_CHECK_COMPLETED = "DND_PRE_CHECK_COMPLETED";
        public static final String FILTERING_COMPLETED = "FILTERING_COMPLETED";
        public static final String FILTERING_TIMED_OUT = "FILTERING_TIMED_OUT";
        public static final String REMOTELY_HELD = "REMOTELY_HELD";
@@ -224,7 +222,6 @@ public class LogUtils {
            public static final String DIRECT_TO_VM_FINISHED_TIMING = "direct_to_vm_finished";
            public static final String BLOCK_CHECK_FINISHED_TIMING = "block_check_finished";
            public static final String FILTERING_COMPLETED_TIMING = "filtering_completed";
            public static final String DND_PRE_CHECK_COMPLETED_TIMING = "dnd_pre_check_completed";
            public static final String FILTERING_TIMED_OUT_TIMING = "filtering_timed_out";
            public static final String START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING =
                    "start_connection_to_request_disconnect";
@@ -246,8 +243,6 @@ public class LogUtils {
                            BLOCK_CHECK_FINISHED_TIMING),
                    new TimedEventPair(FILTERING_INITIATED, FILTERING_COMPLETED,
                            FILTERING_COMPLETED_TIMING),
                    new TimedEventPair(DND_PRE_CHECK_INITIATED, DND_PRE_CHECK_COMPLETED,
                            DND_PRE_CHECK_COMPLETED_TIMING),
                    new TimedEventPair(FILTERING_INITIATED, FILTERING_TIMED_OUT,
                            FILTERING_TIMED_OUT_TIMING, 6000L),
                    new TimedEventPair(START_CONNECTION, REQUEST_DISCONNECT,
Loading