File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
app/src/main/java/com/addev/listaspam Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ class MainActivity : AppCompatActivity() {
118118 /* *
119119 * Requests the call screening role.
120120 */
121+ @RequiresApi(Build .VERSION_CODES .Q )
121122 private fun requestCallScreeningRole () {
122123 val telecomManager = ContextCompat .getSystemService(this , TelecomManager ::class .java)
123124
@@ -142,4 +143,20 @@ class MainActivity : AppCompatActivity() {
142143 showToast(this , getString(R .string.call_screening_role_prompt), Toast .LENGTH_LONG )
143144 }
144145 }
146+
147+ /*
148+ /**
149+ * Requests the call screening role for Android P (API level 28) and below.
150+ * @param telecomManager The TelecomManager for managing telecom services.
151+ */
152+ private fun requestRoleForBelowQ(telecomManager: TelecomManager) {
153+ if (telecomManager.defaultDialerPackage == packageName) {
154+ showToast(this, getString(R.string.call_screening_role_already_granted))
155+ } else {
156+ val intent = Intent(Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS)
157+ startActivity(intent)
158+ showToast(this, getString(R.string.call_screening_role_prompt), Toast.LENGTH_LONG)
159+ }
160+ }
161+ */
145162}
You can’t perform that action at this time.
0 commit comments