-
I have converted my application to default dialer using this package using the code below: import contacts.ui.util.requestToBeTheDefaultDialerApp
requestToBeTheDefaultDialerApp() I want a function to convert back the default Phone app in mobile as default dialer. Is there any possibility to do so? It would be a great help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @Gliting29, this is a good question. I spent a few hours searching the internet for an answer. I could not find one. I also played around with the code inside Let's take a look together. The code this library current use to change the default dialer app to the app executing the code is in DefaultDialerRequest.kt, fun Activity.requestToBeTheDefaultDialerApp() {
...
if (
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
Build.VERSION.SDK_INT < Build.VERSION_CODES.Q
) {
val intent = Intent(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER)
.putExtra(TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME, packageName)
startActivityForResult(intent, REQUEST_CODE_SET_AS_DEFAULT_DIALER)
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
val roleManager = getSystemService(Activity.ROLE_SERVICE) as RoleManager
startActivityForResult(
roleManager.createRequestRoleIntent(RoleManager.ROLE_DIALER),
REQUEST_CODE_SET_AS_DEFAULT_DIALER
)
}
...
} In the case of Even if we somehow make the case of I will close the issue you created from this; #295. Please feel free to investigate further. If you happen to find a solution, I would greatly appreciate it if you could reopen #295, fork this repo, and create a PR. Thanks and good luck! |
Beta Was this translation helpful? Give feedback.
Hey @Gliting29, this is a good question. I spent a few hours searching the internet for an answer. I could not find one. I also played around with the code inside
requestToBeTheDefaultDialerApp
to see what can be done and found no solution.Let's take a look together. The code this library current use to change the default dialer app to the app executing the code is in DefaultDialerRequest.kt,