mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-01 12:54:07 +00:00
Remove open file percentage
It was showing the global number / maximum of open files, not for the process Refs #311
This commit is contained in:
parent
09da6010da
commit
2181221a79
2 changed files with 0 additions and 29 deletions
|
@ -637,25 +637,6 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
|
|||
if (filter && loglevel <= Log.WARN) {
|
||||
int[] count = jni_get_session_count();
|
||||
remoteViews.setTextViewText(R.id.tvSessions, count[0] + "/" + count[1] + "/" + count[2]);
|
||||
|
||||
File proc = new File("/proc/sys/fs/file-nr");
|
||||
BufferedReader br = null;
|
||||
try {
|
||||
br = new BufferedReader(new FileReader(proc));
|
||||
String line = br.readLine();
|
||||
String[] filenr = line.split("\\s+");
|
||||
if (filenr.length == 3) {
|
||||
int perc = Integer.parseInt(filenr[0]) * 100 / Integer.parseInt(filenr[2]);
|
||||
remoteViews.setTextViewText(R.id.tvFiles, perc + "%");
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} finally {
|
||||
if (br != null)
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Show notification
|
||||
|
|
|
@ -68,16 +68,6 @@
|
|||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFiles"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivTraffic"
|
||||
android:layout_width="match_parent"
|
||||
|
|
Loading…
Reference in a new issue