diff options
author | Roman Birg <roman@cyngn.com> | 2016-08-29 07:21:09 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-08-29 15:58:02 -0700 |
commit | 71e5da3c38e5a7e79d5c1f94a13f239cc7ca7458 (patch) | |
tree | a9a6c864f0839cfc33ce1835cf934cad69d6dc59 /src_effects/org/cyanogenmod/audiofx/backends/EffectsFactory.java | |
parent | 70457e95bb802ed9e94ca71730d1eb56543defc9 (diff) | |
download | android_packages_apps_AudioFX-71e5da3c38e5a7e79d5c1f94a13f239cc7ca7458.tar.gz android_packages_apps_AudioFX-71e5da3c38e5a7e79d5c1f94a13f239cc7ca7458.tar.bz2 android_packages_apps_AudioFX-71e5da3c38e5a7e79d5c1f94a13f239cc7ca7458.zip |
AudioFX: finish rename; persist process
- Set persistent flag for app in the manifest, this backing process shouldn't be
dying when the user swipes away the UI
- Fix package structure to be org.cyanogenmod.audiofx
- Add missing java license headers
Change-Id: I03d37b6ca0548d881aaf46754c776da923e1ef59
Diffstat (limited to 'src_effects/org/cyanogenmod/audiofx/backends/EffectsFactory.java')
-rw-r--r-- | src_effects/org/cyanogenmod/audiofx/backends/EffectsFactory.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src_effects/org/cyanogenmod/audiofx/backends/EffectsFactory.java b/src_effects/org/cyanogenmod/audiofx/backends/EffectsFactory.java new file mode 100644 index 0000000..20d6a40 --- /dev/null +++ b/src_effects/org/cyanogenmod/audiofx/backends/EffectsFactory.java @@ -0,0 +1,35 @@ +package org.cyanogenmod.audiofx.backends; + +import org.cyanogenmod.audiofx.Constants; + +import android.content.Context; +import android.media.AudioDeviceInfo; + +/** + * Creates an EffectSet appropriate for the current device + */ +public class EffectsFactory implements IEffectFactory { + + private static final String TAG = "AudioFx-EffectsFactory"; + + private static int sBrand = -1; // cached value to not hit io every time we need a new effect + + public EffectSet createEffectSet(Context context, int sessionId, + AudioDeviceInfo currentDevice) { + // if this throws, we're screwed, don't bother to recover. these + // are the standard effects that every android device must have, + // and if they don't exist we have bigger problems. + return new AndroidEffects(sessionId, currentDevice); + } + + public static int getBrand() { + if (sBrand == -1) { + sBrand = getBrandInternal(); + } + return sBrand; + } + + private static int getBrandInternal() { + return Constants.EFFECT_TYPE_ANDROID; + } +} |