Skip to content

Find My Phone Plugin : Adding Support for API greater than 26 since AudioManager's setAudioStreamType from Android 0. Fix the bug of the Plugin not working from Lock Screen on Android 10 with a little hack.

Adding Support for API greater than 26 since AudioManager's setAudioStreamType from Android 0. Switched over to setAttributes() for higher APIs . I tested the new Implementation on a lower API phone and a Higher API and in my testing it is working. The bug is kind of fixed with a bit of a hack after checking if the screen is interactive, we check if we are on lock screen and if on lock screen we start the activity and play sound which works on my testing. On further reading my assumption is that the issue was due to the fact that in Android 10 apps that are in idle, suspended or in dream mode cannot play sound. The error that the current implementation gives for higher APIs is given below: error

By using the new function for higher APIs and checking if the screen if the user is on lock screen for Android 10, the error is removed and the plugin works to ring all the time on higher APIs on my testing. ![Itwascreated] (/uploads/511eb5f1bcf4a93250891f22e9f4a0fb/Itwascreated.png)setswithouterror

I tested on a phone running Android 9 and a phone running Android 10 and the plugin is working on my testing.

Tests that I conducted: Test 1: From KDE Connect App - Rings Test 2: From Home Screen - Rings Test 3: While inside Youtube App Playing Youtube Video - Rings Test 4: While inside Youtube Music and Amazon Prime Music - Rings Test 5: While on Lock Screen with nothing Playing- Rings Test 6: While on Lock Screen with Music Playing - Rings Test 7: While on Lock Screen but dimmed - Rings Test 8 : While on Lock Screen dimmed with music - Rings Test 9: Screen Off - Rings

Edited by Simon Redman

Merge request reports