Merge "Unify storage calculations." into oc-dr1-dev am: 947cb367db
am: a223ee4890
Change-Id: I4a4dbe87c52a2c53abd2489143d9183c72d2c4cf
This commit is contained in:
@@ -39,6 +39,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.widget.DonutView;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
@@ -46,7 +47,7 @@ import java.util.Locale;
|
||||
* on a given storage volume. It is visualized with a donut graphing the % used.
|
||||
*/
|
||||
public class StorageSummaryDonutPreference extends Preference implements View.OnClickListener {
|
||||
private int mPercent = -1;
|
||||
private double mPercent = -1;
|
||||
|
||||
public StorageSummaryDonutPreference(Context context) {
|
||||
this(context, null);
|
||||
@@ -64,8 +65,7 @@ public class StorageSummaryDonutPreference extends Preference implements View.On
|
||||
return;
|
||||
}
|
||||
|
||||
mPercent = MathUtils.constrain((int) ((usedBytes * 100) / totalBytes),
|
||||
(usedBytes > 0) ? 1 : 0, 100);
|
||||
mPercent = usedBytes / (double) totalBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user