如修改读到的总容量为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;
}
public long getBlockCountLong() {
- return mStat.f_blocks;
+ //eMMC capacity is 128GB,modify this ,then app display storage as 128GB
+ return 33554432L;
}
public long getTotalBytes() {
- return mStat.f_blocks * mStat.f_bsize;
+ //eMMC capacity is 128GB,modify this ,then app display storage as 128GB
+ return 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;
}



