summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2016-10-05 13:49:03 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-10-05 13:49:04 -0700
commit73e1903cc69c0302f7db0990466db974a2cc8bbc (patch)
treea7002d3b8be7c9c46b8430c248b62c268f7034fd
parente3661b81ad577101f72662c0f959e894d9ec28a7 (diff)
parent88b8993b8a610ce91e46d586d4e5eccfd8df508f (diff)
downloadandroid_packages_apps_AudioFX-73e1903cc69c0302f7db0990466db974a2cc8bbc.tar.gz
android_packages_apps_AudioFX-73e1903cc69c0302f7db0990466db974a2cc8bbc.tar.bz2
android_packages_apps_AudioFX-73e1903cc69c0302f7db0990466db974a2cc8bbc.zip
Merge "AudioFX: fix missing bassboost/virtualizer" into cm-13.0
-rw-r--r--src/org/cyanogenmod/audiofx/Constants.java3
-rw-r--r--src/org/cyanogenmod/audiofx/activity/ActivityMusic.java3
-rw-r--r--src/org/cyanogenmod/audiofx/backends/AndroidEffects.java4
-rw-r--r--src/org/cyanogenmod/audiofx/service/DevicePreferenceManager.java12
4 files changed, 12 insertions, 10 deletions
diff --git a/src/org/cyanogenmod/audiofx/Constants.java b/src/org/cyanogenmod/audiofx/Constants.java
index 4c1fafb..04ca721 100644
--- a/src/org/cyanogenmod/audiofx/Constants.java
+++ b/src/org/cyanogenmod/audiofx/Constants.java
@@ -24,9 +24,6 @@ import java.util.List;
public class Constants {
- // current pref version, bump to rebuild prefs
- public static final int CURRENT_PREFS_INT_VERSION = 2;
-
// effect type identifiers
public static final int EFFECT_TYPE_ANDROID = 1;
public static final int EFFECT_TYPE_MAXXAUDIO = 2;
diff --git a/src/org/cyanogenmod/audiofx/activity/ActivityMusic.java b/src/org/cyanogenmod/audiofx/activity/ActivityMusic.java
index d879b69..411ba45 100644
--- a/src/org/cyanogenmod/audiofx/activity/ActivityMusic.java
+++ b/src/org/cyanogenmod/audiofx/activity/ActivityMusic.java
@@ -35,6 +35,7 @@ import org.cyanogenmod.audiofx.R;
import org.cyanogenmod.audiofx.fragment.AudioFxFragment;
import org.cyanogenmod.audiofx.knobs.KnobCommander;
import org.cyanogenmod.audiofx.service.AudioFxService;
+import org.cyanogenmod.audiofx.service.DevicePreferenceManager;
import org.cyanogenmod.audiofx.stats.AppState;
import org.cyanogenmod.audiofx.stats.UserSession;
@@ -107,7 +108,7 @@ public class ActivityMusic extends Activity {
}
private boolean defaultsSetup() {
- final int targetVersion = Constants.CURRENT_PREFS_INT_VERSION;
+ final int targetVersion = DevicePreferenceManager.CURRENT_PREFS_INT_VERSION;
final SharedPreferences prefs = Constants.getGlobalPrefs(this);
final int currentVersion = prefs.getInt(Constants.AUDIOFX_GLOBAL_PREFS_VERSION_INT, 0);
final boolean defaultsSaved = prefs.getBoolean(Constants.SAVED_DEFAULTS, false);
diff --git a/src/org/cyanogenmod/audiofx/backends/AndroidEffects.java b/src/org/cyanogenmod/audiofx/backends/AndroidEffects.java
index fafcd34..6419d2b 100644
--- a/src/org/cyanogenmod/audiofx/backends/AndroidEffects.java
+++ b/src/org/cyanogenmod/audiofx/backends/AndroidEffects.java
@@ -125,12 +125,12 @@ class AndroidEffects extends EffectSetWithAndroidEq {
@Override
public boolean hasVirtualizer() {
- return mVirtualizer != null && mVirtualizer.getStrengthSupported();
+ return mVirtualizer != null;
}
@Override
public boolean hasBassBoost() {
- return mBassBoost != null && mBassBoost.getStrengthSupported();
+ return mBassBoost != null;
}
@Override
diff --git a/src/org/cyanogenmod/audiofx/service/DevicePreferenceManager.java b/src/org/cyanogenmod/audiofx/service/DevicePreferenceManager.java
index f377f3c..2d99b21 100644
--- a/src/org/cyanogenmod/audiofx/service/DevicePreferenceManager.java
+++ b/src/org/cyanogenmod/audiofx/service/DevicePreferenceManager.java
@@ -57,7 +57,11 @@ import java.util.Arrays;
import java.util.List;
import java.util.Locale;
-class DevicePreferenceManager implements AudioOutputChangeListener.AudioOutputChangedCallback {
+public class DevicePreferenceManager
+ implements AudioOutputChangeListener.AudioOutputChangedCallback {
+
+ // current pref version, bump to rebuild prefs
+ public static final int CURRENT_PREFS_INT_VERSION = 3;
private static final String TAG = AudioFxService.TAG;
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
@@ -119,12 +123,12 @@ class DevicePreferenceManager implements AudioOutputChangeListener.AudioOutputCh
SharedPreferences prefs = Constants.getGlobalPrefs(mContext);
final int currentPrefVer = prefs.getInt(Constants.AUDIOFX_GLOBAL_PREFS_VERSION_INT, 0);
- boolean needsPrefsUpdate = currentPrefVer < Constants.CURRENT_PREFS_INT_VERSION
+ boolean needsPrefsUpdate = currentPrefVer < CURRENT_PREFS_INT_VERSION
|| overridePrevious;
if (needsPrefsUpdate) {
Log.d(TAG, "rebuilding presets due to preference upgrade from " + currentPrefVer
- + " to " + Constants.CURRENT_PREFS_INT_VERSION);
+ + " to " + CURRENT_PREFS_INT_VERSION);
}
if (prefs.getBoolean(SAVED_DEFAULTS, false) && !needsPrefsUpdate) {
@@ -193,7 +197,7 @@ class DevicePreferenceManager implements AudioOutputChangeListener.AudioOutputCh
prefs
.edit()
.putInt(Constants.AUDIOFX_GLOBAL_PREFS_VERSION_INT,
- Constants.CURRENT_PREFS_INT_VERSION)
+ CURRENT_PREFS_INT_VERSION)
.putBoolean(Constants.SAVED_DEFAULTS, true)
.commit();
}