AbstractBankCallVerificationService

abstract class AbstractBankCallVerificationService : Service


Abstract class for a bound service that a Bank App should extend to integrate with the Google Play services phone spoofing prevention feature.

To implement this service, extend this class and override the onVerifyCall method. Optionally, override onEvent to handle events from Google Play services. Declare the service in your AndroidManifest.xml, ensuring it is protected by the com.google.android.gms.fraudprotect.permission.CALL_VALIDATION_SERVICE permission and includes an <intent-filter> for the action AbstractBankCallVerificationService.SERVICE_ACTION.

Example manifest declaration:

<service
android:name=".YourBankCallVerificationService"
android:exported="true"
android:permission="com.google.android.gms.fraudprotect.permission.CALL_VALIDATION_SERVICE">
<intent-filter>
<action android:name="com.google.android.gms.fraudprotect.ACTION_VERIFY_CALL" />
</intent-filter>
</service>

Summary

Nested types

A functional interface for the Bank App to return the CallVerificationVerdict back to Google Play services.

Constants

const String

The Intent action that must be declared in the <intent-filter> of this service in the AndroidManifest.xml.

Public constructors

Public functions

open IBinder?
onBind(intent: Intent)

Returns the communication channel IBinder to the service.

Protected functions

open Unit
onEvent(requestId: String, event: CallVerificationEvent)

Called when Google Play services sends an event regarding the call verification process.

abstract Unit
onVerifyCall(
    requestId: String,
    incomingNumber: String,
    userPhoneNumbersSuffixes: List<String>,
    submitter: AbstractBankCallVerificationService.VerdictSubmitter
)

Abstract method to be implemented by the Bank App.

Inherited functions

From android.content.Context
From android.content.ContextWrapper
open Boolean
bindIsolatedService(
    p0: Intent,
    p1: Int,
    p2: String,
    p3: Executor,
    p4: ServiceConnection
)
open Boolean
bindService(
    p0: Intent,
    p1: ServiceConnection,
    p2: Context.BindServiceFlags
)
open Boolean
open Boolean
bindService(
    p0: Intent,
    p1: Context.BindServiceFlags,
    p2: Executor,
    p3: ServiceConnection
)
open Boolean
bindService(p0: Intent, p1: Int, p2: Executor, p3: ServiceConnection)
open Boolean
bindServiceAsUser(
    p0: Intent,
    p1: ServiceConnection,
    p2: Context.BindServiceFlags,
    p3: UserHandle
)
open Boolean
open Int
open Int
open IntArray
open Int
open Int
open IntArray
open Int
@FlaggedApi(value = "android.security.content_uri_permission_apis")
checkContentUriPermissionFull(p0: Uri, p1: Int, p2: Int, p3: Int)
open Int
checkPermission(p0: String, p1: Int, p2: Int)
open Int
open Int
checkUriPermission(p0: Uri, p1: Int, p2: Int, p3: Int)
open Int
checkUriPermission(p0: Uri?, p1: String?, p2: String?, p3: Int, p4: Int, p5: Int)
open IntArray
checkUriPermissions(p0: MutableList<Uri>, p1: Int, p2: Int, p3: Int)
open Unit

This function is deprecated. Deprecated in Java

open Context
open Context
open Context
open Context
open Context
open Context
open Context
open Context
open Context
open Context
createWindowContext(p0: Display, p1: Int, p2: Bundle?)
open Array<String>
open Boolean
open Boolean
open Boolean
open Unit
open Unit
open Unit
open Unit
open Unit
enforcePermission(p0: String, p1: Int, p2: Int, p3: String?)
open Unit
enforceUriPermission(p0: Uri, p1: Int, p2: Int, p3: Int, p4: String)
open Unit
enforceUriPermission(
    p0: Uri?,
    p1: String?,
    p2: String?,
    p3: Int,
    p4: Int,
    p5: Int,
    p6: String?
)
open Array<String>
open Context
open ApplicationInfo
open AssetManager
open AttributionSource
open String?
open Context
open File
open ClassLoader
open File
open ContentResolver
open File
open File
open Int
open File
getDir(p0: String, p1: Int)
open Display?
open File?
open Array<File>
open File?
open Array<File>
open Array<File>
open File
open File
open Executor
open Looper
open File
open File
open Array<File>
open String
open String
open PackageManager
open String
open String
open ContextParams?
open Resources
open SharedPreferences
open Any
open String?
open Resources.Theme
open Drawable

This function is deprecated. Deprecated in Java

open Int

This function is deprecated. Deprecated in Java

open Int

This function is deprecated. Deprecated in Java

open Unit
grantUriPermission(p0: String, p1: Uri, p2: Int)
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open FileInputStream
open FileOutputStream
open SQLiteDatabase
open SQLiteDatabase
openOrCreateDatabase(
    p0: String,
    p1: Int,
    p2: SQLiteDatabase.CursorFactory,
    p3: DatabaseErrorHandler?
)
open Drawable

This function is deprecated. Deprecated in Java

