Clover Coverage Report - Subsonic-Android Coverage Report
Coverage timestamp: ven dic 19 2014 17:57:13 EST
../../../../../img/srcFileCovDistChart7.png 55% of files have more coverage
9   67   8   1,29
0   38   0,89   7
7     1,14  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  SilentBackgroundTask       Line # 26 9 8 68,8% 0.6875
 
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.util;
20   
21    import android.app.Activity;
22   
23    /**
24    * @author Sindre Mehus
25    */
 
26    public abstract class SilentBackgroundTask<T> extends BackgroundTask<T> {
27   
 
28  1 toggle public SilentBackgroundTask(Activity activity) {
29  1 super(activity);
30    }
31   
 
32  1 toggle @Override
33    public void execute() {
34  1 Thread thread = new Thread() {
 
35  1 toggle @Override
36    public void run() {
37  1 try {
38  1 final T result = doInBackground();
39   
40  1 getHandler().post(new Runnable() {
 
41  1 toggle @Override
42    public void run() {
43  1 done(result);
44    }
45    });
46   
47    } catch (final Throwable t) {
48  0 getHandler().post(new Runnable() {
 
49  0 toggle @Override
50    public void run() {
51  0 error(t);
52    }
53    });
54    }
55    }
56    };
57  1 thread.start();
58    }
59   
 
60  0 toggle @Override
61    public void updateProgress(int messageId) {
62    }
63   
 
64  0 toggle @Override
65    public void updateProgress(String message) {
66    }
67    }