FileDocCategorySizeDatePackage
ContextImpl.javaAPI DocAndroid 5.1 API97642Thu Mar 12 22:22:10 GMT 2015android.app

ReceiverRestrictedContext

public class ReceiverRestrictedContext extends android.content.ContextWrapper

Fields Summary
Constructors Summary
ReceiverRestrictedContext(android.content.Context base)

        super(base);
    
Methods Summary
public booleanbindService(android.content.Intent service, android.content.ServiceConnection conn, int flags)

        throw new ReceiverCallNotAllowedException(
                "BroadcastReceiver components are not allowed to bind to services");
    
public android.content.IntentregisterReceiver(android.content.BroadcastReceiver receiver, android.content.IntentFilter filter)

        return registerReceiver(receiver, filter, null, null);
    
public android.content.IntentregisterReceiver(android.content.BroadcastReceiver receiver, android.content.IntentFilter filter, java.lang.String broadcastPermission, android.os.Handler scheduler)

        if (receiver == null) {
            // Allow retrieving current sticky broadcast; this is safe since we
            // aren't actually registering a receiver.
            return super.registerReceiver(null, filter, broadcastPermission, scheduler);
        } else {
            throw new ReceiverCallNotAllowedException(
                    "BroadcastReceiver components are not allowed to register to receive intents");
        }
    
public android.content.IntentregisterReceiverAsUser(android.content.BroadcastReceiver receiver, android.os.UserHandle user, android.content.IntentFilter filter, java.lang.String broadcastPermission, android.os.Handler scheduler)

        if (receiver == null) {
            // Allow retrieving current sticky broadcast; this is safe since we
            // aren't actually registering a receiver.
            return super.registerReceiverAsUser(null, user, filter, broadcastPermission, scheduler);
        } else {
            throw new ReceiverCallNotAllowedException(
                    "BroadcastReceiver components are not allowed to register to receive intents");
        }