open Unit
open Unit
open Unit
open Intent?
open Intent?
open Intent?
registerReceiver(
    p0: BroadcastReceiver?,
    p1: IntentFilter,
    p2: String?,
    p3: Handler?
)
open Intent?
registerReceiver(
    p0: BroadcastReceiver?,
    p1: IntentFilter,
    p2: String?,
    p3: Handler?,
    p4: Int
)
open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit
open Unit
open Unit
revokeUriPermission(p0: String, p1: Uri, p2: Int)
open Unit
open Unit
open Unit
sendBroadcast(p0: Intent, p1: String?, p2: Bundle?)
open Unit
open Unit
open Unit
open Unit
open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: String?,
    p2: BroadcastReceiver?,
    p3: Handler?,
    p4: Int,
    p5: String?,
    p6: Bundle?
)
open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: String?,
    p2: Bundle?,
    p3: BroadcastReceiver?,
    p4: Handler?,
    p5: Int,
    p6: String?,
    p7: Bundle?
)
open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: String?,
    p2: String?,
    p3: BroadcastReceiver?,
    p4: Handler?,
    p5: Int,
    p6: String?,
    p7: Bundle?
)
open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: Int,
    p2: String?,
    p3: String?,
    p4: BroadcastReceiver?,
    p5: Handler?,
    p6: String?,
    p7: Bundle?,
    p8: Bundle?
)
open Unit
sendOrderedBroadcastAsUser(
    p0: Intent,
    p1: UserHandle,
    p2: String?,
    p3: BroadcastReceiver?,
    p4: Handler?,
    p5: Int,
    p6: String?,
    p7: Bundle?
)
open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit
sendStickyOrderedBroadcast(
    p0: Intent,
    p1: BroadcastReceiver?,
    p2: Handler?,
    p3: Int,
    p4: String?,
    p5: Bundle?
)

This function is deprecated. Deprecated in Java

open Unit
sendStickyOrderedBroadcastAsUser(
    p0: Intent,
    p1: UserHandle,
    p2: BroadcastReceiver?,
    p3: Handler?,
    p4: Int,
    p5: String?,
    p6: Bundle?
)

This function is deprecated. Deprecated in Java

open Unit
open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Boolean
open Unit
open Unit
open Unit
open Unit
open ComponentName?
open Boolean
open Unit
startIntentSender(p0: IntentSender, p1: Intent?, p2: Int, p3: Int, p4: Int)
open Unit
startIntentSender(
    p0: IntentSender,
    p1: Intent?,
    p2: Int,
    p3: Int,
    p4: Int,
    p5: Bundle?
)
open ComponentName?
open Boolean
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
From android.app.Service
open Unit
open Unit
Application
Int
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
onStart(p0: Intent, p1: Int)

This function is deprecated. Deprecated in Java

open Int
onStartCommand(p0: Intent, p1: Int, p2: Int)
open Unit
open Unit
open Unit
onTimeout(p0: Int, p1: Int)
open Unit
open Boolean
Unit
Unit
startForeground(p0: Int, p1: Notification, p2: Int)
Unit

This function is deprecated. Deprecated in Java

Unit
Unit
Unit
Boolean

Constants

SERVICE_ACTION

const val SERVICE_ACTIONString

The Intent action that must be declared in the <intent-filter> of this service in the AndroidManifest.xml.

Public constructors

AbstractBankCallVerificationService

AbstractBankCallVerificationService()

Public functions

onBind

open fun onBind(intent: Intent): IBinder?

Returns the communication channel IBinder to the service.

Protected functions

onEvent

protected open fun onEvent(requestId: String, event: CallVerificationEvent): Unit

Called when Google Play services sends an event regarding the call verification process.

A Bank App can override this method to log or react to CallVerificationEvent updates from Google Play services, such as timeouts or confirmations of actions taken (for example, call ended). The default implementation is a no-op.

Parameters
requestId: String

The unique identifier for the original verification request.

event: CallVerificationEvent

The CallVerificationEvent object containing details about the event.

onVerifyCall

protected abstract fun onVerifyCall(
    requestId: String,
    incomingNumber: String,
    userPhoneNumbersSuffixes: List<String>,
    submitter: AbstractBankCallVerificationService.VerdictSubmitter
): Unit

Abstract method to be implemented by the Bank App. This method is called by Google Play services when an incoming call from a number registered with the Bank is detected.

The implementation should perform the necessary checks (potentially involving backend systems) to determine if the call is legitimate for the current user context. Once a determination is made, the result MUST be sent back using the provided VerdictSubmitter.submit method.

This method is called on a Binder thread. Implementations should offload any long-running operations (like network requests) to a background thread to avoid blocking the Binder thread and potentially causing Application Not Responding (ANR) errors. The VerdictSubmitter object can be safely used from a background thread.

Parameters
requestId: String

A unique identifier for this specific verification request. Use this for logging or correlation if needed.

incomingNumber: String

The E.164 formatted phone number of the incoming call.

userPhoneNumbersSuffixes: List<String>

A list of phone number suffixes associated with the SIM(s) on the user's device. This list may be empty if the user's phone number(s) cannot be determined.

submitter: AbstractBankCallVerificationService.VerdictSubmitter

The interface to invoke to return the verdict to Google Play services.