Share via


BlobStoreManager.CreateSession(BlobHandle) Method

Definition

Create a new session using the given BlobHandle, returning a unique id that represents the session.

[Android.Runtime.Register("createSession", "(Landroid/app/blob/BlobHandle;)J", "GetCreateSession_Landroid_app_blob_BlobHandle_Handler", ApiSince=30)]
public virtual long CreateSession (Android.App.Blob.BlobHandle blobHandle);
[<Android.Runtime.Register("createSession", "(Landroid/app/blob/BlobHandle;)J", "GetCreateSession_Landroid_app_blob_BlobHandle_Handler", ApiSince=30)>]
abstract member CreateSession : Android.App.Blob.BlobHandle -> int64
override this.CreateSession : Android.App.Blob.BlobHandle -> int64

Parameters

blobHandle
BlobHandle

the BlobHandle identifier for which a new session needs to be created.

Returns

positive, non-zero unique id that represents the created session. This id remains consistent across device reboots until the session is finalized. IDs are not reused during a given boot.

Attributes

Remarks

Create a new session using the given BlobHandle, returning a unique id that represents the session. Once created, the session can be opened multiple times across multiple device boots.

The system may automatically destroy sessions that have not been finalized (either committed or abandoned) within a reasonable period of time, typically about a week.

If an app is planning to acquire a lease on this data (using #acquireLease(BlobHandle, int) or one of it's other variants) after committing this data (using Session#commit(Executor, Consumer)), it is recommended that the app checks the remaining quota for acquiring a lease first using #getRemainingLeaseQuotaBytes() and can skip contributing this data if needed.

Java documentation for android.app.blob.BlobStoreManager.createSession(android.app.blob.BlobHandle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to