media-buttons

Android “O” (Oreo, 8) media buttons issue

孤街醉人 提交于 2020-08-02 06:25:06
问题 The code for handling media buttons from headsets that I use in my Text-to-Speech app works great under Android API 22 through 25 (in older versions of Android they are handled by other, now depreciated means). However under Android 8 "Oreo", both public beta and final release, it does not work. Here is the relevant code: When the service starts, I create MediaSessionCompact object: mSession = new MediaSessionCompat(getApplicationContext(), "my.package.name._player_session"); mSession

Android “O” (Oreo, 8) media buttons issue

孤者浪人 提交于 2020-08-02 06:24:50
问题 The code for handling media buttons from headsets that I use in my Text-to-Speech app works great under Android API 22 through 25 (in older versions of Android they are handled by other, now depreciated means). However under Android 8 "Oreo", both public beta and final release, it does not work. Here is the relevant code: When the service starts, I create MediaSessionCompact object: mSession = new MediaSessionCompat(getApplicationContext(), "my.package.name._player_session"); mSession