Patent ID: 8813258

Claim:
In a computing environment, a system for allowing access to APIs based on application context, the system comprising: one or more processors; one or more computer readable media coupled to the one or more processors, wherein the one or more computer readable media comprise computer executable instructions that when executed by at least one processor cause the system to perform the following: determining a first application context for a first application; determining a first layer for a single base class library included in a single runtime deployed on a device, the single runtime exposing different subsets of available API surfaces of the single runtime to different applications such that some applications have richer API support when using the single runtime than other applications using the same single runtime, and wherein layers of the base class library are defined by one or more developer defined attributes associated with APIs, the APIs being included in the base class library, wherein the base class library is divided into layers based on the developer defined attributes, the developer defined attributes defining applications to which a given API of the single base class layer is exposed, such that the one or more attributes define which application contexts can access the given API; determining that the first layer matches the first application context and allowing access by the first application to one or more API in the first layer; determining a second application context for a second application that is different than the first application; determining a second layer for the single base class library included in the single runtime deployed on the device; and determining that the second layer matches the application context and allowing access by the second application to one or more API in the second layer of the single base class library while restricting access to one or more APIs included in the first layer of the single base class library that are not also included in the second layer of the single base class library such that the first application has richer API support than the second application.