public void set_values() { cur.setText(getString(R.string.prefcat_zram) + " " + String.valueOf(curcpu)); t1.setText(Helpers.ReadableByteCount(0)); t2.setText("0"); t3.setText(Helpers.ReadableByteCount(0)); t4.setText("0"); t5.setText(Helpers.ReadableByteCount(0)); Boolean ist1 = false; Boolean ist3 = false; Boolean ist5 = false; if (new File(ZRAM_COMPR_PATH.replace("zram0", "zram" + curcpu)).exists()) { t1.setText( Helpers.ReadableByteCount( parseInt(Helpers.readOneLine(ZRAM_COMPR_PATH.replace("zram0", "zram" + curcpu))))); ist1 = true; } if (new File(ZRAM_ORIG_PATH.replace("zram0", "zram" + curcpu)).exists()) { t3.setText( Helpers.ReadableByteCount( parseInt(Helpers.readOneLine(ZRAM_ORIG_PATH.replace("zram0", "zram" + curcpu))))); ist3 = true; } if (new File(ZRAM_MEMTOT_PATH.replace("zram0", "zram" + curcpu)).exists()) { t5.setText( Helpers.ReadableByteCount( parseInt(Helpers.readOneLine(ZRAM_MEMTOT_PATH.replace("zram0", "zram" + curcpu))))); ist5 = true; } if (ist1 && ist3 && ist5) { t2.setText(nf.format(getCompressionRatio())); t4.setText(nf.format(getUsedRatio())); } }
private int getCompressedDataSize() { return parseInt(Helpers.readOneLine(ZRAM_COMPR_PATH.replace("zram0", "zram" + curcpu))); }