aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-04-11 16:15:07 -0700
committerScott Jackson <daneren2005@gmail.com>2015-04-11 16:15:07 -0700
commitff868797b593af560ed54b404b83a424ebe4227c (patch)
tree5dc0669d0530670ef98a0d9f820d33de328426bf
parentba43a5ea2da9752e7bf0deb231c9132e00106c3c (diff)
downloaddsub-ff868797b593af560ed54b404b83a424ebe4227c.tar.gz
dsub-ff868797b593af560ed54b404b83a424ebe4227c.tar.bz2
dsub-ff868797b593af560ed54b404b83a424ebe4227c.zip
Fixed #420: Add GSM voice search (search for x on DSub)
-rw-r--r--AndroidManifest.xml6
-rw-r--r--src/github/daneren2005/dsub/activity/VoiceQueryReceiverActivity.java5
2 files changed, 10 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index bf2262cb..69ba90e3 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -66,6 +66,12 @@
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
+
+ <intent-filter>
+ <action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ </intent-filter>
</activity>
<activity android:name="github.daneren2005.dsub.activity.QueryReceiverActivity"
diff --git a/src/github/daneren2005/dsub/activity/VoiceQueryReceiverActivity.java b/src/github/daneren2005/dsub/activity/VoiceQueryReceiverActivity.java
index f3a56920..7ae0ba77 100644
--- a/src/github/daneren2005/dsub/activity/VoiceQueryReceiverActivity.java
+++ b/src/github/daneren2005/dsub/activity/VoiceQueryReceiverActivity.java
@@ -38,6 +38,7 @@ import github.daneren2005.dsub.provider.DSubSearchProvider;
* @author Sindre Mehus
*/
public class VoiceQueryReceiverActivity extends Activity {
+ private static String GMS_SEARCH_ACTION = "com.google.android.gms.actions.SEARCH_ACTION";
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -48,7 +49,9 @@ public class VoiceQueryReceiverActivity extends Activity {
if (query != null) {
Intent intent = new Intent(VoiceQueryReceiverActivity.this, SubsonicFragmentActivity.class);
intent.putExtra(Constants.INTENT_EXTRA_NAME_QUERY, query);
- intent.putExtra(Constants.INTENT_EXTRA_NAME_AUTOPLAY, true);
+ if(!GMS_SEARCH_ACTION.equals(getIntent().getAction())) {
+ intent.putExtra(Constants.INTENT_EXTRA_NAME_AUTOPLAY, true);
+ }
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
Util.startActivityWithoutTransition(VoiceQueryReceiverActivity.this, intent);
}