Example usage for android.os.storage StorageVolume EXTRA_STORAGE_VOLUME

List of usage examples for android.os.storage StorageVolume EXTRA_STORAGE_VOLUME

Introduction

In this page you can find the example usage for android.os.storage StorageVolume EXTRA_STORAGE_VOLUME.

Prototype

String EXTRA_STORAGE_VOLUME

To view the source code for android.os.storage StorageVolume EXTRA_STORAGE_VOLUME.

Click Source Link

Document

Name of the Parcelable extra in the Intent#ACTION_MEDIA_REMOVED , Intent#ACTION_MEDIA_UNMOUNTED , Intent#ACTION_MEDIA_CHECKING , Intent#ACTION_MEDIA_NOFS , Intent#ACTION_MEDIA_MOUNTED , Intent#ACTION_MEDIA_SHARED , Intent#ACTION_MEDIA_BAD_REMOVAL , Intent#ACTION_MEDIA_UNMOUNTABLE , and Intent#ACTION_MEDIA_EJECT broadcast that contains a StorageVolume .

Usage

From source file:com.android.server.MountService.java

private void sendStorageIntent(String action, StorageVolume volume, UserHandle user) {
    final Intent intent = new Intent(action, Uri.parse("file://" + volume.getPath()));
    intent.putExtra(StorageVolume.EXTRA_STORAGE_VOLUME, volume);
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    Slog.d(TAG, "sendStorageIntent " + intent + " to " + user);
    mContext.sendBroadcastAsUser(intent, user);
}