Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ACTION_DIAL but do not work automatically #25

Open
dalishen99 opened this issue Mar 4, 2020 · 2 comments
Open

Use ACTION_DIAL but do not work automatically #25

dalishen99 opened this issue Mar 4, 2020 · 2 comments

Comments

@dalishen99
Copy link

Hi I using follow code ,the secret is pasted to the dial UI, But it do not automatically jump to the engineer IMEI UI(if you input #*06# manually from UI it will work)

Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:" + "*%2306%23")); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent);

is there any solution for this? Thanks.
微信图片_20200304232010

@MFeijo96
Copy link

Hi,

To make this action automatically you need to use Intent.ACTION_CALL as intent parameter.

@Chrisi2209
Copy link

Hi,

Accessing secret codes like this has been banned. The user needs to enter the code himself. In AOSP (here https://android.googlesource.com/platform/packages/apps/Dialer/+/91197049c458f07092b31501d2ed512180b13d58/src/com/android/dialer/SpecialCharSequenceMgr.java#131), you can see that the handle chars method is used to determine if a secret code was entered and then makes the call to the broadcast.
But in the input logic (here https://android.googlesource.com/platform/packages/apps/Dialer/+/91197049c458f07092b31501d2ed512180b13d58/src/com/android/dialer/dialpad/DialpadFragment.java?autodive=0%2F%2F), in the afterTextChanged method, this method is only called if the input is not from an intent. You can also look up the documentation of the mDigitsFilledByIntent at the top of the file.

So the user would have to first delete everything from the intent and then dial it in themselves, which works. In general, I found that accessing secret codes as a third party app is not possible anymore as the broadcast also requires special permissions now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants