Loading OWNERS +1 −0 Original line number Diff line number Diff line Loading @@ -5,3 +5,4 @@ tjstuart@google.com rgreenwalt@google.com pmadapurmath@google.com grantmenke@google.com huiwang@google.com src/com/android/server/telecom/CallIntentProcessor.java +8 −3 Original line number Diff line number Diff line Loading @@ -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"); Loading src/com/android/server/telecom/CallsManager.java +22 −5 Original line number Diff line number Diff line Loading @@ -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 Loading src/com/android/server/telecom/EmergencyCallDiagnosticLogger.java +8 −8 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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 " Loading src/com/android/server/telecom/InCallAdapter.java +11 −4 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) { Loading @@ -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(); } Loading @@ -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) { Loading @@ -450,7 +455,9 @@ class InCallAdapter extends IInCallAdapter.Stub { "exitBackgroundAudioProcessing, unknown call id: %s", callId); } } }); } finally { Binder.restoreCallingIdentity(token); } } finally { Log.endSession(); } Loading Loading
OWNERS +1 −0 Original line number Diff line number Diff line Loading @@ -5,3 +5,4 @@ tjstuart@google.com rgreenwalt@google.com pmadapurmath@google.com grantmenke@google.com huiwang@google.com
src/com/android/server/telecom/CallIntentProcessor.java +8 −3 Original line number Diff line number Diff line Loading @@ -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"); Loading
src/com/android/server/telecom/CallsManager.java +22 −5 Original line number Diff line number Diff line Loading @@ -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 Loading
src/com/android/server/telecom/EmergencyCallDiagnosticLogger.java +8 −8 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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 " Loading
src/com/android/server/telecom/InCallAdapter.java +11 −4 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) { Loading @@ -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(); } Loading @@ -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) { Loading @@ -450,7 +455,9 @@ class InCallAdapter extends IInCallAdapter.Stub { "exitBackgroundAudioProcessing, unknown call id: %s", callId); } } }); } finally { Binder.restoreCallingIdentity(token); } } finally { Log.endSession(); } Loading