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
7   50   2   7
0   22   0,29   1
1     2  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  MediaButtonIntentReceiver       Line # 31 7 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 2010 (C) Sindre Mehus
18    */
19    package net.sourceforge.subsonic.androidapp.receiver;
20   
21    import android.content.BroadcastReceiver;
22    import android.content.Context;
23    import android.content.Intent;
24    import android.util.Log;
25    import android.view.KeyEvent;
26    import net.sourceforge.subsonic.androidapp.service.DownloadServiceImpl;
27   
28    /**
29    * @author Sindre Mehus
30    */
 
31    public class MediaButtonIntentReceiver extends BroadcastReceiver {
32   
33    private static final String TAG = MediaButtonIntentReceiver.class.getSimpleName();
34   
 
35  0 toggle @Override
36    public void onReceive(Context context, Intent intent) {
37  0 KeyEvent event = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT);
38  0 Log.i(TAG, "Got MEDIA_BUTTON key event: " + event);
39   
40  0 Intent serviceIntent = new Intent(context, DownloadServiceImpl.class);
41  0 serviceIntent.putExtra(Intent.EXTRA_KEY_EVENT, event);
42  0 context.startService(serviceIntent);
43   
44  0 try {
45  0 abortBroadcast();
46    } catch (Exception x) {
47    // Ignored.
48    }
49    }
50    }