Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added receiver for JRT Studio build of Android Music Player, fixing i…

…ssue #46
  • Loading branch information...
commit abbbe9a91f7a08bd545b3bf6b04dc752fbd1d86d 1 parent f761558
@grodin grodin authored
View
4 .classpath
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
View
11 AndroidManifest.xml
@@ -74,6 +74,17 @@
</intent-filter>
</receiver>
+ <receiver
+ android:name="com.adam.aslfms.receiver.AndroidMusicJRTStudioBuildReceiver"
+ android:exported="true"
+ android:enabled="true">
+ <intent-filter>
+ <action android:name="com.jrtstudio.music.metachanged" />
+ <action android:name="com.jrtstudio.music.playstatechanged" />
+ <action android:name="com.jrtstudio.music.playbackcomplete" />
+ </intent-filter>
+ </receiver>
+
<receiver
android:name="com.adam.aslfms.receiver.HeroMusicReceiver"
android:exported="true"
View
2  project.properties
@@ -13,5 +13,5 @@
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
-target=android-12
+target=android-15
apk-configurations=
View
56 src/com/adam/aslfms/receiver/AndroidMusicJRTStudioBuildReceiver.java
@@ -0,0 +1,56 @@
+/**
+ * This file is part of Simple Last.fm Scrobbler.
+ *
+ * http://code.google.com/p/a-simple-lastfm-scrobbler/
+ *
+ * Copyright 2011 Simple Last.fm Scrobbler Team
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.adam.aslfms.receiver;
+
+import android.content.Context;
+
+import com.adam.aslfms.util.Util;
+
+/**
+ * A BroadcastReceiver for intents sent by the Android Music Player.
+ *
+ * @see AbstractPlayStatusReceiver
+ *
+ * @author grodin
+ * @since 1.4.3
+ */
+public class AndroidMusicJRTStudioBuildReceiver extends BuiltInMusicAppReceiver {
+
+ public static final String ACTION_ANDROID_PLAYSTATECHANGED = "com.jrtstudio.music.playstatechanged";
+ public static final String ACTION_ANDROID_STOP = "com.jrtstudio.music.playbackcomplete";
+ public static final String ACTION_ANDROID_METACHANGED = "com.jrtstudio.music.metachanged";
+
+ public static final String PACKAGE_NAME = "com.jrtstudio.music";
+ public static final String NAME = "Android Music Player (JRT Studio Build)";
+
+ static final String GOOGLE_MUSIC_PACKAGE = "com.jrtstudio.music";
+
+ public AndroidMusicJRTStudioBuildReceiver() {
+ super(ACTION_ANDROID_STOP, PACKAGE_NAME, NAME);
+ }
+
+ boolean shouldFetchFromMediaStore(Context ctx, long audioid) {
+ if (Util.checkForInstalledApp(ctx, PACKAGE_NAME))
+ return false;
+ return super.shouldFetchFromMediaStore(ctx, audioid);
+ }
+
+}
View
4 test/.classpath
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry combineaccessrules="false" kind="src" path="/sls"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
View
2  test/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-8
+target=android-10
Please sign in to comment.
Something went wrong with that request. Please try again.