Make the internal storage monitor work correctly when internal storage is very large.

This commit is contained in:
Marco Nelissen
2009-05-08 14:28:40 -07:00
parent c825d3ebd6
commit 0bfbae2c32

View File

@@ -74,7 +74,7 @@ class DeviceStorageMonitorService extends Binder {
private boolean mLowMemFlag=false;
private Context mContext;
private ContentResolver mContentResolver;
int mBlkSize;
long mBlkSize;
long mTotalMemory;
StatFs mFileStats;
private static final String DATA_PATH="/data";
@@ -251,7 +251,7 @@ class DeviceStorageMonitorService extends Binder {
//initialize block size
mBlkSize = mFileStats.getBlockSize();
//initialize total storage on device
mTotalMemory = (mFileStats.getBlockCount()*mBlkSize)/100;
mTotalMemory = ((long)mFileStats.getBlockCount()*mBlkSize)/100L;
mStorageLowIntent = new Intent(Intent.ACTION_DEVICE_STORAGE_LOW);
mStorageOkIntent = new Intent(Intent.ACTION_DEVICE_STORAGE_OK);
checkMemory(true);