Sequenceablepublic final class StorageInfo extends Object implements Sequenceable
The storage information includes the application size, application data size, and application cached data size.
The information is usually returned at the request of
StorageInfoManager#queryInfoByPackageName(UUID, String, int) and
StorageInfoManager#queryInfoByUid(UUID, int).
This class also provides the Sequenceable interface,
with which you can marshal data into or unmarshal data from a parcel.
Specifically, if storage information is transmitted across processes,
the sender can marshal data to the Parcel and transmit the data,
and the receiver can unmarshal the data from the Parcel to obtain the storage information.
StorageInfoManager,
Parcel,
SequenceableSystemCapability.ResourceSchedule#STORAGE_INFOSequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static Sequenceable.Producer<StorageInfo> |
PRODUCER |
Default constructor used to create a
StorageInfo object. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
long |
getAppSize() |
Obtains the application size.
|
long |
getCacheSize() |
Obtains the application cached data size.
|
long |
getDataSize() |
Obtains the application data size.
|
boolean |
marshalling(Parcel out) |
Marshals the application storage status information.
|
boolean |
unmarshalling(Parcel in) |
Unmarshals the application storage status information.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasFileDescriptorpublic static final Sequenceable.Producer<StorageInfo> PRODUCER
StorageInfo object.
When you use this constructor to create a StorageInfo object,
also call its member method Sequenceable.Producer.createFromParcel(Parcel).
If the input parameter is empty, the operation will fail and null will be returned.
If application storage status information has been stored in the parcel object in
Parcel but you want to use the StorageInfo object instead,
run the following statement: StorageInfo info = StorageInfo.PRODUCER.createFromParcel(parcel).
public long getAppSize()
public long getDataSize()
The application data actually consists of two parts, the application data and the cached data.
public long getCacheSize()
public boolean marshalling(Parcel out)
Use this method to marshal the storage status information into Parcel.
This method overrides Sequenceable.marshalling(Parcel).
marshalling 在接口中 Sequenceableout - Indicates the parameter into which the storage status information is marshalled.true if marshalling is successful; returns false otherwise.public boolean unmarshalling(Parcel in)
Use this method to unmarshal the storage status information from the input Parcel
and save the information. This method overrides Sequenceable.unmarshalling(Parcel).
unmarshalling 在接口中 Sequenceablein - Indicates the parameter from which the storage status information is unmarshalled.true if unmarshalling is successful; returns false otherwise.