Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
whoscall
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wei Han
whoscall
Commits
c6c3917f
Commit
c6c3917f
authored
Sep 09, 2025
by
Wei Han
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix for call screening role
parent
e09795ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
IncomingCallService.kt
...oid/app/src/main/java/com/whoscall/IncomingCallService.kt
+2
-2
MainActivity.kt
android/app/src/main/java/com/whoscall/MainActivity.kt
+16
-2
No files found.
android/app/src/main/java/com/whoscall/IncomingCallService.kt
View file @
c6c3917f
...
...
@@ -23,8 +23,8 @@ class IncomingCallService : CallScreeningService() {
// Lookup VIPs
// val prefs = getSharedPreferences("WhoscallPrefs", MODE_PRIVATE)
val
vipNumber
=
"+601
08222562
"
val
vipName
=
"A
rvin
"
val
vipNumber
=
"+601
64034061
"
val
vipName
=
"A
lyp
"
Log
.
d
(
"IncomingCallReceiver"
,
"Looking up number: $number, Found VIPNumber: $vipNumber, Found VIPName: $vipName"
)
// Only show overlay if VIP
...
...
android/app/src/main/java/com/whoscall/MainActivity.kt
View file @
c6c3917f
...
...
@@ -8,6 +8,7 @@ import android.provider.Settings
import
android.app.role.RoleManager
import
androidx.activity.result.contract.ActivityResultContracts
import
com.facebook.react.ReactActivity
import
android.os.Bundle
class
MainActivity
:
ReactActivity
()
{
...
...
@@ -35,11 +36,24 @@ class MainActivity : ReactActivity() {
private
fun
requestCallScreeningRoleIfNeeded
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
val
roleManager
=
getSystemService
(
Context
.
ROLE_SERVICE
)
as
RoleManager
val
intent
=
roleManager
.
createRequestRoleIntent
(
RoleManager
.
ROLE_CALL_SCREENING
)
roleLauncher
.
launch
(
intent
)
if
(!
roleManager
.
isRoleHeld
(
RoleManager
.
ROLE_CALL_SCREENING
))
{
val
intent
=
roleManager
.
createRequestRoleIntent
(
RoleManager
.
ROLE_CALL_SCREENING
)
roleLauncher
.
launch
(
intent
)
}
}
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
// Ask for overlay if needed
requestOverlay
()
// Ask for call screening role if needed
requestCallScreeningRoleIfNeeded
()
}
private
fun
simulateVipCall
()
{
val
vipNumber
=
"+60189884118"
val
vipName
=
"Wei Yi"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment