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

Commit c0082c65 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4706961 from 52701ad2 to pi-release

Change-Id: Ib5002ce709d5e4ecb3f0d6058a754777da2579e2
parents 55aa5d46 52701ad2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1172,6 +1172,12 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            return false;
        }

        if (!PhoneAccount.SCHEME_SIP.equals(getHandle().getScheme()) &&
                !PhoneAccount.SCHEME_TEL.equals(getHandle().getScheme())) {
            // Can't log schemes other than SIP or TEL for now.
            return false;
        }

        return phoneAccount.getExtras() != null && phoneAccount.getExtras().getBoolean(
                PhoneAccount.EXTRA_LOG_SELF_MANAGED_CALLS, false);
    }
+3 −3
Original line number Diff line number Diff line
@@ -101,9 +101,9 @@ public class CallIntentProcessor {
        String scheme = handle.getScheme();
        String uriString = handle.getSchemeSpecificPart();

        if (!PhoneAccount.SCHEME_VOICEMAIL.equals(scheme)) {
            handle = Uri.fromParts(PhoneNumberUtils.isUriNumber(uriString) ?
                    PhoneAccount.SCHEME_SIP : PhoneAccount.SCHEME_TEL, uriString, null);
        // Ensure sip URIs dialed using TEL scheme get converted to SIP scheme.
        if (PhoneAccount.SCHEME_TEL.equals(scheme) && PhoneNumberUtils.isUriNumber(uriString)) {
            handle = Uri.fromParts(PhoneAccount.SCHEME_SIP, uriString, null);
        }

        PhoneAccountHandle phoneAccountHandle = intent.getParcelableExtra(
+16 −2
Original line number Diff line number Diff line
@@ -516,6 +516,20 @@ public class CallsManager extends Call.ListenerBase
            return;
        }

        // Check DISALLOW_OUTGOING_CALLS restriction.
        // Only ecbm calls are allowed through when users with the DISALLOW_OUTGOING_CALLS
        // restriction are the current user.
        final UserManager userManager = (UserManager) mContext.getSystemService(
                Context.USER_SERVICE);
        if (userManager.hasUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS,
                mCurrentUserHandle)) {
            Log.w(this, "Rejecting non-ecbm phone call due to DISALLOW_INCOMING_CALLS "
                    + "restriction");
            incomingCall.reject(false, null);
            mCallLogManager.logCall(incomingCall, Calls.MISSED_TYPE, false /* showNotification */);
            return;
        }

        List<IncomingCallFilter.CallFilter> filters = new ArrayList<>();
        filters.add(new DirectToVoicemailCallFilter(mCallerInfoLookupHelper));
        filters.add(new AsyncBlockCheckFilter(mContext, new BlockCheckerAdapter(),
@@ -1813,8 +1827,8 @@ public class CallsManager extends Call.ListenerBase
    }

    private boolean isRttSettingOn() {
        return Settings.System.getInt(mContext.getContentResolver(),
                Settings.System.RTT_CALLING_MODE, 0) != 0;
        return Settings.Secure.getInt(mContext.getContentResolver(),
                Settings.Secure.RTT_CALLING_MODE, 0) != 0;
    }

    void phoneAccountSelected(Call call, PhoneAccountHandle account, boolean setDefault) {
+17 −1
Original line number Diff line number Diff line
@@ -16,9 +16,12 @@

package com.android.server.telecom;

import android.content.Context;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
import android.telecom.Log;
import android.telecom.PhoneAccountHandle;

@@ -32,14 +35,16 @@ import java.util.List;
 * binding to it. This adapter can receive commands and updates until the in-call app is unbound.
 */
class InCallAdapter extends IInCallAdapter.Stub {
    private final Context mContext;
    private final CallsManager mCallsManager;
    private final CallIdMapper mCallIdMapper;
    private final TelecomSystem.SyncRoot mLock;
    private final String mOwnerComponentName;

    /** Persists the specified parameters. */
    public InCallAdapter(CallsManager callsManager, CallIdMapper callIdMapper,
    public InCallAdapter(Context context, CallsManager callsManager, CallIdMapper callIdMapper,
            TelecomSystem.SyncRoot lock, String ownerComponentName) {
        mContext = context;
        mCallsManager = callsManager;
        mCallIdMapper = callIdMapper;
        mLock = lock;
@@ -96,6 +101,17 @@ class InCallAdapter extends IInCallAdapter.Stub {
    public void rejectCall(String callId, boolean rejectWithMessage, String textMessage) {
        try {
            Log.startSession(LogUtils.Sessions.ICA_REJECT_CALL, mOwnerComponentName);
            UserHandle callingUser = UserHandle.of(UserHandle.getUserId(Binder.getCallingUid()));
            UserManager userManager = mContext.getSystemService(UserManager.class);

            // Check to make sure the in-call app's user isn't restricted from sending SMS. If so,
            // silently drop the outgoing message.
            if (rejectWithMessage && userManager.hasUserRestriction(
                    UserManager.DISALLOW_SMS, callingUser)) {
                rejectWithMessage = false;
                textMessage = null;
            }

            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
+1 −0
Original line number Diff line number Diff line
@@ -1309,6 +1309,7 @@ public class InCallController extends CallsManagerListenerBase {
        try {
            inCallService.setInCallAdapter(
                    new InCallAdapter(
                            mContext,
                            mCallsManager,
                            mCallIdMapper,
                            mLock,
Loading