diff options
author | David Li <dvdli@google.com> | 2022-05-03 14:08:45 +0800 |
---|---|---|
committer | David Li <dvdli@google.com> | 2022-05-04 01:25:44 +0000 |
commit | 86259aa95bfe18b6cdaf0816da06fb7650a4dfbf (patch) | |
tree | 0218e10e8b7586b611f338fa54ae6262925d4e0f | |
parent | 5c5ff343a64ff5286acfbe8ac65884aab11c666f (diff) | |
download | MusicFX-86259aa95bfe18b6cdaf0816da06fb7650a4dfbf.tar.gz |
Save the package name and audio session in onCreateandroid13-dev
Since the MusicFx might be killed after it received
ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION intents, when MusicFx is
launched by a player, save the package name and the audio session
attached on the intent.
Bug: 213293265
Test: MusicFX on YTMusic
Change-Id: I9ceaef4877da52eb33d22e799d966336b67b947e
-rw-r--r-- | src/com/android/musicfx/ActivityMusic.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/musicfx/ActivityMusic.java b/src/com/android/musicfx/ActivityMusic.java index 3e787c0..a2c356d 100644 --- a/src/com/android/musicfx/ActivityMusic.java +++ b/src/com/android/musicfx/ActivityMusic.java @@ -287,6 +287,10 @@ public class ActivityMusic extends Activity implements OnSeekBarChangeListener { ControlPanelEffect.initEffectsPreferences(mContext, mCallingPackageName, audioSession); + // Make sure the package name and the audio session are saved, since MusicFX might be killed + // after receiving the AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION intent. + ControlPanelEffect.openSession(mContext, mCallingPackageName, audioSession); + // query available effects final Descriptor[] effects = AudioEffect.queryEffects(); |