storage

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Overview

Package storage provides Go bindings for android.os.storage.

Index

Constants

View Source
const (
	ActionClearAppCache = consts.ActionClearAppCache
	ActionManageStorage = consts.ActionManageStorage
	ExtraRequestedBytes = consts.ExtraRequestedBytes
	ExtraUuid           = consts.ExtraUuid
	ExtraStorageVolume  = consts.ExtraStorageVolume
)

Variables

This section is empty.

Functions

func Init

func Init(env *jni.Env) error

Init resolves all JNI class and method references for this package. It is safe to call multiple times (uses sync.Once internally). Exported for E2E testing on Android.

Types

type Manager added in v0.0.4

type Manager struct {
	VM  *jni.VM
	Ctx *app.Context
	Obj *jni.GlobalRef
}

Manager wraps android.os.storage.StorageManager.

func NewManager added in v0.0.4

func NewManager(ctx *app.Context) (*Manager, error)

NewManager obtains android.os.storage.StorageManager from the Android system service manager.

func (*Manager) AllocateBytes2 added in v0.0.4

func (m *Manager) AllocateBytes2(arg0 *jni.Object, arg1 int64) error

AllocateBytes2 calls android.os.storage.StorageManager.allocateBytes.

func (*Manager) AllocateBytes2_1 added in v0.0.4

func (m *Manager) AllocateBytes2_1(arg0 *jni.Object, arg1 int64) error

AllocateBytes2_1 calls android.os.storage.StorageManager.allocateBytes.

func (*Manager) Close added in v0.0.4

func (m *Manager) Close()

Close releases the global reference to the underlying Java object. After Close, the Manager must not be used.

func (*Manager) GetAllocatableBytes added in v0.0.4

func (m *Manager) GetAllocatableBytes(arg0 *jni.Object) (int64, error)

GetAllocatableBytes calls android.os.storage.StorageManager.getAllocatableBytes.

func (*Manager) GetCacheQuotaBytes added in v0.0.4

func (m *Manager) GetCacheQuotaBytes(arg0 *jni.Object) (int64, error)

GetCacheQuotaBytes calls android.os.storage.StorageManager.getCacheQuotaBytes.

func (*Manager) GetCacheSizeBytes added in v0.0.4

func (m *Manager) GetCacheSizeBytes(arg0 *jni.Object) (int64, error)

GetCacheSizeBytes calls android.os.storage.StorageManager.getCacheSizeBytes.

func (*Manager) GetManageSpaceActivityIntent added in v0.0.4

func (m *Manager) GetManageSpaceActivityIntent(arg0 string, arg1 int32) (*jni.Object, error)

GetManageSpaceActivityIntent calls android.os.storage.StorageManager.getManageSpaceActivityIntent.

func (*Manager) GetMountedObbPath added in v0.0.4

func (m *Manager) GetMountedObbPath(arg0 string) (string, error)

GetMountedObbPath calls android.os.storage.StorageManager.getMountedObbPath.

func (*Manager) GetPrimaryStorageVolume added in v0.0.4

func (m *Manager) GetPrimaryStorageVolume() (*jni.Object, error)

GetPrimaryStorageVolume calls android.os.storage.StorageManager.getPrimaryStorageVolume.

func (*Manager) GetRecentStorageVolumes added in v0.0.4

func (m *Manager) GetRecentStorageVolumes() (*jni.Object, error)

GetRecentStorageVolumes calls android.os.storage.StorageManager.getRecentStorageVolumes.

func (*Manager) GetStorageVolume1 added in v0.0.4

func (m *Manager) GetStorageVolume1(arg0 *jni.Object) (*jni.Object, error)

GetStorageVolume1 calls android.os.storage.StorageManager.getStorageVolume.

func (*Manager) GetStorageVolume1_1 added in v0.0.4

func (m *Manager) GetStorageVolume1_1(arg0 *jni.Object) (*jni.Object, error)

GetStorageVolume1_1 calls android.os.storage.StorageManager.getStorageVolume.

func (*Manager) GetStorageVolumes added in v0.0.4

func (m *Manager) GetStorageVolumes() (*jni.Object, error)

GetStorageVolumes calls android.os.storage.StorageManager.getStorageVolumes.

func (*Manager) GetStorageVolumesIncludingSharedProfiles added in v0.0.4

func (m *Manager) GetStorageVolumesIncludingSharedProfiles() (*jni.Object, error)

GetStorageVolumesIncludingSharedProfiles calls android.os.storage.StorageManager.getStorageVolumesIncludingSharedProfiles.

func (*Manager) GetUuidForPath added in v0.0.4

func (m *Manager) GetUuidForPath(arg0 *jni.Object) (*jni.Object, error)

GetUuidForPath calls android.os.storage.StorageManager.getUuidForPath.

func (*Manager) IsAllocationSupported added in v0.0.4

func (m *Manager) IsAllocationSupported(arg0 *jni.Object) (bool, error)

IsAllocationSupported calls android.os.storage.StorageManager.isAllocationSupported.

func (*Manager) IsCacheBehaviorGroup added in v0.0.4

func (m *Manager) IsCacheBehaviorGroup(arg0 *jni.Object) (bool, error)

IsCacheBehaviorGroup calls android.os.storage.StorageManager.isCacheBehaviorGroup.

func (*Manager) IsCacheBehaviorTombstone added in v0.0.4

func (m *Manager) IsCacheBehaviorTombstone(arg0 *jni.Object) (bool, error)

IsCacheBehaviorTombstone calls android.os.storage.StorageManager.isCacheBehaviorTombstone.

func (*Manager) IsCheckpointSupported added in v0.0.4

