Example usage for android.content Intent FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT

List of usage examples for android.content Intent FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT

Introduction

In this page you can find the example usage for android.content Intent FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT.

Prototype

int FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT

To view the source code for android.content Intent FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT.

Click Source Link

Document

If set, when sending a broadcast before boot has completed only registered receivers will be called -- no BroadcastReceiver components will be launched.

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);
}