diff options
Diffstat (limited to 'android/avd')
-rw-r--r-- | android/avd/hardware-properties.ini | 12 | ||||
-rw-r--r-- | android/avd/hw-config-defs.h | 14 | ||||
-rw-r--r-- | android/avd/info.c | 15 | ||||
-rw-r--r-- | android/avd/info.h | 5 |
4 files changed, 46 insertions, 0 deletions
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini index c655100..09486d2 100644 --- a/android/avd/hardware-properties.ini +++ b/android/avd/hardware-properties.ini @@ -124,6 +124,18 @@ default = yes abstract = SD Card support description = Whether the device supports insertion/removal of virtual SD Cards. +# System partition +name = disk.systemPartition.size +type = diskSize +abstract = System partition size +default = 66MB + +# Data partition +name = disk.dataPartition.size +type = diskSize +abstract = Data partition size +default = 66MB + # Cache partition name = disk.cachePartition type = boolean diff --git a/android/avd/hw-config-defs.h b/android/avd/hw-config-defs.h index 7fcf732..67bd3d3 100644 --- a/android/avd/hw-config-defs.h +++ b/android/avd/hw-config-defs.h @@ -122,6 +122,20 @@ HWCFG_BOOL( "SD Card support", "Whether the device supports insertion/removal of virtual SD Cards.") +HWCFG_DISKSIZE( + disk_systemPartition_size, + "disk.systemPartition.size", + "66MB", + "System partition size", + "") + +HWCFG_DISKSIZE( + disk_dataPartition_size, + "disk.dataPartition.size", + "66MB", + "Data partition size", + "") + HWCFG_BOOL( disk_cachePartition, "disk.cachePartition", diff --git a/android/avd/info.c b/android/avd/info.c index 1bdb59c..10e2005 100644 --- a/android/avd/info.c +++ b/android/avd/info.c @@ -1358,6 +1358,21 @@ avdInfo_getImageFile( AvdInfo* i, AvdImageType imageType ) return i->imagePath[imageType]; } +uint64_t +avdInfo_getImageFileSize( AvdInfo* i, AvdImageType imageType ) +{ + const char* file = avdInfo_getImageFile(i, imageType); + uint64_t size; + + if (file == NULL) + return 0ULL; + + if (path_get_size(file, &size) < 0) + return 0ULL; + + return size; +} + int avdInfo_isImageReadOnly( AvdInfo* i, AvdImageType imageType ) { diff --git a/android/avd/info.h b/android/avd/info.h index 6cd97dc..19df807 100644 --- a/android/avd/info.h +++ b/android/avd/info.h @@ -131,6 +131,11 @@ const char* avdInfo_getName( AvdInfo* i ); */ const char* avdInfo_getImageFile( AvdInfo* i, AvdImageType imageType ); +/* Return the size of a given image file. Returns 0 if the file + * does not exist or could not be accessed. + */ +uint64_t avdInfo_getImageFileSize( AvdInfo* i, AvdImageType imageType ); + /* Returns 1 if the corresponding image file is read-only */ int avdInfo_isImageReadOnly( AvdInfo* i, AvdImageType imageType ); |