Summary: | Ring my phone not working | ||
---|---|---|---|
Product: | [Applications] kdeconnect | Reporter: | henrycovili2004 |
Component: | android-application | Assignee: | Albert Vaca Cintora <albertvaka> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | dmitrmax, joost, voidpointertonull+bugskdeorg |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
henrycovili2004
2022-07-09 14:07:45 UTC
I am using Android 10 (crDroid 6.12) on rooted phone. 01-03 18:14:54.705 E/FindMyPhoneActivity(15086): java.lang.SecurityException: getDefaultOutgoingPhoneAccount: Neither user 10303 nor current process has android.permission.READ_PRIVILEGED_PHONE_STATE. According to the Android developer reference, the method getDefaultOutgoingPhoneAccount does not need this permission. If any phone does require it, then this is likely some bug or enhanced security feature in the (custom) ROM or some magisk/xposed module that is installed. https://developer.android.com/reference/android/telecom/TelecomManager#getDefaultOutgoingPhoneAccount(java.lang.String) This means it is not a bug in kdeconnect. It is possible though to create a workaround by requesting the required permission if needed, but that would violate playstore rules and then the app cant be published there. https://developer.android.com/about/versions/10/privacy/changes#non-resettable-device-ids This is super weird because KDE Connect doesn't use `getDefaultOutgoingPhoneAccount`. Even less in the FindMyPhone plugin. Is this still happening to you? Maybe not so weird. Looking at logcat above and the source code here: https://github.com/KDE/kdeconnect-android/blob/master/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java what I think is happening: The onCreate function (line 68) obtains a content-uri to the default ringtone. Then the uri is opened by the mediaplayer, but it does not simply point to a file, but to a resource within ringtonemanager.java that is trying to obtain the ringtone data and it does not have the permission to do that. Perhaps there is a more compatible way to play the default ringtone. For example the second answer here: https://stackoverflow.com/questions/22503189/how-to-get-current-ringtone-in-android quote: >Uri defaultRintoneUri = RingtoneManager.getActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_RINGTONE); >Ringtone defaultRingtone = RingtoneManager.getRingtone(getApplicationContext(), defaultRintoneUri); >defaultRingtone.play(); Maybe when I have time I'll play around with that and see if it works on my phone. Seems that it is a bug in AOSP. Stock firmwares have TelecomService replaced by vendors without this bug. But AOSP-based firmwares (LineageOS, crDroid etc.) suffer from that. I created an issue in AOSP bug tracker. Feel free to look at it and vote for it if you suffer from this: https://issuetracker.google.com/issues/312227037 |