Merge change 1275 into donut

* changes:
  Make the internal storage monitor work correctly when internal storage is very large.
This commit is contained in:
Android (Google) Code Review
2009-05-08 14:46:21 -07:00

View File

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