func (m *Manager) IsCheckpointSupported() (bool, error)

IsCheckpointSupported calls android.os.storage.StorageManager.isCheckpointSupported.

func (*Manager) IsEncrypted added in v0.0.4

func (m *Manager) IsEncrypted(arg0 *jni.Object) (bool, error)

IsEncrypted calls android.os.storage.StorageManager.isEncrypted.

func (*Manager) IsObbMounted added in v0.0.4

func (m *Manager) IsObbMounted(arg0 string) (bool, error)

IsObbMounted calls android.os.storage.StorageManager.isObbMounted.

func (*Manager) MountObb added in v0.0.4

func (m *Manager) MountObb(
	arg0 string,
	arg1 string,
	arg2 *jni.Object,
) (bool, error)

MountObb calls android.os.storage.StorageManager.mountObb.

func (*Manager) RegisterStorageVolumeCallback added in v0.0.4

func (m *Manager) RegisterStorageVolumeCallback(arg0 *jni.Object, arg1 *jni.Object) error

RegisterStorageVolumeCallback calls android.os.storage.StorageManager.registerStorageVolumeCallback.

func (*Manager) SetCacheBehaviorGroup added in v0.0.4

func (m *Manager) SetCacheBehaviorGroup(arg0 *jni.Object, arg1 bool) error

SetCacheBehaviorGroup calls android.os.storage.StorageManager.setCacheBehaviorGroup.

func (*Manager) SetCacheBehaviorTombstone added in v0.0.4

func (m *Manager) SetCacheBehaviorTombstone(arg0 *jni.Object, arg1 bool) error

SetCacheBehaviorTombstone calls android.os.storage.StorageManager.setCacheBehaviorTombstone.

func (*Manager) UnmountObb added in v0.0.4

func (m *Manager) UnmountObb(
	arg0 string,
	arg1 bool,
	arg2 *jni.Object,
) (bool, error)

UnmountObb calls android.os.storage.StorageManager.unmountObb.

func (*Manager) UnregisterStorageVolumeCallback added in v0.0.4

func (m *Manager) UnregisterStorageVolumeCallback(arg0 *jni.Object) error

UnregisterStorageVolumeCallback calls android.os.storage.StorageManager.unregisterStorageVolumeCallback.

type Volume added in v0.0.4

type Volume struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

Volume wraps android.os.storage.StorageVolume.

func (*Volume) CreateAccessIntent added in v0.0.4

func (m *Volume) CreateAccessIntent(arg0 string) (*jni.Object, error)

CreateAccessIntent calls android.os.storage.StorageVolume.createAccessIntent.

func (*Volume) CreateOpenDocumentTreeIntent added in v0.0.4

func (m *Volume) CreateOpenDocumentTreeIntent() (*jni.Object, error)

CreateOpenDocumentTreeIntent calls android.os.storage.StorageVolume.createOpenDocumentTreeIntent.

func (*Volume) DescribeContents added in v0.0.4

func (m *Volume) DescribeContents() (int32, error)

DescribeContents calls android.os.storage.StorageVolume.describeContents.

func (*Volume) Equals added in v0.0.4

func (m *Volume) Equals(arg0 *jni.Object) (bool, error)

Equals calls android.os.storage.StorageVolume.equals.

func (*Volume) GetDescription added in v0.0.4

func (m *Volume) GetDescription(arg0 *jni.Object) (string, error)

GetDescription calls android.os.storage.StorageVolume.getDescription.

func (*Volume) GetDirectory added in v0.0.4

func (m *Volume) GetDirectory() (*jni.Object, error)

GetDirectory calls android.os.storage.StorageVolume.getDirectory.

func (*Volume) GetMediaStoreVolumeName added in v0.0.4

func (m *Volume) GetMediaStoreVolumeName() (string, error)

GetMediaStoreVolumeName calls android.os.storage.StorageVolume.getMediaStoreVolumeName.

func (*Volume) GetOwner added in v0.0.4

func (m *Volume) GetOwner() (*jni.Object, error)

GetOwner calls android.os.storage.StorageVolume.getOwner.

func (*Volume) GetState added in v0.0.4

func (m *Volume) GetState() (string, error)

GetState calls android.os.storage.StorageVolume.getState.

func (*Volume) GetStorageUuid added in v0.0.4

func (m *Volume) GetStorageUuid() (*jni.Object, error)

GetStorageUuid calls android.os.storage.StorageVolume.getStorageUuid.

func (*Volume) GetUuid added in v0.0.4

func (m *Volume) GetUuid() (string, error)

GetUuid calls android.os.storage.StorageVolume.getUuid.

func (*Volume) HashCode added in v0.0.4

func (m *Volume) HashCode() (int32, error)

HashCode calls android.os.storage.StorageVolume.hashCode.

func (*Volume) IsEmulated added in v0.0.4

func (m *Volume) IsEmulated() (bool, error)

IsEmulated calls android.os.storage.StorageVolume.isEmulated.

func (*Volume) IsPrimary added in v0.0.4

func (m *Volume) IsPrimary() (bool, error)

IsPrimary calls android.os.storage.StorageVolume.isPrimary.

func (*Volume) IsRemovable added in v0.0.4

func (m *Volume) IsRemovable() (bool, error)

IsRemovable calls android.os.storage.StorageVolume.isRemovable.

func (*Volume) ToString added in v0.0.4

func (m *Volume) ToString() (string, error)

ToString calls android.os.storage.StorageVolume.toString.

func (*Volume) WriteToParcel added in v0.0.4

func (m *Volume) WriteToParcel(arg0 *jni.Object, arg1 int32) error

WriteToParcel calls android.os.storage.StorageVolume.writeToParcel.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL