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

Commit 44609b27 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11399958 from 59b2dec9 to 24Q2-release

Change-Id: I0679a05e7e3b05bc1f231aa514acf5075065482d
parents f0a852f4 59b2dec9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,3 +5,4 @@ tjstuart@google.com
rgreenwalt@google.com
pmadapurmath@google.com
grantmenke@google.com
huiwang@google.com
+8 −3
Original line number Diff line number Diff line
@@ -172,10 +172,15 @@ public class CallIntentProcessor {
            // Show the toast to warn user that it is a personal call though initiated in work
            // profile.
            if (fixedInitiatingUser) {
                if (featureFlags.telecomResolveHiddenDependencies()) {
                    Toast.makeText(context, context.getString(R.string.toast_personal_call_msg),
                            Toast.LENGTH_LONG).show();
                } else {
                    Toast.makeText(context, Looper.getMainLooper(),
                            context.getString(R.string.toast_personal_call_msg),
                            Toast.LENGTH_LONG).show();
                }
            }
        } else {
            Log.i(CallIntentProcessor.class,
                    "processOutgoingCallIntent: skip initiating user check");
+22 −5
Original line number Diff line number Diff line
@@ -4669,18 +4669,35 @@ public class CallsManager extends Call.ListenerBase
    }

    /**
     * Determines if there are any ongoing self managed calls for the given package/user.
     * Determines if there are any ongoing self-managed calls for the given package/user.
     * @param packageName The package name to check.
     * @param userHandle The userhandle to check.
     * @param userHandle The {@link UserHandle} to check.
     * @return {@code true} if the app has ongoing calls, or {@code false} otherwise.
     */
    public boolean isInSelfManagedCall(String packageName, UserHandle userHandle) {
        return isInSelfManagedCallCrossUsers(packageName, userHandle, false);
    }

    /**
     * Determines if there are any ongoing self-managed calls for the given package/user (unless
     * hasCrossUsers has been enabled).
     * @param packageName The package name to check.
     * @param userHandle The {@link UserHandle} to check.
     * @param hasCrossUserAccess indicates if calls across all users should be returned.
     * @return {@code true} if the app has ongoing calls, or {@code false} otherwise.
     */
    public boolean isInSelfManagedCallCrossUsers(
            String packageName, UserHandle userHandle, boolean hasCrossUserAccess) {
        return mSelfManagedCallsBeingSetup.stream().anyMatch(c -> c.isSelfManaged()
                && c.getTargetPhoneAccount().getComponentName().getPackageName().equals(packageName)
                && c.getTargetPhoneAccount().getUserHandle().equals(userHandle)) ||
                mCalls.stream().anyMatch(c -> c.isSelfManaged()
                && (!hasCrossUserAccess
                        ? c.getTargetPhoneAccount().getUserHandle().equals(userHandle)
                        : true))
                || mCalls.stream().anyMatch(c -> c.isSelfManaged()
                && c.getTargetPhoneAccount().getComponentName().getPackageName().equals(packageName)
                && c.getTargetPhoneAccount().getUserHandle().equals(userHandle));
                && (!hasCrossUserAccess
                        ? c.getTargetPhoneAccount().getUserHandle().equals(userHandle)
                        : true));
    }

    @VisibleForTesting
+8 −8
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.server.telecom;

import static android.telephony.TelephonyManager.EmergencyCallDiagnosticParams;
import static android.telephony.TelephonyManager.EmergencyCallDiagnosticData;

import android.os.BugreportManager;
import android.os.DropBoxManager;
@@ -156,19 +156,19 @@ public class EmergencyCallDiagnosticLogger extends CallsManagerListenerBase
        List<Integer> dataCollectionTypes = getDataCollectionTypes(reason);
        boolean invokeTelephonyPersistApi = false;
        CallEventTimestamps ts = mEmergencyCallsMap.get(call);
        EmergencyCallDiagnosticParams.Builder callDiagnosticBuilder =
                new EmergencyCallDiagnosticParams.Builder();
        EmergencyCallDiagnosticData.Builder callDiagnosticBuilder =
                new EmergencyCallDiagnosticData.Builder();
        for (Integer dataCollectionType : dataCollectionTypes) {
            switch (dataCollectionType) {
                case COLLECTION_TYPE_TELECOM_STATE:
                    if (isTelecomDumpCollectionEnabled()) {
                        callDiagnosticBuilder.setTelecomDumpSysCollectionEnabled(true);
                        callDiagnosticBuilder.setTelecomDumpsysCollectionEnabled(true);
                        invokeTelephonyPersistApi = true;
                    }
                    break;
                case COLLECTION_TYPE_TELEPHONY_STATE:
                    if (isTelephonyDumpCollectionEnabled()) {
                        callDiagnosticBuilder.setTelephonyDumpSysCollectionEnabled(true);
                        callDiagnosticBuilder.setTelephonyDumpsysCollectionEnabled(true);
                        invokeTelephonyPersistApi = true;
                    }
                    break;
@@ -192,14 +192,14 @@ public class EmergencyCallDiagnosticLogger extends CallsManagerListenerBase
                default:
            }
        }
        EmergencyCallDiagnosticParams dp = callDiagnosticBuilder.build();
        EmergencyCallDiagnosticData ecdData = callDiagnosticBuilder.build();
        if (invokeTelephonyPersistApi) {
            mAsyncTaskExecutor.execute(new Runnable() {
                @Override
                public void run() {
                    Log.i(this, "Requesting Telephony to persist data %s", dp.toString());
                    Log.i(this, "Requesting Telephony to persist data %s", ecdData.toString());
                    try {
                        mTelephonyManager.persistEmergencyCallDiagnosticData(DROPBOX_TAG, dp);
                        mTelephonyManager.persistEmergencyCallDiagnosticData(DROPBOX_TAG, ecdData);
                    } catch (Exception e) {
                        Log.w(this,
                                "Exception while invoking "
+11 −4
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.os.ResultReceiver;
import android.os.UserHandle;
import android.telecom.CallEndpoint;
import android.telecom.Log;
import android.telecom.PhoneAccountHandle;
@@ -420,7 +421,8 @@ class InCallAdapter extends IInCallAdapter.Stub {
            Log.startSession(LogUtils.Sessions.ICA_ENTER_AUDIO_PROCESSING,
                    mOwnerPackageAbbreviation);
            // TODO: enforce the extra permission.
            Binder.withCleanCallingIdentity(() -> {
            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
                    Call call = mCallIdMapper.getCall(callId);
                    if (call != null) {
@@ -429,7 +431,9 @@ class InCallAdapter extends IInCallAdapter.Stub {
                        Log.w(this, "enterBackgroundAudioProcessing, unknown call id: %s", callId);
                    }
                }
            });
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        } finally {
            Log.endSession();
        }
@@ -440,7 +444,8 @@ class InCallAdapter extends IInCallAdapter.Stub {
        try {
            Log.startSession(LogUtils.Sessions.ICA_EXIT_AUDIO_PROCESSING,
                    mOwnerPackageAbbreviation);
            Binder.withCleanCallingIdentity(() -> {
            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
                    Call call = mCallIdMapper.getCall(callId);
                    if (call != null) {
@@ -450,7 +455,9 @@ class InCallAdapter extends IInCallAdapter.Stub {
                                "exitBackgroundAudioProcessing, unknown call id: %s", callId);
                    }
                }
            });
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        } finally {
            Log.endSession();
        }
Loading