Loading src/com/android/server/telecom/CallsManager.java +1 −7 Original line number Diff line number Diff line Loading @@ -79,7 +79,6 @@ import com.android.server.telecom.callfiltering.AsyncBlockCheckFilter; import com.android.server.telecom.callfiltering.BlockCheckerAdapter; import com.android.server.telecom.callfiltering.CallFilterResultCallback; import com.android.server.telecom.callfiltering.CallFilteringResult; import com.android.server.telecom.callfiltering.CallFilteringResult.Builder; import com.android.server.telecom.callfiltering.CallScreeningServiceController; import com.android.server.telecom.callfiltering.DirectToVoicemailCallFilter; import com.android.server.telecom.callfiltering.IncomingCallFilter; Loading Loading @@ -610,12 +609,7 @@ public class CallsManager extends Call.ListenerBase incomingCall.hasProperty(Connection.PROPERTY_EMERGENCY_CALLBACK_MODE), incomingCall.isSelfManaged(), extras.getBoolean(PhoneAccount.EXTRA_SKIP_CALL_FILTERING)); onCallFilteringComplete(incomingCall, new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build()); onCallFilteringComplete(incomingCall, new CallFilteringResult(true, false, true, true)); incomingCall.setIsUsingCallFiltering(false); return; } Loading src/com/android/server/telecom/callfiltering/AsyncBlockCheckFilter.java +15 −16 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import com.android.internal.telephony.CallerInfo; import com.android.server.telecom.Call; import com.android.server.telecom.CallerInfoLookupHelper; import com.android.server.telecom.LogUtils; import com.android.server.telecom.callfiltering.CallFilteringResult.Builder; import com.android.server.telecom.settings.BlockedNumbersUtil; /** Loading Loading @@ -122,15 +121,15 @@ public class AsyncBlockCheckFilter extends AsyncTask<String, Void, Boolean> try { CallFilteringResult result; if (isBlocked) { result = new Builder() .setShouldAllowCall(false) .setShouldReject(true) .setShouldAddToCallLog(true) .setShouldShowNotification(false) .setCallBlockReason(convertBlockStatusToReason()) .setCallScreeningAppName(null) .setCallScreeningComponentName(null) .build(); result = new CallFilteringResult( false, // shouldAllowCall true, //shouldReject true, //shouldAddToCallLog false, // shouldShowNotification convertBlockStatusToReason(), //callBlockReason null, //callScreeningAppName null //callScreeningComponentName ); if (mCallBlockListener != null) { String number = mIncomingCall.getHandle() == null ? null : mIncomingCall.getHandle().getSchemeSpecificPart(); Loading @@ -138,12 +137,12 @@ public class AsyncBlockCheckFilter extends AsyncTask<String, Void, Boolean> mIncomingCall.getInitiatingUser()); } } else { result = new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); result = new CallFilteringResult( true, // shouldAllowCall false, // shouldReject true, // shouldAddToCallLog true // shouldShowNotification ); } Log.addEvent(mIncomingCall, LogUtils.Events.BLOCK_CHECK_FINISHED, BlockedNumberContract.SystemContract.blockStatusToString(mBlockStatus) + " " Loading src/com/android/server/telecom/callfiltering/CallFilteringResult.java +50 −78 Original line number Diff line number Diff line Loading @@ -21,73 +21,47 @@ import android.provider.CallLog.Calls; import android.text.TextUtils; public class CallFilteringResult { public static class Builder { private boolean mShouldAllowCall; private boolean mShouldReject; private boolean mShouldAddToCallLog; private boolean mShouldShowNotification; private boolean mShouldSilence = false; private int mCallBlockReason = Calls.BLOCK_REASON_NOT_BLOCKED; private CharSequence mCallScreeningAppName = null; private String mCallScreeningComponentName = null; public Builder setShouldAllowCall(boolean shouldAllowCall) { mShouldAllowCall = shouldAllowCall; return this; } public Builder setShouldReject(boolean shouldReject) { mShouldReject = shouldReject; return this; } public Builder setShouldAddToCallLog(boolean shouldAddToCallLog) { mShouldAddToCallLog = shouldAddToCallLog; return this; } public Builder setShouldShowNotification(boolean shouldShowNotification) { mShouldShowNotification = shouldShowNotification; return this; } public Builder setShouldSilence(boolean shouldSilence) { mShouldSilence = shouldSilence; return this; } public Builder setCallBlockReason(int callBlockReason) { mCallBlockReason = callBlockReason; return this; } public boolean shouldAllowCall; public boolean shouldReject; public boolean shouldSilence; public boolean shouldAddToCallLog; public boolean shouldShowNotification; public int mCallBlockReason = CallLog.Calls.BLOCK_REASON_NOT_BLOCKED; public CharSequence mCallScreeningAppName = null; public String mCallScreeningComponentName = null; public Builder setCallScreeningAppName(CharSequence callScreeningAppName) { mCallScreeningAppName = callScreeningAppName; return this; public CallFilteringResult(boolean shouldAllowCall, boolean shouldReject, boolean shouldAddToCallLog, boolean shouldShowNotification) { this.shouldAllowCall = shouldAllowCall; this.shouldReject = shouldReject; this.shouldSilence = false; this.shouldAddToCallLog = shouldAddToCallLog; this.shouldShowNotification = shouldShowNotification; } public Builder setCallScreeningComponentName(String callScreeningComponentName) { mCallScreeningComponentName = callScreeningComponentName; return this; public CallFilteringResult(boolean shouldAllowCall, boolean shouldReject, boolean shouldAddToCallLog, boolean shouldShowNotification, int callBlockReason, CharSequence callScreeningAppName, String callScreeningComponentName) { this.shouldAllowCall = shouldAllowCall; this.shouldReject = shouldReject; this.shouldSilence = false; this.shouldAddToCallLog = shouldAddToCallLog; this.shouldShowNotification = shouldShowNotification; this.mCallBlockReason = callBlockReason; this.mCallScreeningAppName = callScreeningAppName; this.mCallScreeningComponentName = callScreeningComponentName; } public CallFilteringResult build() { return new CallFilteringResult(mShouldAllowCall, mShouldReject, mShouldSilence, mShouldAddToCallLog, mShouldShowNotification, mCallBlockReason, mCallScreeningAppName, mCallScreeningComponentName); } public CallFilteringResult(boolean shouldAllowCall, boolean shouldReject, boolean shouldSilence, boolean shouldAddToCallLog, boolean shouldShowNotification) { this.shouldAllowCall = shouldAllowCall; this.shouldReject = shouldReject; this.shouldSilence = shouldSilence; this.shouldAddToCallLog = shouldAddToCallLog; this.shouldShowNotification = shouldShowNotification; } public boolean shouldAllowCall; public boolean shouldReject; public boolean shouldSilence; public boolean shouldAddToCallLog; public boolean shouldShowNotification; public int mCallBlockReason; public CharSequence mCallScreeningAppName; public String mCallScreeningComponentName; private CallFilteringResult(boolean shouldAllowCall, boolean shouldReject, boolean public CallFilteringResult(boolean shouldAllowCall, boolean shouldReject, boolean shouldSilence, boolean shouldAddToCallLog, boolean shouldShowNotification, int callBlockReason, CharSequence callScreeningAppName, String callScreeningComponentName) { this.shouldAllowCall = shouldAllowCall; Loading Loading @@ -135,13 +109,12 @@ public class CallFilteringResult { other.mCallScreeningAppName, other.mCallScreeningComponentName); } return new Builder() .setShouldAllowCall(shouldAllowCall && other.shouldAllowCall) .setShouldReject(shouldReject || other.shouldReject) .setShouldSilence(shouldSilence || other.shouldSilence) .setShouldAddToCallLog(shouldAddToCallLog && other.shouldAddToCallLog) .setShouldShowNotification(shouldShowNotification && other.shouldShowNotification) .build(); return new CallFilteringResult( shouldAllowCall && other.shouldAllowCall, shouldReject || other.shouldReject, shouldSilence || other.shouldSilence, shouldAddToCallLog && other.shouldAddToCallLog, shouldShowNotification && other.shouldShowNotification); } private boolean isBlockedByProvider(int blockReason) { Loading @@ -158,16 +131,15 @@ public class CallFilteringResult { private CallFilteringResult getCombinedCallFilteringResult(CallFilteringResult other, int callBlockReason, CharSequence callScreeningAppName, String callScreeningComponentName) { return new Builder() .setShouldAllowCall(shouldAllowCall && other.shouldAllowCall) .setShouldReject(shouldReject || other.shouldReject) .setShouldSilence(shouldSilence || other.shouldSilence) .setShouldAddToCallLog(shouldAddToCallLog && other.shouldAddToCallLog) .setShouldShowNotification(shouldShowNotification && other.shouldShowNotification) .setCallBlockReason(callBlockReason) .setCallScreeningAppName(callScreeningAppName) .setCallScreeningComponentName(callScreeningComponentName) .build(); return new CallFilteringResult( shouldAllowCall && other.shouldAllowCall, shouldReject || other.shouldReject, shouldSilence|| other.shouldSilence, shouldAddToCallLog && other.shouldAddToCallLog, shouldShowNotification && other.shouldShowNotification, callBlockReason, callScreeningAppName, callScreeningComponentName); } Loading src/com/android/server/telecom/callfiltering/CallScreeningServiceController.java +6 −7 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import com.android.server.telecom.ParcelableCallUtils; import com.android.server.telecom.PhoneAccountRegistrar; import com.android.server.telecom.TelecomServiceImpl; import com.android.server.telecom.TelecomSystem; import com.android.server.telecom.callfiltering.CallFilteringResult.Builder; /** * This class supports binding to the various {@link android.telecom.CallScreeningService}: Loading Loading @@ -67,12 +66,12 @@ public class CallScreeningServiceController implements IncomingCallFilter.CallFi private Call mCall; private CallFilterResultCallback mCallback; private CallFilteringResult mResult = new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); private CallFilteringResult mResult = new CallFilteringResult( true, // shouldAllowCall false, // shouldReject true, // shouldAddToCallLog true // shouldShowNotification ); private boolean mIsFinished; private boolean mIsCarrierFinished; Loading src/com/android/server/telecom/callfiltering/CallScreeningServiceFilter.java +31 −32 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ import android.os.IBinder; import android.os.PersistableBundle; import android.os.RemoteException; import android.os.UserHandle; import android.provider.CallLog.Calls; import android.provider.CallLog; import android.provider.Settings; import android.telecom.Log; import android.telecom.TelecomManager; Loading @@ -41,7 +41,6 @@ import com.android.server.telecom.ParcelableCallUtils; import com.android.server.telecom.PhoneAccountRegistrar; import com.android.server.telecom.TelecomServiceImpl.SettingsSecureAdapter; import com.android.server.telecom.TelecomSystem; import com.android.server.telecom.callfiltering.CallFilteringResult.Builder; /** * Binds to {@link ICallScreeningService} to allow call blocking. A single instance of this class Loading Loading @@ -97,13 +96,13 @@ public class CallScreeningServiceFilter { synchronized (mTelecomLock) { Log.d(this, "allowCall(%s)", callId); if (mCall != null && mCall.getId().equals(callId)) { mResult = new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldSilence(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); mResult = new CallFilteringResult( true, // shouldAllowCall false, //shouldReject false, //shouldSilence true, //shouldAddToCallLog true // shouldShowNotification ); } else { Log.w(this, "allowCall, unknown call id: %s", callId); } Loading Loading @@ -132,16 +131,16 @@ public class CallScreeningServiceFilter { + "shouldShowNotification: %b", callId, shouldReject, isServiceRequestingLogging, shouldShowNotification); if (mCall != null && mCall.getId().equals(callId)) { mResult = new Builder() .setShouldAllowCall(false) .setShouldReject(shouldReject) .setShouldSilence(false) .setShouldAddToCallLog(isServiceRequestingLogging) .setShouldShowNotification(shouldShowNotification) .setCallBlockReason(Calls.BLOCK_REASON_CALL_SCREENING_SERVICE) .setCallScreeningAppName(mAppName) .setCallScreeningComponentName(componentName.flattenToString()) .build(); mResult = new CallFilteringResult( false, // shouldAllowCall shouldReject, //shouldReject false, // shouldSilenceCall isServiceRequestingLogging, //shouldAddToCallLog shouldShowNotification, // shouldShowNotification CallLog.Calls.BLOCK_REASON_CALL_SCREENING_SERVICE, //callBlockReason mAppName, //callScreeningAppName componentName.flattenToString() //callScreeningComponentName ); } else { Log.w(this, "disallowCall, unknown call id: %s", callId); } Loading @@ -161,13 +160,13 @@ public class CallScreeningServiceFilter { synchronized (mTelecomLock) { Log.d(this, "silenceCall(%s)", callId); if (mCall != null && mCall.getId().equals(callId)) { mResult = new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldSilence(true) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); mResult = new CallFilteringResult( true, // shouldAllowCall false, //shouldReject true, //shouldSilence true, //shouldAddToCallLog true // shouldShowNotification ); } else { Log.w(this, "silenceCall, unknown call id: %s", callId); } Loading Loading @@ -200,12 +199,12 @@ public class CallScreeningServiceFilter { private boolean mHasFinished = false; private int mCallScreeningServiceType; private CallFilteringResult mResult = new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); private CallFilteringResult mResult = new CallFilteringResult( true, // shouldAllowCall false, //shouldReject true, //shouldAddToCallLog true // shouldShowNotification ); public CallScreeningServiceFilter( Context context, Loading Loading
src/com/android/server/telecom/CallsManager.java +1 −7 Original line number Diff line number Diff line Loading @@ -79,7 +79,6 @@ import com.android.server.telecom.callfiltering.AsyncBlockCheckFilter; import com.android.server.telecom.callfiltering.BlockCheckerAdapter; import com.android.server.telecom.callfiltering.CallFilterResultCallback; import com.android.server.telecom.callfiltering.CallFilteringResult; import com.android.server.telecom.callfiltering.CallFilteringResult.Builder; import com.android.server.telecom.callfiltering.CallScreeningServiceController; import com.android.server.telecom.callfiltering.DirectToVoicemailCallFilter; import com.android.server.telecom.callfiltering.IncomingCallFilter; Loading Loading @@ -610,12 +609,7 @@ public class CallsManager extends Call.ListenerBase incomingCall.hasProperty(Connection.PROPERTY_EMERGENCY_CALLBACK_MODE), incomingCall.isSelfManaged(), extras.getBoolean(PhoneAccount.EXTRA_SKIP_CALL_FILTERING)); onCallFilteringComplete(incomingCall, new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build()); onCallFilteringComplete(incomingCall, new CallFilteringResult(true, false, true, true)); incomingCall.setIsUsingCallFiltering(false); return; } Loading
src/com/android/server/telecom/callfiltering/AsyncBlockCheckFilter.java +15 −16 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import com.android.internal.telephony.CallerInfo; import com.android.server.telecom.Call; import com.android.server.telecom.CallerInfoLookupHelper; import com.android.server.telecom.LogUtils; import com.android.server.telecom.callfiltering.CallFilteringResult.Builder; import com.android.server.telecom.settings.BlockedNumbersUtil; /** Loading Loading @@ -122,15 +121,15 @@ public class AsyncBlockCheckFilter extends AsyncTask<String, Void, Boolean> try { CallFilteringResult result; if (isBlocked) { result = new Builder() .setShouldAllowCall(false) .setShouldReject(true) .setShouldAddToCallLog(true) .setShouldShowNotification(false) .setCallBlockReason(convertBlockStatusToReason()) .setCallScreeningAppName(null) .setCallScreeningComponentName(null) .build(); result = new CallFilteringResult( false, // shouldAllowCall true, //shouldReject true, //shouldAddToCallLog false, // shouldShowNotification convertBlockStatusToReason(), //callBlockReason null, //callScreeningAppName null //callScreeningComponentName ); if (mCallBlockListener != null) { String number = mIncomingCall.getHandle() == null ? null : mIncomingCall.getHandle().getSchemeSpecificPart(); Loading @@ -138,12 +137,12 @@ public class AsyncBlockCheckFilter extends AsyncTask<String, Void, Boolean> mIncomingCall.getInitiatingUser()); } } else { result = new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); result = new CallFilteringResult( true, // shouldAllowCall false, // shouldReject true, // shouldAddToCallLog true // shouldShowNotification ); } Log.addEvent(mIncomingCall, LogUtils.Events.BLOCK_CHECK_FINISHED, BlockedNumberContract.SystemContract.blockStatusToString(mBlockStatus) + " " Loading
src/com/android/server/telecom/callfiltering/CallFilteringResult.java +50 −78 Original line number Diff line number Diff line Loading @@ -21,73 +21,47 @@ import android.provider.CallLog.Calls; import android.text.TextUtils; public class CallFilteringResult { public static class Builder { private boolean mShouldAllowCall; private boolean mShouldReject; private boolean mShouldAddToCallLog; private boolean mShouldShowNotification; private boolean mShouldSilence = false; private int mCallBlockReason = Calls.BLOCK_REASON_NOT_BLOCKED; private CharSequence mCallScreeningAppName = null; private String mCallScreeningComponentName = null; public Builder setShouldAllowCall(boolean shouldAllowCall) { mShouldAllowCall = shouldAllowCall; return this; } public Builder setShouldReject(boolean shouldReject) { mShouldReject = shouldReject; return this; } public Builder setShouldAddToCallLog(boolean shouldAddToCallLog) { mShouldAddToCallLog = shouldAddToCallLog; return this; } public Builder setShouldShowNotification(boolean shouldShowNotification) { mShouldShowNotification = shouldShowNotification; return this; } public Builder setShouldSilence(boolean shouldSilence) { mShouldSilence = shouldSilence; return this; } public Builder setCallBlockReason(int callBlockReason) { mCallBlockReason = callBlockReason; return this; } public boolean shouldAllowCall; public boolean shouldReject; public boolean shouldSilence; public boolean shouldAddToCallLog; public boolean shouldShowNotification; public int mCallBlockReason = CallLog.Calls.BLOCK_REASON_NOT_BLOCKED; public CharSequence mCallScreeningAppName = null; public String mCallScreeningComponentName = null; public Builder setCallScreeningAppName(CharSequence callScreeningAppName) { mCallScreeningAppName = callScreeningAppName; return this; public CallFilteringResult(boolean shouldAllowCall, boolean shouldReject, boolean shouldAddToCallLog, boolean shouldShowNotification) { this.shouldAllowCall = shouldAllowCall; this.shouldReject = shouldReject; this.shouldSilence = false; this.shouldAddToCallLog = shouldAddToCallLog; this.shouldShowNotification = shouldShowNotification; } public Builder setCallScreeningComponentName(String callScreeningComponentName) { mCallScreeningComponentName = callScreeningComponentName; return this; public CallFilteringResult(boolean shouldAllowCall, boolean shouldReject, boolean shouldAddToCallLog, boolean shouldShowNotification, int callBlockReason, CharSequence callScreeningAppName, String callScreeningComponentName) { this.shouldAllowCall = shouldAllowCall; this.shouldReject = shouldReject; this.shouldSilence = false; this.shouldAddToCallLog = shouldAddToCallLog; this.shouldShowNotification = shouldShowNotification; this.mCallBlockReason = callBlockReason; this.mCallScreeningAppName = callScreeningAppName; this.mCallScreeningComponentName = callScreeningComponentName; } public CallFilteringResult build() { return new CallFilteringResult(mShouldAllowCall, mShouldReject, mShouldSilence, mShouldAddToCallLog, mShouldShowNotification, mCallBlockReason, mCallScreeningAppName, mCallScreeningComponentName); } public CallFilteringResult(boolean shouldAllowCall, boolean shouldReject, boolean shouldSilence, boolean shouldAddToCallLog, boolean shouldShowNotification) { this.shouldAllowCall = shouldAllowCall; this.shouldReject = shouldReject; this.shouldSilence = shouldSilence; this.shouldAddToCallLog = shouldAddToCallLog; this.shouldShowNotification = shouldShowNotification; } public boolean shouldAllowCall; public boolean shouldReject; public boolean shouldSilence; public boolean shouldAddToCallLog; public boolean shouldShowNotification; public int mCallBlockReason; public CharSequence mCallScreeningAppName; public String mCallScreeningComponentName; private CallFilteringResult(boolean shouldAllowCall, boolean shouldReject, boolean public CallFilteringResult(boolean shouldAllowCall, boolean shouldReject, boolean shouldSilence, boolean shouldAddToCallLog, boolean shouldShowNotification, int callBlockReason, CharSequence callScreeningAppName, String callScreeningComponentName) { this.shouldAllowCall = shouldAllowCall; Loading Loading @@ -135,13 +109,12 @@ public class CallFilteringResult { other.mCallScreeningAppName, other.mCallScreeningComponentName); } return new Builder() .setShouldAllowCall(shouldAllowCall && other.shouldAllowCall) .setShouldReject(shouldReject || other.shouldReject) .setShouldSilence(shouldSilence || other.shouldSilence) .setShouldAddToCallLog(shouldAddToCallLog && other.shouldAddToCallLog) .setShouldShowNotification(shouldShowNotification && other.shouldShowNotification) .build(); return new CallFilteringResult( shouldAllowCall && other.shouldAllowCall, shouldReject || other.shouldReject, shouldSilence || other.shouldSilence, shouldAddToCallLog && other.shouldAddToCallLog, shouldShowNotification && other.shouldShowNotification); } private boolean isBlockedByProvider(int blockReason) { Loading @@ -158,16 +131,15 @@ public class CallFilteringResult { private CallFilteringResult getCombinedCallFilteringResult(CallFilteringResult other, int callBlockReason, CharSequence callScreeningAppName, String callScreeningComponentName) { return new Builder() .setShouldAllowCall(shouldAllowCall && other.shouldAllowCall) .setShouldReject(shouldReject || other.shouldReject) .setShouldSilence(shouldSilence || other.shouldSilence) .setShouldAddToCallLog(shouldAddToCallLog && other.shouldAddToCallLog) .setShouldShowNotification(shouldShowNotification && other.shouldShowNotification) .setCallBlockReason(callBlockReason) .setCallScreeningAppName(callScreeningAppName) .setCallScreeningComponentName(callScreeningComponentName) .build(); return new CallFilteringResult( shouldAllowCall && other.shouldAllowCall, shouldReject || other.shouldReject, shouldSilence|| other.shouldSilence, shouldAddToCallLog && other.shouldAddToCallLog, shouldShowNotification && other.shouldShowNotification, callBlockReason, callScreeningAppName, callScreeningComponentName); } Loading
src/com/android/server/telecom/callfiltering/CallScreeningServiceController.java +6 −7 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import com.android.server.telecom.ParcelableCallUtils; import com.android.server.telecom.PhoneAccountRegistrar; import com.android.server.telecom.TelecomServiceImpl; import com.android.server.telecom.TelecomSystem; import com.android.server.telecom.callfiltering.CallFilteringResult.Builder; /** * This class supports binding to the various {@link android.telecom.CallScreeningService}: Loading Loading @@ -67,12 +66,12 @@ public class CallScreeningServiceController implements IncomingCallFilter.CallFi private Call mCall; private CallFilterResultCallback mCallback; private CallFilteringResult mResult = new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); private CallFilteringResult mResult = new CallFilteringResult( true, // shouldAllowCall false, // shouldReject true, // shouldAddToCallLog true // shouldShowNotification ); private boolean mIsFinished; private boolean mIsCarrierFinished; Loading
src/com/android/server/telecom/callfiltering/CallScreeningServiceFilter.java +31 −32 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ import android.os.IBinder; import android.os.PersistableBundle; import android.os.RemoteException; import android.os.UserHandle; import android.provider.CallLog.Calls; import android.provider.CallLog; import android.provider.Settings; import android.telecom.Log; import android.telecom.TelecomManager; Loading @@ -41,7 +41,6 @@ import com.android.server.telecom.ParcelableCallUtils; import com.android.server.telecom.PhoneAccountRegistrar; import com.android.server.telecom.TelecomServiceImpl.SettingsSecureAdapter; import com.android.server.telecom.TelecomSystem; import com.android.server.telecom.callfiltering.CallFilteringResult.Builder; /** * Binds to {@link ICallScreeningService} to allow call blocking. A single instance of this class Loading Loading @@ -97,13 +96,13 @@ public class CallScreeningServiceFilter { synchronized (mTelecomLock) { Log.d(this, "allowCall(%s)", callId); if (mCall != null && mCall.getId().equals(callId)) { mResult = new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldSilence(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); mResult = new CallFilteringResult( true, // shouldAllowCall false, //shouldReject false, //shouldSilence true, //shouldAddToCallLog true // shouldShowNotification ); } else { Log.w(this, "allowCall, unknown call id: %s", callId); } Loading Loading @@ -132,16 +131,16 @@ public class CallScreeningServiceFilter { + "shouldShowNotification: %b", callId, shouldReject, isServiceRequestingLogging, shouldShowNotification); if (mCall != null && mCall.getId().equals(callId)) { mResult = new Builder() .setShouldAllowCall(false) .setShouldReject(shouldReject) .setShouldSilence(false) .setShouldAddToCallLog(isServiceRequestingLogging) .setShouldShowNotification(shouldShowNotification) .setCallBlockReason(Calls.BLOCK_REASON_CALL_SCREENING_SERVICE) .setCallScreeningAppName(mAppName) .setCallScreeningComponentName(componentName.flattenToString()) .build(); mResult = new CallFilteringResult( false, // shouldAllowCall shouldReject, //shouldReject false, // shouldSilenceCall isServiceRequestingLogging, //shouldAddToCallLog shouldShowNotification, // shouldShowNotification CallLog.Calls.BLOCK_REASON_CALL_SCREENING_SERVICE, //callBlockReason mAppName, //callScreeningAppName componentName.flattenToString() //callScreeningComponentName ); } else { Log.w(this, "disallowCall, unknown call id: %s", callId); } Loading @@ -161,13 +160,13 @@ public class CallScreeningServiceFilter { synchronized (mTelecomLock) { Log.d(this, "silenceCall(%s)", callId); if (mCall != null && mCall.getId().equals(callId)) { mResult = new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldSilence(true) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); mResult = new CallFilteringResult( true, // shouldAllowCall false, //shouldReject true, //shouldSilence true, //shouldAddToCallLog true // shouldShowNotification ); } else { Log.w(this, "silenceCall, unknown call id: %s", callId); } Loading Loading @@ -200,12 +199,12 @@ public class CallScreeningServiceFilter { private boolean mHasFinished = false; private int mCallScreeningServiceType; private CallFilteringResult mResult = new Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .build(); private CallFilteringResult mResult = new CallFilteringResult( true, // shouldAllowCall false, //shouldReject true, //shouldAddToCallLog true // shouldShowNotification ); public CallScreeningServiceFilter( Context context, Loading