summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@cyanogenmod.org>2016-10-04 15:34:50 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-10-04 15:34:50 (GMT)
commit1eee07b297406ddd4747c271cde1d455da320eba (patch)
tree32f708ff313f0754ad4b20d2b8e56a3c021968e3
parente832873e41071c436d4b3915bdb493ef32a77811 (diff)
parentdf56b062c3c799fd070106f600c0203915eedff4 (diff)
downloadandroid_packages_apps_Eleven-1eee07b297406ddd4747c271cde1d455da320eba.zip
android_packages_apps_Eleven-1eee07b297406ddd4747c271cde1d455da320eba.tar.gz
android_packages_apps_Eleven-1eee07b297406ddd4747c271cde1d455da320eba.tar.bz2
Merge "Eleven: Set preferences on play" into cm-13.0
-rw-r--r--src/com/cyanogenmod/eleven/MusicPlaybackService.java5
-rw-r--r--src/com/cyanogenmod/eleven/utils/MusicUtils.java18
2 files changed, 7 insertions, 16 deletions
diff --git a/src/com/cyanogenmod/eleven/MusicPlaybackService.java b/src/com/cyanogenmod/eleven/MusicPlaybackService.java
index ed31b13..983622f 100644
--- a/src/com/cyanogenmod/eleven/MusicPlaybackService.java
+++ b/src/com/cyanogenmod/eleven/MusicPlaybackService.java
@@ -70,6 +70,7 @@ import com.cyanogenmod.eleven.provider.SongPlayCount;
import com.cyanogenmod.eleven.service.MusicPlaybackTrack;
import com.cyanogenmod.eleven.utils.BitmapWithColors;
import com.cyanogenmod.eleven.utils.Lists;
+import com.cyanogenmod.eleven.utils.PreferenceUtils;
import com.cyanogenmod.eleven.utils.ShakeDetector;
import com.cyanogenmod.eleven.utils.SrtManager;
@@ -653,6 +654,10 @@ public class MusicPlaybackService extends Service {
mPreferences = getSharedPreferences("Service", 0);
mCardId = getCardId();
+ mShowAlbumArtOnLockscreen = mPreferences.getBoolean(
+ PreferenceUtils.SHOW_ALBUM_ART_ON_LOCKSCREEN, true);
+ setShakeToPlayEnabled(mPreferences.getBoolean(PreferenceUtils.SHAKE_TO_PLAY, true));
+
registerExternalStorageListener();
// Initialize the media player
diff --git a/src/com/cyanogenmod/eleven/utils/MusicUtils.java b/src/com/cyanogenmod/eleven/utils/MusicUtils.java
index 72aa29e..8ab4c73 100644
--- a/src/com/cyanogenmod/eleven/utils/MusicUtils.java
+++ b/src/com/cyanogenmod/eleven/utils/MusicUtils.java
@@ -113,8 +113,7 @@ public final class MusicUtils {
}
final ContextWrapper contextWrapper = new ContextWrapper(realActivity);
contextWrapper.startService(new Intent(contextWrapper, MusicPlaybackService.class));
- final ServiceBinder binder = new ServiceBinder(callback,
- contextWrapper.getApplicationContext());
+ final ServiceBinder binder = new ServiceBinder(callback);
if (contextWrapper.bindService(
new Intent().setClass(contextWrapper, MusicPlaybackService.class), binder, 0)) {
mConnectionMap.put(contextWrapper, binder);
@@ -143,16 +142,14 @@ public final class MusicUtils {
public static final class ServiceBinder implements ServiceConnection {
private final ServiceConnection mCallback;
- private final Context mContext;
/**
* Constructor of <code>ServiceBinder</code>
*
* @param context The {@link ServiceConnection} to use
*/
- public ServiceBinder(final ServiceConnection callback, final Context context) {
+ public ServiceBinder(final ServiceConnection callback) {
mCallback = callback;
- mContext = context;
}
@Override
@@ -161,7 +158,6 @@ public final class MusicUtils {
if (mCallback != null) {
mCallback.onServiceConnected(className, service);
}
- MusicUtils.initPlaybackServiceWithSettings(mContext);
}
@Override
@@ -279,16 +275,6 @@ public final class MusicUtils {
}
/**
- * Initialize playback service with values from Settings
- */
- public static void initPlaybackServiceWithSettings(final Context context) {
- MusicUtils.setShakeToPlayEnabled(
- PreferenceUtils.getInstance(context).getShakeToPlay());
- MusicUtils.setShowAlbumArtOnLockscreen(
- PreferenceUtils.getInstance(context).getShowAlbumArtOnLockscreen());
- }
-
- /**
* Set shake to play status
*/
public static void setShakeToPlayEnabled(final boolean enabled) {