Skip to content

Commit 20e5f67

Browse files
committed
Remove toast with call_screening_role_already_granted
1 parent 6873d14 commit 20e5f67

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

app/src/main/java/com/addev/listaspam/MainActivity.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ class MainActivity : AppCompatActivity() {
135135
@RequiresApi(Build.VERSION_CODES.Q)
136136
private fun requestRoleForQAndAbove() {
137137
val roleManager = getSystemService(Context.ROLE_SERVICE) as RoleManager
138-
if (roleManager.isRoleHeld(RoleManager.ROLE_CALL_SCREENING)) {
139-
showToast(this, getString(R.string.call_screening_role_already_granted))
140-
} else {
138+
if (!roleManager.isRoleHeld(RoleManager.ROLE_CALL_SCREENING)) {
141139
val intent = roleManager.createRequestRoleIntent(RoleManager.ROLE_CALL_SCREENING)
142140
intentLauncher.launch(intent)
143141
showToast(this, getString(R.string.call_screening_role_prompt), Toast.LENGTH_LONG)

app/src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<resources>
22
<string name="app_name">ListaSpam</string>
33
<string name="call_screening_role_prompt">Please grant Call Screening role to this app.</string>
4-
<string name="call_screening_role_already_granted">Call Screening role is already granted.</string>
54
<string name="telecom_manager_unavailable">TelecomManager not available.</string>
65
<string name="role_manager_unavailable">RoleManager is not available on this device.</string>
76

0 commit comments

Comments
 (0)