public class BroadcastOptions extends Object
Context.sendBroadcast(Intent)
and related methods.
Constructor and Description |
---|
BroadcastOptions(Bundle opts) |
Modifier and Type | Method and Description |
---|---|
int |
getMaxManifestReceiverApiLevel()
|
int |
getMinManifestReceiverApiLevel()
|
long |
getTemporaryAppWhitelistDuration()
|
static BroadcastOptions |
makeBasic() |
void |
setMaxManifestReceiverApiLevel(int apiLevel)
Set the maximum target API level of receivers of the broadcast.
|
void |
setMinManifestReceiverApiLevel(int apiLevel)
Set the minimum target API level of receivers of the broadcast.
|
void |
setTemporaryAppWhitelistDuration(long duration)
Set a duration for which the system should temporary place an application on the
power whitelist when this broadcast is being delivered to it.
|
Bundle |
toBundle()
Returns the created options as a Bundle, which can be passed to
Context.sendBroadcast(Intent) and related methods. |
public BroadcastOptions(Bundle opts)
public static BroadcastOptions makeBasic()
public void setTemporaryAppWhitelistDuration(long duration)
duration
- The duration in milliseconds; 0 means to not place on whitelist.public long getTemporaryAppWhitelistDuration()
public void setMinManifestReceiverApiLevel(int apiLevel)
public int getMinManifestReceiverApiLevel()
public void setMaxManifestReceiverApiLevel(int apiLevel)
public int getMaxManifestReceiverApiLevel()
public Bundle toBundle()
Context.sendBroadcast(Intent)
and related methods.
Note that the returned Bundle is still owned by the BroadcastOptions
object; you must not modify it, but can supply it to the sendBroadcast
methods that take an options Bundle.