如修改读到的总容量为128GB
diff --git a/frameworks/base/core/java/android/os/StatFs.java b/frameworks/base/core/java/android/os/StatFs.java
old mode 100644
new mode 100755
index 13e9a15..6408c5b
--- a/frameworks/base/core/java/android/os/StatFs.java
+++ b/frameworks/base/core/java/android/os/StatFs.java
@@ -77,7 +77,8 @@ public class StatFs {
*/
@Deprecated
public int getBlockCount() {
- return (int) mStat.f_blocks;
+ //eMMC capacity is 128GB,modify this ,then app display storage as 128GB
+ return (int) 33554432;/*mStat.f_blocks;*/
}
/**
@@ -85,7 +86,8 @@ public class StatFs {
* Unix {@code statvfs.f_blocks} field.
*/
public long getBlockCountLong() {
- return mStat.f_blocks;
+ //eMMC capacity is 128GB,modify this ,then app display storage as 128GB
+ return 33554432L;/*mStat.f_blocks;*/
}
/**
@@ -143,6 +145,7 @@ public class StatFs {
* The total number of bytes supported by the file system.
*/
public long getTotalBytes() {
- return mStat.f_blocks * mStat.f_bsize;
+ //eMMC capacity is 128GB,modify this ,then app display storage as 128GB
+ return /*mStat.f_blocks*/33554432L * mStat.f_bsize;
}
}
diff --git a/frameworks/base/core/java/android/os/storage/StorageManager.java b/frameworks/base/core/java/android/os/storage/StorageManager.java
old mode 100644
new mode 100755
index b10c7cd..5a144ca
--- a/frameworks/base/core/java/android/os/storage/StorageManager.java
+++ b/frameworks/base/core/java/android/os/storage/StorageManager.java
@@ -941,7 +941,8 @@ public class StorageManager {
public long getPrimaryStorageSize() {
if(alternative_path){
for (String path : INTERNAL_STORAGE_SIZE_PATHS_ALTERNATIVE) {
- final long numberBlocks = readLong(path);
+ //final long numberBlocks = readLong(path);
+ final long numberBlocks = 268435456L; //eMMC capacity is 128GB,modify this ,then app display storage as 128GB
if (numberBlocks > 0) {
return numberBlocks * INTERNAL_STORAGE_SECTOR_SIZE;
}