Clover Coverage Report - Subsonic-Android Coverage Report
Coverage timestamp: ven dic 19 2014 17:57:13 EST
../../../../../img/srcFileCovDistChart0.png 86% of files have more coverage
11   59   2   11
2   26   0,18   1
1     2  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  VoiceQueryReceiverActivity       Line # 38 11 2 0% 0.0
 
No Tests
 
1    /*
2    This file is part of Subsonic.
3   
4    Subsonic is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8   
9    Subsonic is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12    GNU General Public License for more details.
13   
14    You should have received a copy of the GNU General Public License
15    along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
16   
17    Copyright 2009 (C) Sindre Mehus
18    */
19   
20    package net.sourceforge.subsonic.androidapp.activity;
21   
22    import android.app.Activity;
23    import android.app.SearchManager;
24    import android.content.Intent;
25    import android.os.Bundle;
26    import android.provider.SearchRecentSuggestions;
27    import net.sourceforge.subsonic.androidapp.util.Constants;
28    import net.sourceforge.subsonic.androidapp.util.Util;
29    import net.sourceforge.subsonic.androidapp.provider.SearchSuggestionProvider;
30   
31    /**
32    * Receives voice search queries and forwards to the SearchActivity.
33    *
34    * http://android-developers.blogspot.com/2010/09/supporting-new-music-voice-action.html
35    *
36    * @author Sindre Mehus
37    */
 
38    public class VoiceQueryReceiverActivity extends Activity {
39   
 
40  0 toggle @Override
41    public void onCreate(Bundle savedInstanceState) {
42  0 super.onCreate(savedInstanceState);
43   
44  0 String query = getIntent().getStringExtra(SearchManager.QUERY);
45   
46  0 if (query != null) {
47  0 SearchRecentSuggestions suggestions = new SearchRecentSuggestions(this, SearchSuggestionProvider.AUTHORITY,
48    SearchSuggestionProvider.MODE);
49  0 suggestions.saveRecentQuery(query, null);
50   
51  0 Intent intent = new Intent(VoiceQueryReceiverActivity.this, SearchActivity.class);
52  0 intent.putExtra(Constants.INTENT_EXTRA_NAME_QUERY, query);
53  0 intent.putExtra(Constants.INTENT_EXTRA_NAME_AUTOPLAY, true);
54  0 Util.startActivityWithoutTransition(VoiceQueryReceiverActivity.this, intent);
55    }
56  0 finish();
57  0 Util.disablePendingTransition(this);
58    }
59    }