Skip to content

Prevent default phone account check when no SIM present #63

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

Merged
merged 1 commit into from
Sep 6, 2019
Merged

Prevent default phone account check when no SIM present #63

merged 1 commit into from
Sep 6, 2019

Conversation

geraintwhite
Copy link
Contributor

No description provided.

@danjenkins
Copy link
Collaborator

@grit96 can you explain this a little more? What happens right now if you run it on a device without a sim?

@geraintwhite
Copy link
Contributor Author

At the moment if you run it on a device without a SIM, the setting to set the default calling account is missing and the checkDefaultPhoneAccout would always return false.

@danjenkins
Copy link
Collaborator

thanks @grit96

@manuquentin
Copy link
Contributor

manuquentin commented Aug 20, 2019

Hi !
I came to the same issue, the native phone app crashed when no SIM is present on a Pixel 1 with Android 9 :

08-20 19:07:55.429  2960  2960 E Dialer  : SilentCrashReporter.uncaughtException - sendSilentFeedback
08-20 19:07:55.429  2960  2960 E Dialer  : java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.telephony.ServiceState.getState()' on a null object reference
08-20 19:07:55.429  2960  2960 E Dialer  : 	at czh.accept(Unknown Source:2)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at czy.a(Unknown Source:2)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at bxw.a(PG:3)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at kyd.run(PG:3)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at android.os.Handler.handleCallback(Handler.java:873)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at android.os.Looper.loop(Looper.java:193)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at android.app.ActivityThread.main(ActivityThread.java:6718)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at java.lang.reflect.Method.invoke(Native Method)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
08-20 19:07:55.429  2960  2960 E Dialer  : Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.telephony.ServiceState.getState()' on a null object reference
08-20 19:07:55.429  2960  2960 E Dialer  : 	at dau.a(PG:10)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at dau.a(PG:23)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at dau.a(PG:64)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at dat.call(Unknown Source:3)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at kzn.a(PG:1)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at kyl.run(PG:3)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at kzl.run(PG:2)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
08-20 19:07:55.429  2960  2960 E Dialer  : 	at java.lang.Thread.run(Thread.java:764)

Everything work with a SIM in the device.

With this PR the Phone app doesn't crash, but the phone account does not appear to be available :
Screenshot_20190820-133331

@kylekurz
Copy link
Contributor

I've seen this same issue too, FYI. Haven't had time to dig into why it's a problem yet.

@manuquentin
Copy link
Contributor

manuquentin commented Sep 6, 2019

Merging as it fixes a crash, I'll open an issue with the disabled button

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

Successfully merging this pull request may close these issues.

4 participants