Loading AndroidManifest.xml +3 −11 Original line number Diff line number Diff line Loading @@ -297,14 +297,6 @@ </intent-filter> </activity> <activity android:name="com.android.server.telecom.components.ChangeDefaultCallScreeningApp" android:label="@string/change_default_dialer_dialog_title" android:excludeFromRecents="true" android:theme="@*android:style/Theme.Material.Light.Dialog.Alert" android:priority="1000" android:process=":ui"> </activity> <activity android:name=".ui.TelecomDeveloperMenu" android:label="@string/developer_title" android:exported="false" Loading src/com/android/server/telecom/Call.java +32 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.os.SystemClock; import android.os.Trace; import android.provider.ContactsContract.Contacts; import android.telecom.CallAudioState; import android.telecom.CallIdentification; import android.telecom.Conference; import android.telecom.ConnectionService; import android.telecom.DisconnectCause; Loading Loading @@ -141,6 +142,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, Bundle extras, boolean isLegacy); void onHandoverFailed(Call call, int error); void onHandoverComplete(Call call); void onCallIdentificationChanged(Call call); } public abstract static class ListenerBase implements Listener { Loading Loading @@ -219,6 +221,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, public void onHandoverFailed(Call call, int error) {} @Override public void onHandoverComplete(Call call) {} @Override public void onCallIdentificationChanged(Call call) {} } private final CallerInfoLookupHelper.OnQueryCompleteListener mCallerInfoQueryListener = Loading Loading @@ -529,6 +533,11 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, */ private boolean mIsUsingCallFiltering = false; /** * {@link CallIdentification} provided by a {@link android.telecom.CallScreeningService}. */ private CallIdentification mCallIdentification = null; /** * Persists the specified parameters and initializes the new instance. * @param context The context. Loading Loading @@ -3126,4 +3135,27 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, public void setIsUsingCallFiltering(boolean isUsingCallFiltering) { mIsUsingCallFiltering = isUsingCallFiltering; } /** * Update the {@link CallIdentification} for a call. * @param callIdentification the {@link CallIdentification}. */ public void setCallIdentification(CallIdentification callIdentification) { if (callIdentification != null) { Log.addEvent(this, LogUtils.Events.CALL_IDENTIFICATION_SET, callIdentification.getCallScreeningPackageName()); } mCallIdentification = callIdentification; for (Listener l : mListeners) { l.onCallIdentificationChanged(this); } } /** * @return Call identification returned by a {@link android.telecom.CallScreeningService}. */ public CallIdentification getCallIdentification() { return mCallIdentification; } } src/com/android/server/telecom/CallLogManager.java +16 −10 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.os.Looper; import android.os.UserHandle; import android.os.PersistableBundle; import android.provider.CallLog.Calls; import android.telecom.CallIdentification; import android.telecom.Connection; import android.telecom.DisconnectCause; import android.telecom.Log; Loading @@ -42,12 +43,8 @@ import com.android.internal.telephony.CallerInfo; import com.android.server.telecom.callfiltering.CallFilteringResult; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Locale; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; /** Loading Loading @@ -85,7 +82,8 @@ public final class CallLogManager extends CallsManagerListenerBase { int features, PhoneAccountHandle accountHandle, long creationDate, long durationInMillis, Long dataUsage, UserHandle initiatingUser, boolean isRead, @Nullable LogCallCompletedListener logCallCompletedListener, int callBlockReason, String callScreeningAppName, String callScreeningComponentName) { String callScreeningAppName, String callScreeningComponentName, CallIdentification callIdentification) { this.context = context; this.callerInfo = callerInfo; this.number = number; Loading @@ -104,6 +102,7 @@ public final class CallLogManager extends CallsManagerListenerBase { this.callBockReason = callBlockReason; this.callScreeningAppName = callScreeningAppName; this.callScreeningComponentName = callScreeningComponentName; this.callIdentification = callIdentification; } // Since the members are accessed directly, we don't use the // mXxxx notation. Loading @@ -128,6 +127,8 @@ public final class CallLogManager extends CallsManagerListenerBase { public final int callBockReason; public final String callScreeningAppName; public final String callScreeningComponentName; public final CallIdentification callIdentification; } private static final String TAG = CallLogManager.class.getSimpleName(); Loading Loading @@ -256,20 +257,22 @@ public final class CallLogManager extends CallsManagerListenerBase { Connection.PROPERTY_ASSISTED_DIALING_USED, call.wasEverRttCall()); CallIdentification callIdentification = call.getCallIdentification(); if (callLogType == Calls.BLOCKED_TYPE) { logCall(call.getCallerInfo(), logNumber, call.getPostDialDigits(), formattedViaNumber, call.getHandlePresentation(), callLogType, callFeatures, accountHandle, creationTime, age, callDataUsage, call.isEmergencyCall(), call.getInitiatingUser(), call.isSelfManaged(), logCallCompletedListener, result.mCallBlockReason, result.mCallScreeningAppName, result.mCallScreeningComponentName); result.mCallScreeningComponentName, callIdentification); } else { logCall(call.getCallerInfo(), logNumber, call.getPostDialDigits(), formattedViaNumber, call.getHandlePresentation(), callLogType, callFeatures, accountHandle, creationTime, age, callDataUsage, call.isEmergencyCall(), call.getInitiatingUser(), call.isSelfManaged(), logCallCompletedListener, Calls.BLOCK_REASON_NOT_BLOCKED, null /*callScreeningAppName*/, null /*callScreeningComponentName*/); null /*callScreeningComponentName*/, callIdentification); } } Loading @@ -293,6 +296,8 @@ public final class CallLogManager extends CallsManagerListenerBase { * @param callBlockReason The reason why the call is blocked. * @param callScreeningAppName The call screening application name which block the call. * @param callScreeningComponentName The call screening component name which block the call. * @param callIdentification Call identification information, if provided by a call screening * service. */ private void logCall( CallerInfo callerInfo, Loading @@ -312,7 +317,8 @@ public final class CallLogManager extends CallsManagerListenerBase { @Nullable LogCallCompletedListener logCallCompletedListener, int callBlockReason, String callScreeningAppName, String callScreeningComponentName) { String callScreeningComponentName, @Nullable CallIdentification callIdentification) { // On some devices, to avoid accidental redialing of emergency numbers, we *never* log // emergency calls to the Call Log. (This behavior is set on a per-product basis, based Loading Loading @@ -346,7 +352,7 @@ public final class CallLogManager extends CallsManagerListenerBase { AddCallArgs args = new AddCallArgs(mContext, callerInfo, number, postDialDigits, viaNumber, presentation, callType, features, accountHandle, start, duration, dataUsage, initiatingUser, isRead, logCallCompletedListener, callBlockReason, callScreeningAppName, callScreeningComponentName); callScreeningAppName, callScreeningComponentName, callIdentification); logCallAsync(args); } else { Log.d(TAG, "Not adding emergency call to call log."); Loading Loading @@ -508,7 +514,7 @@ public final class CallLogManager extends CallsManagerListenerBase { c.presentation, c.callType, c.features, c.accountHandle, c.timestamp, c.durationInSec, c.dataUsage, userToBeInserted == null, userToBeInserted, c.isRead, c.callBockReason, c.callScreeningAppName, c.callScreeningComponentName); c.callScreeningComponentName, c.callIdentification); } Loading src/com/android/server/telecom/InCallController.java +5 −0 Original line number Diff line number Diff line Loading @@ -696,6 +696,11 @@ public class InCallController extends CallsManagerListenerBase { public void onRemoteRttRequest(Call call, int requestId) { notifyRemoteRttRequest(call, requestId); } @Override public void onCallIdentificationChanged(Call call) { updateCall(call); } }; private final SystemStateListener mSystemStateListener = new SystemStateListener() { Loading src/com/android/server/telecom/LogUtils.java +1 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ public class LogUtils { public static final String CONTROLLER_SCREENING_COMPLETED = "CONTROLLER_SCREENING_COMPLETED"; public static final String SCREENING_COMPLETED = "SCREENING_COMPLETED"; public static final String CALL_IDENTIFICATION_SET = "CALL_IDENTIFICATION_SET"; public static final String BLOCK_CHECK_INITIATED = "BLOCK_CHECK_INITIATED"; public static final String BLOCK_CHECK_FINISHED = "BLOCK_CHECK_FINISHED"; public static final String DIRECT_TO_VM_INITIATED = "DIRECT_TO_VM_INITIATED"; Loading Loading
AndroidManifest.xml +3 −11 Original line number Diff line number Diff line Loading @@ -297,14 +297,6 @@ </intent-filter> </activity> <activity android:name="com.android.server.telecom.components.ChangeDefaultCallScreeningApp" android:label="@string/change_default_dialer_dialog_title" android:excludeFromRecents="true" android:theme="@*android:style/Theme.Material.Light.Dialog.Alert" android:priority="1000" android:process=":ui"> </activity> <activity android:name=".ui.TelecomDeveloperMenu" android:label="@string/developer_title" android:exported="false" Loading
src/com/android/server/telecom/Call.java +32 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.os.SystemClock; import android.os.Trace; import android.provider.ContactsContract.Contacts; import android.telecom.CallAudioState; import android.telecom.CallIdentification; import android.telecom.Conference; import android.telecom.ConnectionService; import android.telecom.DisconnectCause; Loading Loading @@ -141,6 +142,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, Bundle extras, boolean isLegacy); void onHandoverFailed(Call call, int error); void onHandoverComplete(Call call); void onCallIdentificationChanged(Call call); } public abstract static class ListenerBase implements Listener { Loading Loading @@ -219,6 +221,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, public void onHandoverFailed(Call call, int error) {} @Override public void onHandoverComplete(Call call) {} @Override public void onCallIdentificationChanged(Call call) {} } private final CallerInfoLookupHelper.OnQueryCompleteListener mCallerInfoQueryListener = Loading Loading @@ -529,6 +533,11 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, */ private boolean mIsUsingCallFiltering = false; /** * {@link CallIdentification} provided by a {@link android.telecom.CallScreeningService}. */ private CallIdentification mCallIdentification = null; /** * Persists the specified parameters and initializes the new instance. * @param context The context. Loading Loading @@ -3126,4 +3135,27 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, public void setIsUsingCallFiltering(boolean isUsingCallFiltering) { mIsUsingCallFiltering = isUsingCallFiltering; } /** * Update the {@link CallIdentification} for a call. * @param callIdentification the {@link CallIdentification}. */ public void setCallIdentification(CallIdentification callIdentification) { if (callIdentification != null) { Log.addEvent(this, LogUtils.Events.CALL_IDENTIFICATION_SET, callIdentification.getCallScreeningPackageName()); } mCallIdentification = callIdentification; for (Listener l : mListeners) { l.onCallIdentificationChanged(this); } } /** * @return Call identification returned by a {@link android.telecom.CallScreeningService}. */ public CallIdentification getCallIdentification() { return mCallIdentification; } }
src/com/android/server/telecom/CallLogManager.java +16 −10 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.os.Looper; import android.os.UserHandle; import android.os.PersistableBundle; import android.provider.CallLog.Calls; import android.telecom.CallIdentification; import android.telecom.Connection; import android.telecom.DisconnectCause; import android.telecom.Log; Loading @@ -42,12 +43,8 @@ import com.android.internal.telephony.CallerInfo; import com.android.server.telecom.callfiltering.CallFilteringResult; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Locale; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; /** Loading Loading @@ -85,7 +82,8 @@ public final class CallLogManager extends CallsManagerListenerBase { int features, PhoneAccountHandle accountHandle, long creationDate, long durationInMillis, Long dataUsage, UserHandle initiatingUser, boolean isRead, @Nullable LogCallCompletedListener logCallCompletedListener, int callBlockReason, String callScreeningAppName, String callScreeningComponentName) { String callScreeningAppName, String callScreeningComponentName, CallIdentification callIdentification) { this.context = context; this.callerInfo = callerInfo; this.number = number; Loading @@ -104,6 +102,7 @@ public final class CallLogManager extends CallsManagerListenerBase { this.callBockReason = callBlockReason; this.callScreeningAppName = callScreeningAppName; this.callScreeningComponentName = callScreeningComponentName; this.callIdentification = callIdentification; } // Since the members are accessed directly, we don't use the // mXxxx notation. Loading @@ -128,6 +127,8 @@ public final class CallLogManager extends CallsManagerListenerBase { public final int callBockReason; public final String callScreeningAppName; public final String callScreeningComponentName; public final CallIdentification callIdentification; } private static final String TAG = CallLogManager.class.getSimpleName(); Loading Loading @@ -256,20 +257,22 @@ public final class CallLogManager extends CallsManagerListenerBase { Connection.PROPERTY_ASSISTED_DIALING_USED, call.wasEverRttCall()); CallIdentification callIdentification = call.getCallIdentification(); if (callLogType == Calls.BLOCKED_TYPE) { logCall(call.getCallerInfo(), logNumber, call.getPostDialDigits(), formattedViaNumber, call.getHandlePresentation(), callLogType, callFeatures, accountHandle, creationTime, age, callDataUsage, call.isEmergencyCall(), call.getInitiatingUser(), call.isSelfManaged(), logCallCompletedListener, result.mCallBlockReason, result.mCallScreeningAppName, result.mCallScreeningComponentName); result.mCallScreeningComponentName, callIdentification); } else { logCall(call.getCallerInfo(), logNumber, call.getPostDialDigits(), formattedViaNumber, call.getHandlePresentation(), callLogType, callFeatures, accountHandle, creationTime, age, callDataUsage, call.isEmergencyCall(), call.getInitiatingUser(), call.isSelfManaged(), logCallCompletedListener, Calls.BLOCK_REASON_NOT_BLOCKED, null /*callScreeningAppName*/, null /*callScreeningComponentName*/); null /*callScreeningComponentName*/, callIdentification); } } Loading @@ -293,6 +296,8 @@ public final class CallLogManager extends CallsManagerListenerBase { * @param callBlockReason The reason why the call is blocked. * @param callScreeningAppName The call screening application name which block the call. * @param callScreeningComponentName The call screening component name which block the call. * @param callIdentification Call identification information, if provided by a call screening * service. */ private void logCall( CallerInfo callerInfo, Loading @@ -312,7 +317,8 @@ public final class CallLogManager extends CallsManagerListenerBase { @Nullable LogCallCompletedListener logCallCompletedListener, int callBlockReason, String callScreeningAppName, String callScreeningComponentName) { String callScreeningComponentName, @Nullable CallIdentification callIdentification) { // On some devices, to avoid accidental redialing of emergency numbers, we *never* log // emergency calls to the Call Log. (This behavior is set on a per-product basis, based Loading Loading @@ -346,7 +352,7 @@ public final class CallLogManager extends CallsManagerListenerBase { AddCallArgs args = new AddCallArgs(mContext, callerInfo, number, postDialDigits, viaNumber, presentation, callType, features, accountHandle, start, duration, dataUsage, initiatingUser, isRead, logCallCompletedListener, callBlockReason, callScreeningAppName, callScreeningComponentName); callScreeningAppName, callScreeningComponentName, callIdentification); logCallAsync(args); } else { Log.d(TAG, "Not adding emergency call to call log."); Loading Loading @@ -508,7 +514,7 @@ public final class CallLogManager extends CallsManagerListenerBase { c.presentation, c.callType, c.features, c.accountHandle, c.timestamp, c.durationInSec, c.dataUsage, userToBeInserted == null, userToBeInserted, c.isRead, c.callBockReason, c.callScreeningAppName, c.callScreeningComponentName); c.callScreeningComponentName, c.callIdentification); } Loading
src/com/android/server/telecom/InCallController.java +5 −0 Original line number Diff line number Diff line Loading @@ -696,6 +696,11 @@ public class InCallController extends CallsManagerListenerBase { public void onRemoteRttRequest(Call call, int requestId) { notifyRemoteRttRequest(call, requestId); } @Override public void onCallIdentificationChanged(Call call) { updateCall(call); } }; private final SystemStateListener mSystemStateListener = new SystemStateListener() { Loading
src/com/android/server/telecom/LogUtils.java +1 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ public class LogUtils { public static final String CONTROLLER_SCREENING_COMPLETED = "CONTROLLER_SCREENING_COMPLETED"; public static final String SCREENING_COMPLETED = "SCREENING_COMPLETED"; public static final String CALL_IDENTIFICATION_SET = "CALL_IDENTIFICATION_SET"; public static final String BLOCK_CHECK_INITIATED = "BLOCK_CHECK_INITIATED"; public static final String BLOCK_CHECK_FINISHED = "BLOCK_CHECK_FINISHED"; public static final String DIRECT_TO_VM_INITIATED = "DIRECT_TO_VM_INITIATED"; Loading