Android Guides | Samples

Android.Content.PackageContextFlags Enumeration

Syntax

[System.Flags]
public enum PackageContextFlags

Remarks

Members

Member NameDescription
IgnoreSecurityFlag for use with Context.CreatePackageContext(String,PackageContextFlags): ignore any security restrictions on the Context being requested, allowing it to always be loaded. For use with PackageContextFlags.IncludeCode to allow code to be loaded into a process even when it isn't safe to do so. Use with extreme care!
IncludeCodeFlag for use with Context.CreatePackageContext(String,PackageContextFlags): include the application code with the context. This means loading code into the caller's process, so that Context.ClassLoader can be used to instantiate the application's classes. Setting this flags imposes security restrictions on what application context you can access; if the requested application can not be safely loaded into your process, java.lang.SecurityException will be thrown. If this flag is not set, there will be no restrictions on the packages that can be loaded, but Context.ClassLoader will always return the default system class loader.
RestrictedFlag for use with Context.CreatePackageContext(String,PackageContextFlags): a restricted context may disable specific features. For instance, a View associated with a restricted context would ignore particular XML attributes.

Requirements

Namespace: Android.Content
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0

The members of Android.Content.PackageContextFlags are listed below.

See Also: Enum

Public Fields

IgnoreSecurityPackageContextFlags. Flag for use with Context.CreatePackageContext(String,PackageContextFlags): ignore any security restrictions on the Context being requested, allowing it to always be loaded. For use with PackageContextFlags.IncludeCode to allow code to be loaded into a process even when it isn't safe to do so. Use with extreme care!
IncludeCodePackageContextFlags. Flag for use with Context.CreatePackageContext(String,PackageContextFlags): include the application code with the context. This means loading code into the caller's process, so that Context.ClassLoader can be used to instantiate the application's classes. Setting this flags imposes security restrictions on what application context you can access; if the requested application can not be safely loaded into your process, java.lang.SecurityException will be thrown. If this flag is not set, there will be no restrictions on the packages that can be loaded, but Context.ClassLoader will always return the default system class loader.
RestrictedPackageContextFlags. Flag for use with Context.CreatePackageContext(String,PackageContextFlags): a restricted context may disable specific features. For instance, a View associated with a restricted context would ignore particular XML attributes.