Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #22 from zlern2k/master
Browse files Browse the repository at this point in the history
Close the cpu buffer to (fix a strict mode violation)
  • Loading branch information
zlern2k authored Oct 20, 2016
2 parents 7802a3e + bd2fa85 commit 84a7f99
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.StrictMode;
import android.widget.TextView;
import com.facebook.device.yearclass.YearClass;

Expand All @@ -24,6 +25,18 @@ public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
if (BuildConfig.DEBUG) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog()
.penaltyDeath()
.build());
}

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ private static int getCoresFromFileInfo(String fileLocation) {
InputStream is = new FileInputStream(fileLocation);
BufferedReader buf = new BufferedReader(new InputStreamReader(is));
String fileContents = buf.readLine();
buf.close();
return getCoresFromFileString(fileContents);
} catch (IOException e) {
return DEVICEINFO_UNKNOWN;
Expand Down

0 comments on commit 84a7f99

Please sign in to comment.