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

Fix security error when trying to get phone account #773

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

manuquentin
Copy link
Contributor

No description provided.

@wilmxre
Copy link

wilmxre commented Apr 25, 2024

hello @manuquentin. i am glad you've got back to this repo and are working on phone account related issues. can you please tell me, why do we bypass checking if the device supports phone accounts, if the app is self managed?:

 private boolean hasPhoneAccount() {
        if (telecomManager == null) {
            this.initializeTelecomManager();
        }

        if (isSelfManaged()) {
            return true;
        }

        return isConnectionServiceAvailable() && telecomManager != null &&
            hasPermissions() && telecomManager.getPhoneAccount(handle) != null &&
            telecomManager.getPhoneAccount(handle).isEnabled();
    }

same goes to this method, we just simply accept that devices after api 23 must support the telecom feature:

public static Boolean isConnectionServiceAvailable() {
        // PhoneAccount is available since api level 23
        return Build.VERSION.SDK_INT >= 23;
    }

from my experience, there are some tablets (i noticed it especially on several Lenovo devices) that do not support the telecom feature and by this they won't support registering the phone account or using the connection service at all.

these devices usually have the config_voice_capable set to false.
you can see it in frameworks/base/core/res/res/values/config.xml
Ex: <bool name="config_voice_capable">false</bool>

from my understanding, it isn't a great idea to early return in the aforementioned methods, that are used basically in every function in this library.

am i missing something?

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.

2 participants